MCPcopy Index your code
hub / github.com/cli/cli / pullRequestFragment

Function pullRequestFragment

pkg/cmd/pr/status/http.go:200–223  ·  view source on GitHub ↗
(conflictStatus bool, statusCheckRollupWithCountByState bool)

Source from the content-addressed store, hash-verified

198}
199
200func 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}

Callers 1

pullRequestStatusFunction · 0.85

Calls 1

PullRequestGraphQLFunction · 0.92

Tested by

no test coverage detected