(conflictStatus bool, statusCheckRollupWithCountByState bool)
| 198 | } |
| 199 | |
| 200 | func pullRequestFragment(conflictStatus bool, statusCheckRollupWithCountByState bool) (string, error) { |
| 201 | fields := []string{ |
| 202 | "number", "title", "state", "url", "isDraft", "isCrossRepository", |
| 203 | "headRefName", "headRepositoryOwner", "mergeStateStatus", |
| 204 | "requiresStrictStatusChecks", "autoMergeRequest", |
| 205 | } |
| 206 | |
| 207 | if conflictStatus { |
| 208 | fields = append(fields, "mergeable") |
| 209 | } |
| 210 | |
| 211 | if statusCheckRollupWithCountByState { |
| 212 | fields = append(fields, "statusCheckRollupWithCountByState") |
| 213 | } else { |
| 214 | fields = append(fields, "statusCheckRollup") |
| 215 | } |
| 216 | |
| 217 | reviewFields := []string{"reviewDecision", "latestReviews"} |
| 218 | fragments := fmt.Sprintf(` |
| 219 | fragment pr on PullRequest {%s} |
| 220 | fragment prWithReviews on PullRequest {...pr,%s} |
| 221 | `, api.PullRequestGraphQL(fields), api.PullRequestGraphQL(reviewFields)) |
| 222 | return fragments, nil |
| 223 | } |
no test coverage detected