From 0d19d36a1e83911ae81bc6d484bef5db21892b5e Mon Sep 17 00:00:00 2001 From: Evan Krause Date: Fri, 20 Sep 2024 10:49:18 +0200 Subject: [PATCH] [isl] Add baseRef/headRef/oid to github pull request fetches Summary: Add extra fields for the PR commit range (base and head) which lets us understand which PR branches exist in your repo Test Plan: Used in later diffs --- .../src/github/generated/graphql.ts | 34 ++++++++++++++++--- .../queries/YourPullRequestsQuery.graphql | 15 +++++++- ...PullRequestsWithoutMergeQueueQuery.graphql | 15 +++++++- 3 files changed, 58 insertions(+), 6 deletions(-) diff --git a/addons/isl-server/src/github/generated/graphql.ts b/addons/isl-server/src/github/generated/graphql.ts index 29ace5e917434..00ef5939473b4 100644 --- a/addons/isl-server/src/github/generated/graphql.ts +++ b/addons/isl-server/src/github/generated/graphql.ts @@ -29508,7 +29508,7 @@ export type YourPullRequestsQueryVariables = Exact<{ }>; -export type YourPullRequestsQueryData = { __typename?: 'Query', search: { __typename?: 'SearchResultItemConnection', nodes?: Array<{ __typename?: 'App' } | { __typename?: 'Discussion' } | { __typename?: 'Issue' } | { __typename?: 'MarketplaceListing' } | { __typename?: 'Organization' } | { __typename: 'PullRequest', number: number, title: string, body: string, state: PullRequestState, isDraft: boolean, url: string, reviewDecision?: PullRequestReviewDecision | null, comments: { __typename?: 'IssueCommentConnection', totalCount: number }, mergeQueueEntry?: { __typename?: 'MergeQueueEntry', estimatedTimeToMerge?: number | null } | null, commits: { __typename?: 'PullRequestCommitConnection', nodes?: Array<{ __typename?: 'PullRequestCommit', commit: { __typename?: 'Commit', statusCheckRollup?: { __typename?: 'StatusCheckRollup', state: StatusState } | null } } | null> | null } } | { __typename?: 'Repository' } | { __typename?: 'User' } | null> | null } }; +export type YourPullRequestsQueryData = { __typename?: 'Query', search: { __typename?: 'SearchResultItemConnection', nodes?: Array<{ __typename?: 'App' } | { __typename?: 'Discussion' } | { __typename?: 'Issue' } | { __typename?: 'MarketplaceListing' } | { __typename?: 'Organization' } | { __typename: 'PullRequest', number: number, title: string, body: string, state: PullRequestState, isDraft: boolean, url: string, reviewDecision?: PullRequestReviewDecision | null, comments: { __typename?: 'IssueCommentConnection', totalCount: number }, mergeQueueEntry?: { __typename?: 'MergeQueueEntry', estimatedTimeToMerge?: number | null } | null, baseRef?: { __typename?: 'Ref', name: string, target?: { __typename?: 'Blob', oid: string } | { __typename?: 'Commit', oid: string } | { __typename?: 'Tag', oid: string } | { __typename?: 'Tree', oid: string } | null } | null, headRef?: { __typename?: 'Ref', name: string, target?: { __typename?: 'Blob', oid: string } | { __typename?: 'Commit', oid: string } | { __typename?: 'Tag', oid: string } | { __typename?: 'Tree', oid: string } | null } | null, commits: { __typename?: 'PullRequestCommitConnection', nodes?: Array<{ __typename?: 'PullRequestCommit', commit: { __typename?: 'Commit', oid: string, statusCheckRollup?: { __typename?: 'StatusCheckRollup', state: StatusState } | null } } | null> | null } } | { __typename?: 'Repository' } | { __typename?: 'User' } | null> | null } }; export type YourPullRequestsWithoutMergeQueueQueryVariables = Exact<{ searchQuery: Scalars['String']; @@ -29516,7 +29516,7 @@ export type YourPullRequestsWithoutMergeQueueQueryVariables = Exact<{ }>; -export type YourPullRequestsWithoutMergeQueueQueryData = { __typename?: 'Query', search: { __typename?: 'SearchResultItemConnection', nodes?: Array<{ __typename?: 'App' } | { __typename?: 'Discussion' } | { __typename?: 'Issue' } | { __typename?: 'MarketplaceListing' } | { __typename?: 'Organization' } | { __typename: 'PullRequest', number: number, title: string, body: string, state: PullRequestState, isDraft: boolean, url: string, reviewDecision?: PullRequestReviewDecision | null, comments: { __typename?: 'IssueCommentConnection', totalCount: number }, commits: { __typename?: 'PullRequestCommitConnection', nodes?: Array<{ __typename?: 'PullRequestCommit', commit: { __typename?: 'Commit', statusCheckRollup?: { __typename?: 'StatusCheckRollup', state: StatusState } | null } } | null> | null } } | { __typename?: 'Repository' } | { __typename?: 'User' } | null> | null } }; +export type YourPullRequestsWithoutMergeQueueQueryData = { __typename?: 'Query', search: { __typename?: 'SearchResultItemConnection', nodes?: Array<{ __typename?: 'App' } | { __typename?: 'Discussion' } | { __typename?: 'Issue' } | { __typename?: 'MarketplaceListing' } | { __typename?: 'Organization' } | { __typename: 'PullRequest', number: number, title: string, body: string, state: PullRequestState, isDraft: boolean, url: string, reviewDecision?: PullRequestReviewDecision | null, comments: { __typename?: 'IssueCommentConnection', totalCount: number }, baseRef?: { __typename?: 'Ref', name: string, target?: { __typename?: 'Blob', oid: string } | { __typename?: 'Commit', oid: string } | { __typename?: 'Tag', oid: string } | { __typename?: 'Tree', oid: string } | null } | null, headRef?: { __typename?: 'Ref', name: string, target?: { __typename?: 'Blob', oid: string } | { __typename?: 'Commit', oid: string } | { __typename?: 'Tag', oid: string } | { __typename?: 'Tree', oid: string } | null } | null, commits: { __typename?: 'PullRequestCommitConnection', nodes?: Array<{ __typename?: 'PullRequestCommit', commit: { __typename?: 'Commit', oid: string, statusCheckRollup?: { __typename?: 'StatusCheckRollup', state: StatusState } | null } } | null> | null } } | { __typename?: 'Repository' } | { __typename?: 'User' } | null> | null } }; export const CommentParts = ` fragment CommentParts on Comment { @@ -29595,9 +29595,22 @@ export const YourPullRequestsQuery = ` mergeQueueEntry { estimatedTimeToMerge } - commits(last: 1) { + baseRef { + target { + oid + } + name + } + headRef { + target { + oid + } + name + } + commits(last: 100) { nodes { commit { + oid statusCheckRollup { state } @@ -29625,9 +29638,22 @@ export const YourPullRequestsWithoutMergeQueueQuery = ` comments { totalCount } - commits(last: 1) { + baseRef { + target { + oid + } + name + } + headRef { + target { + oid + } + name + } + commits(last: 100) { nodes { commit { + oid statusCheckRollup { state } diff --git a/addons/isl-server/src/github/queries/YourPullRequestsQuery.graphql b/addons/isl-server/src/github/queries/YourPullRequestsQuery.graphql index 34960b1c8682e..5044a12c9cfea 100644 --- a/addons/isl-server/src/github/queries/YourPullRequestsQuery.graphql +++ b/addons/isl-server/src/github/queries/YourPullRequestsQuery.graphql @@ -16,9 +16,22 @@ query YourPullRequestsQuery($searchQuery: String!, $numToFetch: Int!) { mergeQueueEntry { estimatedTimeToMerge } - commits(last: 1) { + baseRef { + target { + oid + } + name + } + headRef { + target { + oid + } + name + } + commits(last: 100) { nodes { commit { + oid statusCheckRollup { state } diff --git a/addons/isl-server/src/github/queries/YourPullRequestsWithoutMergeQueueQuery.graphql b/addons/isl-server/src/github/queries/YourPullRequestsWithoutMergeQueueQuery.graphql index 061ab493494e9..47cf783cb60e6 100644 --- a/addons/isl-server/src/github/queries/YourPullRequestsWithoutMergeQueueQuery.graphql +++ b/addons/isl-server/src/github/queries/YourPullRequestsWithoutMergeQueueQuery.graphql @@ -13,9 +13,22 @@ query YourPullRequestsWithoutMergeQueueQuery($searchQuery: String!, $numToFetch: comments { totalCount } - commits(last: 1) { + baseRef { + target { + oid + } + name + } + headRef { + target { + oid + } + name + } + commits(last: 100) { nodes { commit { + oid statusCheckRollup { state }