@gitkraken/core-gitlens 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -1
- package/dist/plus/git-github/api/config.d.ts +11 -0
- package/dist/plus/git-github/api/config.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +31 -0
- package/dist/plus/git-github/api/github.js +48 -24
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/models.d.ts +15 -8
- package/dist/plus/git-github/models.js +4 -3
- package/dist/plus/git-github/models.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +12 -0
- package/dist/plus/integrations/fieldPresence.d.ts +11 -1
- package/dist/plus/integrations/fieldPresence.js +18 -1
- package/dist/plus/integrations/fieldPresence.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +12 -0
- package/dist/plus/integrations/integrationService.js +4 -0
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +38 -0
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +15 -0
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +8 -0
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/providers/github/github.js +2 -1
- package/dist/plus/integrations/providers/github/github.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +5 -0
- package/dist/plus/integrations/providers/github.js +18 -5
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/reads/context.d.ts +7 -0
- package/dist/plus/integrations/reads/drains.d.ts +1 -1
- package/dist/plus/integrations/reads/drains.js +2 -1
- package/dist/plus/integrations/reads/drains.js.map +1 -1
- package/dist/plus/integrations/reads/etag.js +2 -0
- package/dist/plus/integrations/reads/etag.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBatch.d.ts +6 -2
- package/dist/plus/integrations/reads/pullRequestBatch.js +9 -2
- package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBranches.d.ts +2 -0
- package/dist/plus/integrations/reads/pullRequestBranches.js +3 -1
- package/dist/plus/integrations/reads/pullRequestBranches.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequests.d.ts +2 -0
- package/dist/plus/integrations/reads/pullRequests.js +2 -1
- package/dist/plus/integrations/reads/pullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +2 -0
- package/dist/plus/integrations/reads/searchPullRequests.js +2 -1
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/docs/integrations.md +46 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.35.0] - 2026-11-08
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Breaking (plus/git-github, plus/integrations)** — GitHub.com pull request reads no longer select merge-queue data unless the host opts in with `ConfigProvider.getPullRequestReadOptions` (`{ mergeQueue: true }`; `GitHubApiConfig.getPullRequestReadOptions` for a `GitHubApi` built directly), or per read with `mergeQueue` on `listPullRequestsPage`, `searchPullRequestsPage`, `getPullRequestsBatch`, `getPullRequestsForBranches`, `sweepPullRequests` and `sweepClosedPullRequests` (`true` selects it, `false` doesn't, omitted follows the host; the host-cached point reads follow the host alone, and a repo-scoped list or sweep goes through provider-apis, which selects none). Without the selection (`mergeQueue: false`, or neither the read nor the host asking for it), rows carry no `mergeQueue`, `mergeQueueRequired` or `mergeQueueRemoval`, `getPullRequestFieldPresence` answers `mergeQueue: 'not-requested'`, the etag cheap check selects no queue state, and no pull request's etag carries queue state or a removal (so a pull request joining, moving through or leaving a queue, or joining and being removed between two checks, no longer reads as changed), and reads cost what they did before 0.34.0 (the `timelineItems(last: 1)` connection, one rate-limit request per row, is gone: e.g. a 30-row full search page is 1 point instead of 2 and a 25-branch `getPullRequestsForBranches` chunk 10 instead of 13). `getMergeQueueEntriesForBranches`, `enqueuePullRequest` and `dequeuePullRequest` are unaffected. A read with merge-queue data adds a marker to every etag it computes, so an etag stored by a read made the other way compares changed once and is read in full again, as does every 0.34.0 etag once a read selects the data. A read without it computes the etag it did before 0.34.0, so under such a read a held 0.34.0 etag of a pull request that wasn't queued or removed still compares unchanged, and its row keeps the merge-queue fields it was read with until it next changes
|
|
14
|
+
|
|
9
15
|
## [0.34.0] - 2026-11-08
|
|
10
16
|
|
|
11
17
|
### Added
|
|
@@ -1187,7 +1193,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
|
|
|
1187
1193
|
|
|
1188
1194
|
- Initial release. Bundles `@gitlens/utils`, `@gitlens/git`, `@gitlens/git-cli`, `@gitlens/ai`, and `@gitlens/git-github` into a single core npm package with subpath exports.
|
|
1189
1195
|
|
|
1190
|
-
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.
|
|
1196
|
+
[unreleased]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.35.0...HEAD
|
|
1197
|
+
[0.35.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.34.0...gitkraken:releases/core/v0.35.0
|
|
1191
1198
|
[0.34.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.33.0...gitkraken:releases/core/v0.34.0
|
|
1192
1199
|
[0.33.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.32.0...gitkraken:releases/core/v0.33.0
|
|
1193
1200
|
[0.32.0]: https://github.com/gitkraken/vscode-gitlens/compare/releases/core/v0.31.0...gitkraken:releases/core/v0.32.0
|
|
@@ -63,6 +63,17 @@ export interface GitHubApiConfig {
|
|
|
63
63
|
* Only used when `getLaunchpadIncludedOrganizations` returns empty.
|
|
64
64
|
*/
|
|
65
65
|
getLaunchpadIgnoredOrganizations?(): string[];
|
|
66
|
+
/**
|
|
67
|
+
* Pull request read knobs. `mergeQueue: true` makes GitHub.com pull request reads select merge-queue data (the
|
|
68
|
+
* queue entry, whether the base branch requires a queue, and the latest queue removal) and the etag cheap check
|
|
69
|
+
* select its queue state. Off (omitted) by default: the selection costs a GitHub rate-limit request per pull
|
|
70
|
+
* request read, and makes a queued pull request's etag change with every queue state change. A read's own
|
|
71
|
+
* `mergeQueue` option, where it takes one, overrides this. Read on every query build, so a change applies from
|
|
72
|
+
* the next read.
|
|
73
|
+
*/
|
|
74
|
+
getPullRequestReadOptions?(): {
|
|
75
|
+
readonly mergeQueue?: boolean;
|
|
76
|
+
};
|
|
66
77
|
}
|
|
67
78
|
/**
|
|
68
79
|
* The maximum number of results GitHub's search will serve for ONE query, however it is paged. A search whose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":[],"sources":["../../../../../plus/git-github/src/api/config.ts"],"sourcesContent":["import type { AuthenticationError } from '@gitlens/git/errors.js';\nimport type { Provider } from '@gitlens/git/models/remoteProvider.js';\n\n/**\n * VS Code-free configuration interface for {@link GitHubApi}.\n *\n * The extension creates an instance by wiring VS Code-specific values\n * (settings, proxy agent, SSL wrapper, UI dialogs) into these callbacks.\n * The package never imports anything from VS Code.\n */\nexport interface GitHubApiConfig {\n\t/** Whether we're running in a web worker (vscode.dev) vs Node.js desktop. */\n\treadonly isWeb: boolean;\n\n\t/** The `fetch` implementation to use for HTTP requests. */\n\treadonly fetch: (url: string, init?: any) => Promise<Response>;\n\n\t/**\n\t * Wraps an async operation so that TLS certificate validation\n\t * is disabled when the provider's `getIgnoreSSLErrors()` returns `'force'`.\n\t */\n\twrapForForcedInsecureSSL<T>(ignoreSSLErrors: boolean | 'force', fn: () => Promise<T>): Promise<T>;\n\n\t/**\n\t * Fires when proxy/SSL configuration changes, so the API can reset\n\t * its HTTP caches (proxy agent, default request instances, etc.).\n\t */\n\tonConfigChanged?(listener: () => void): { dispose(): void };\n\n\t/**\n\t * Called when authentication fails (401/403) and reauthentication might help.\n\t *\n\t * The extension shows a dialog and calls `provider.reauthenticate()` if\n\t * the user confirms. Returns `true` if the user chose to reauthenticate,\n\t * allowing the package to reset caches and fire `onDidReauthenticate`.\n\t */\n\tonAuthenticationFailure?(error: AuthenticationError, provider: Provider | undefined): Promise<boolean>;\n\n\t/**\n\t * Called on server errors (500/502/503) or timeouts.\n\t * The extension decides how to present this (notification, status bar, etc.).\n\t */\n\tonRequestError?(provider: Provider | undefined, message: string): void;\n\n\t/**\n\t * Called for debug-mode error display (only when `Logger.isDebugging`).\n\t * The extension may show an error notification or log it.\n\t */\n\tonDebugError?(message: string): void;\n\n\t// These are passed through config because they come from VS Code settings.\n\t// The code in GitHubApi's searchMyPullRequests has \"Hack\" comments noting\n\t// these should eventually be passed through method options instead.\n\n\t/**\n\t * Returns the Launchpad search query limit (max PRs to fetch).\n\t * Defaults to 100 if not provided.\n\t */\n\tgetLaunchpadQueryLimit?(): number;\n\n\t/**\n\t * Returns repositories to exclude from Launchpad search queries.\n\t * Format: `owner/repo` strings.\n\t */\n\tgetLaunchpadIgnoredRepositories?(): string[];\n\n\t/**\n\t * Returns organizations to include in Launchpad search queries.\n\t * When non-empty, only these orgs are searched.\n\t */\n\tgetLaunchpadIncludedOrganizations?(): string[];\n\n\t/**\n\t * Returns organizations to exclude from Launchpad search queries.\n\t * Only used when `getLaunchpadIncludedOrganizations` returns empty.\n\t */\n\tgetLaunchpadIgnoredOrganizations?(): string[];\n}\n\n/**\n * The maximum number of results GitHub's search will serve for ONE query, however it is paged. A search whose\n * `issueCount` exceeds this cannot be read in full: the items past the ceiling are UNREACHABLE, not merely\n * unfetched — no budget, no retry and no cursor returns them.\n *\n * It lives in this leaf module rather than beside the search that detects it because the facade's\n * provider-agnostic metadata table reports the same ceiling to consumers, and the two must be one number: a\n * duplicated literal drifts silently, and drift here means quoting a limit the client doesn't enforce. Importing\n * it from `github.ts` would have pulled that module — and its octokit dependencies — eagerly into the graph of\n * one of the most widely imported modules in the integrations package, for the sake of a single integer.\n */\nexport const githubSearchResultLimit = 1000;\n"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"config.js","names":[],"sources":["../../../../../plus/git-github/src/api/config.ts"],"sourcesContent":["import type { AuthenticationError } from '@gitlens/git/errors.js';\nimport type { Provider } from '@gitlens/git/models/remoteProvider.js';\n\n/**\n * VS Code-free configuration interface for {@link GitHubApi}.\n *\n * The extension creates an instance by wiring VS Code-specific values\n * (settings, proxy agent, SSL wrapper, UI dialogs) into these callbacks.\n * The package never imports anything from VS Code.\n */\nexport interface GitHubApiConfig {\n\t/** Whether we're running in a web worker (vscode.dev) vs Node.js desktop. */\n\treadonly isWeb: boolean;\n\n\t/** The `fetch` implementation to use for HTTP requests. */\n\treadonly fetch: (url: string, init?: any) => Promise<Response>;\n\n\t/**\n\t * Wraps an async operation so that TLS certificate validation\n\t * is disabled when the provider's `getIgnoreSSLErrors()` returns `'force'`.\n\t */\n\twrapForForcedInsecureSSL<T>(ignoreSSLErrors: boolean | 'force', fn: () => Promise<T>): Promise<T>;\n\n\t/**\n\t * Fires when proxy/SSL configuration changes, so the API can reset\n\t * its HTTP caches (proxy agent, default request instances, etc.).\n\t */\n\tonConfigChanged?(listener: () => void): { dispose(): void };\n\n\t/**\n\t * Called when authentication fails (401/403) and reauthentication might help.\n\t *\n\t * The extension shows a dialog and calls `provider.reauthenticate()` if\n\t * the user confirms. Returns `true` if the user chose to reauthenticate,\n\t * allowing the package to reset caches and fire `onDidReauthenticate`.\n\t */\n\tonAuthenticationFailure?(error: AuthenticationError, provider: Provider | undefined): Promise<boolean>;\n\n\t/**\n\t * Called on server errors (500/502/503) or timeouts.\n\t * The extension decides how to present this (notification, status bar, etc.).\n\t */\n\tonRequestError?(provider: Provider | undefined, message: string): void;\n\n\t/**\n\t * Called for debug-mode error display (only when `Logger.isDebugging`).\n\t * The extension may show an error notification or log it.\n\t */\n\tonDebugError?(message: string): void;\n\n\t// These are passed through config because they come from VS Code settings.\n\t// The code in GitHubApi's searchMyPullRequests has \"Hack\" comments noting\n\t// these should eventually be passed through method options instead.\n\n\t/**\n\t * Returns the Launchpad search query limit (max PRs to fetch).\n\t * Defaults to 100 if not provided.\n\t */\n\tgetLaunchpadQueryLimit?(): number;\n\n\t/**\n\t * Returns repositories to exclude from Launchpad search queries.\n\t * Format: `owner/repo` strings.\n\t */\n\tgetLaunchpadIgnoredRepositories?(): string[];\n\n\t/**\n\t * Returns organizations to include in Launchpad search queries.\n\t * When non-empty, only these orgs are searched.\n\t */\n\tgetLaunchpadIncludedOrganizations?(): string[];\n\n\t/**\n\t * Returns organizations to exclude from Launchpad search queries.\n\t * Only used when `getLaunchpadIncludedOrganizations` returns empty.\n\t */\n\tgetLaunchpadIgnoredOrganizations?(): string[];\n\n\t/**\n\t * Pull request read knobs. `mergeQueue: true` makes GitHub.com pull request reads select merge-queue data (the\n\t * queue entry, whether the base branch requires a queue, and the latest queue removal) and the etag cheap check\n\t * select its queue state. Off (omitted) by default: the selection costs a GitHub rate-limit request per pull\n\t * request read, and makes a queued pull request's etag change with every queue state change. A read's own\n\t * `mergeQueue` option, where it takes one, overrides this. Read on every query build, so a change applies from\n\t * the next read.\n\t */\n\tgetPullRequestReadOptions?(): { readonly mergeQueue?: boolean };\n}\n\n/**\n * The maximum number of results GitHub's search will serve for ONE query, however it is paged. A search whose\n * `issueCount` exceeds this cannot be read in full: the items past the ceiling are UNREACHABLE, not merely\n * unfetched — no budget, no retry and no cursor returns them.\n *\n * It lives in this leaf module rather than beside the search that detects it because the facade's\n * provider-agnostic metadata table reports the same ceiling to consumers, and the two must be one number: a\n * duplicated literal drifts silently, and drift here means quoting a limit the client doesn't enforce. Importing\n * it from `github.ts` would have pulled that module — and its octokit dependencies — eagerly into the graph of\n * one of the most widely imported modules in the integrations package, for the sake of a single integer.\n */\nexport const githubSearchResultLimit = 1000;\n"],"mappings":";;;;;;;;;;;;AAoGA,MAAa,0BAA0B"}
|
|
@@ -110,15 +110,27 @@ export declare class GitHubApi {
|
|
|
110
110
|
getPullRequest(provider: Provider, token: GitHubTokenInfo, owner: string, repo: string, number: number, options?: {
|
|
111
111
|
baseUrl?: string;
|
|
112
112
|
avatarSize?: number;
|
|
113
|
+
/**
|
|
114
|
+
* Whether this read selects merge-queue data, over the host's `getPullRequestReadOptions`. GitHub.com only.
|
|
115
|
+
*/
|
|
116
|
+
mergeQueue?: boolean;
|
|
113
117
|
}): Promise<PullRequest | undefined>;
|
|
114
118
|
getPullRequestForBranch(provider: Provider, token: GitHubTokenInfo, owner: string, repo: string, branch: string, options?: {
|
|
115
119
|
baseUrl?: string;
|
|
116
120
|
avatarSize?: number;
|
|
117
121
|
include?: GitHubPullRequestState[];
|
|
122
|
+
/**
|
|
123
|
+
* Whether this read selects merge-queue data, over the host's `getPullRequestReadOptions`. GitHub.com only.
|
|
124
|
+
*/
|
|
125
|
+
mergeQueue?: boolean;
|
|
118
126
|
}): Promise<PullRequest | undefined>;
|
|
119
127
|
getPullRequestForCommit(provider: Provider, token: GitHubTokenInfo, owner: string, repo: string, rev: string, options?: {
|
|
120
128
|
baseUrl?: string;
|
|
121
129
|
avatarSize?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Whether this read selects merge-queue data, over the host's `getPullRequestReadOptions`. GitHub.com only.
|
|
132
|
+
*/
|
|
133
|
+
mergeQueue?: boolean;
|
|
122
134
|
}, cancellation?: AbortSignal): Promise<PullRequest | undefined>;
|
|
123
135
|
getRepositoryMetadata(provider: Provider, token: GitHubTokenInfo, owner: string, repo: string, options?: {
|
|
124
136
|
baseUrl?: string;
|
|
@@ -271,6 +283,10 @@ export declare class GitHubApi {
|
|
|
271
283
|
* an explicit relationship qualifier such as `author:@me` or `review-requested:@me`.
|
|
272
284
|
*/
|
|
273
285
|
includeDefaultInvolvement?: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* Whether this read selects merge-queue data, over the host's `getPullRequestReadOptions`. GitHub.com only.
|
|
288
|
+
*/
|
|
289
|
+
mergeQueue?: boolean;
|
|
274
290
|
}, cancellation?: AbortSignal): Promise<{
|
|
275
291
|
values: PullRequest[];
|
|
276
292
|
cursor?: string;
|
|
@@ -296,6 +312,10 @@ export declare class GitHubApi {
|
|
|
296
312
|
avatarSize?: number;
|
|
297
313
|
silent?: boolean;
|
|
298
314
|
state?: PullRequestStateFilter;
|
|
315
|
+
/**
|
|
316
|
+
* Whether this read selects merge-queue data, over the host's `getPullRequestReadOptions`. GitHub.com only.
|
|
317
|
+
*/
|
|
318
|
+
mergeQueue?: boolean;
|
|
299
319
|
}, cancellation?: AbortSignal): Promise<PullRequest[]>;
|
|
300
320
|
/**
|
|
301
321
|
* The current user's issues: authored ∪ assigned ∪ mentioned, each its own aliased search behind one composite
|
|
@@ -453,6 +473,7 @@ export declare class GitHubApi {
|
|
|
453
473
|
}[], options?: {
|
|
454
474
|
baseUrl?: string;
|
|
455
475
|
avatarSize?: number;
|
|
476
|
+
mergeQueue?: boolean;
|
|
456
477
|
}, cancellation?: AbortSignal): Promise<PromiseSettledResult<PullRequest | undefined>[]>;
|
|
457
478
|
/**
|
|
458
479
|
* The cheap check behind the batch reads' etags: {@link getPullRequestsBatch}'s aliased document, slot rules and
|
|
@@ -470,6 +491,7 @@ export declare class GitHubApi {
|
|
|
470
491
|
}[], options?: {
|
|
471
492
|
baseUrl?: string;
|
|
472
493
|
etagIncludes?: readonly GitHubPullRequestEtagInclude[];
|
|
494
|
+
mergeQueue?: boolean;
|
|
473
495
|
}, cancellation?: AbortSignal): Promise<PromiseSettledResult<GitHubPullRequestEtagNode | undefined>[]>;
|
|
474
496
|
/**
|
|
475
497
|
* The issue twin of {@link getPullRequestsEtagFieldsBatch}: {@link getIssuesBatch}'s aliased document, slot
|
|
@@ -525,6 +547,7 @@ export declare class GitHubApi {
|
|
|
525
547
|
baseUrl?: string;
|
|
526
548
|
avatarSize?: number;
|
|
527
549
|
limit: number;
|
|
550
|
+
mergeQueue?: boolean;
|
|
528
551
|
}, cancellation?: AbortSignal): Promise<PromiseSettledResult<{
|
|
529
552
|
pullRequests: PullRequest[][];
|
|
530
553
|
truncated: boolean;
|
|
@@ -625,6 +648,10 @@ export declare class GitHubApi {
|
|
|
625
648
|
* them and LOWERS it from four on.
|
|
626
649
|
*/
|
|
627
650
|
summary?: boolean;
|
|
651
|
+
/**
|
|
652
|
+
* Whether this read selects merge-queue data, over the host's `getPullRequestReadOptions`. GitHub.com only.
|
|
653
|
+
*/
|
|
654
|
+
mergeQueue?: boolean;
|
|
628
655
|
}, cancellation?: AbortSignal): Promise<PullRequestSearchResult | undefined>;
|
|
629
656
|
searchPullRequests(provider: Provider, token: GitHubTokenInfo, options?: {
|
|
630
657
|
search?: string;
|
|
@@ -633,6 +660,10 @@ export declare class GitHubApi {
|
|
|
633
660
|
baseUrl?: string;
|
|
634
661
|
avatarSize?: number;
|
|
635
662
|
include?: IssueOrPullRequestState[];
|
|
663
|
+
/**
|
|
664
|
+
* Whether this read selects merge-queue data, over the host's `getPullRequestReadOptions`. GitHub.com only.
|
|
665
|
+
*/
|
|
666
|
+
mergeQueue?: boolean;
|
|
636
667
|
}, cancellation?: AbortSignal): Promise<PullRequest[]>;
|
|
637
668
|
/**
|
|
638
669
|
* Every stack in the repository, each with its members bottom to top.
|
|
@@ -162,7 +162,9 @@ position
|
|
|
162
162
|
* been followed by a rejoin. Shared by the full read and the etag's cheap check so both derive the same removal.
|
|
163
163
|
* Aliased so it can never collide with another `timelineItems` selection. One extra connection per pull request:
|
|
164
164
|
* against GitHub's rate-limit formula (a request per connection per parent node, summed, divided by 100) that adds
|
|
165
|
-
* a point per 100 pull requests a document reads — see the `mergeQueue` cost note in core's integrations docs.
|
|
165
|
+
* a point per 100 pull requests a document reads — see the `mergeQueue` cost note in core's integrations docs. That
|
|
166
|
+
* cost is why the selection it belongs to is made only for a read that asks for it or a host that opts in
|
|
167
|
+
* (`getPullRequestReadOptions`).
|
|
166
168
|
*/
|
|
167
169
|
const gqlPullRequestMergeQueueEventsFragment = `
|
|
168
170
|
mergeQueueEvents: timelineItems(last: 1, itemTypes: [ADDED_TO_MERGE_QUEUE_EVENT, REMOVED_FROM_MERGE_QUEUE_EVENT]) {
|
|
@@ -177,8 +179,10 @@ mergeQueueEvents: timelineItems(last: 1, itemTypes: [ADDED_TO_MERGE_QUEUE_EVENT,
|
|
|
177
179
|
`;
|
|
178
180
|
/**
|
|
179
181
|
* Merge-queue selection, appended alongside the stack one and for the same reason: GitHub Enterprise Server's schema
|
|
180
|
-
* isn't verified to have `mergeQueueEntry`, and an unknown field fails the whole query rather than the field.
|
|
181
|
-
*
|
|
182
|
+
* isn't verified to have `mergeQueueEntry`, and an unknown field fails the whole query rather than the field. It is
|
|
183
|
+
* also selected only when the read asks for it (`mergeQueue`) or, when it doesn't say, the host opts in with
|
|
184
|
+
* `GitHubApiConfig.getPullRequestReadOptions`, as it costs a rate-limit request per pull request read. Always add it
|
|
185
|
+
* via `gqlPullRequestMergeQueueFragmentFor`, at every site that adds the stack selection.
|
|
182
186
|
*/
|
|
183
187
|
const gqlPullRequestMergeQueueFragment = `
|
|
184
188
|
mergeQueueEntry {
|
|
@@ -187,8 +191,15 @@ mergeQueueEntry {
|
|
|
187
191
|
isMergeQueueEnabled
|
|
188
192
|
${gqlPullRequestMergeQueueEventsFragment}
|
|
189
193
|
`;
|
|
190
|
-
function gqlPullRequestMergeQueueFragmentFor(options) {
|
|
191
|
-
return
|
|
194
|
+
function gqlPullRequestMergeQueueFragmentFor(options, config) {
|
|
195
|
+
return readsMergeQueue(options, config) ? gqlPullRequestMergeQueueFragment : "";
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Whether a pull request read selects merge-queue data: github.com only, and only when the read asks for it
|
|
199
|
+
* (`options.mergeQueue`) or, when it doesn't say, the host opts in (`GitHubApiConfig.getPullRequestReadOptions`).
|
|
200
|
+
*/
|
|
201
|
+
function readsMergeQueue(options, config) {
|
|
202
|
+
return isGitHubDotCom(options) && (options?.mergeQueue ?? config.getPullRequestReadOptions?.()?.mergeQueue) === true;
|
|
192
203
|
}
|
|
193
204
|
/**
|
|
194
205
|
* A 409 means a merge request is already in flight and carries its ticket, so it resumes rather than fails.
|
|
@@ -366,8 +377,9 @@ repository {
|
|
|
366
377
|
* The change state a pull request's etag reads (see {@link GitHubPullRequestEtagNode}). Every selection is copied
|
|
367
378
|
* from {@link gqlPullRequestFragment} — same arguments, same nesting — so the cheap read sees exactly the values
|
|
368
379
|
* the full read maps; only a requested reviewer drops its avatar and URL, since its nullness is all the etag reads.
|
|
369
|
-
* `merged` is not needed: `state` already reads `MERGED`. The merge-queue entry's state is added
|
|
370
|
-
*
|
|
380
|
+
* `merged` is not needed: `state` already reads `MERGED`. The merge-queue entry's state is added by
|
|
381
|
+
* {@link gqlPullRequestEtagMergeQueueFragmentFor} exactly when the full read adds its entry: against github.com,
|
|
382
|
+
* for a read that selects merge-queue data.
|
|
371
383
|
*/
|
|
372
384
|
const gqlPullRequestEtagFragment = `
|
|
373
385
|
id
|
|
@@ -382,18 +394,21 @@ headRefOid
|
|
|
382
394
|
* state, and since when (so leaving and rejoining the queue between checks still reads as a change), and its latest
|
|
383
395
|
* merge-queue event, so a pull request that joined and was removed between two checks (neither of which moves the
|
|
384
396
|
* update time) still reads as a change. Not the estimate, which GitHub recomputes as the queue moves and would fail
|
|
385
|
-
* every check of a queued pull request, nor the position, which moves as the entries ahead of it merge
|
|
386
|
-
* `isMergeQueueEnabled`, which only a change to the base branch's rules moves
|
|
397
|
+
* every check of a queued pull request, nor the position, which moves as the entries ahead of it merge. It also
|
|
398
|
+
* selects `isMergeQueueEnabled`, which only a change to the base branch's rules moves and so is never an etag input:
|
|
399
|
+
* its presence on the node is what tells the etag the read selected merge-queue data (see
|
|
400
|
+
* `PullRequestEtagFields.mergeQueueRead`).
|
|
387
401
|
*/
|
|
388
402
|
const gqlPullRequestEtagMergeQueueFragment = `
|
|
389
403
|
mergeQueueEntry {
|
|
390
404
|
state
|
|
391
405
|
enqueuedAt
|
|
392
406
|
}
|
|
407
|
+
isMergeQueueEnabled
|
|
393
408
|
${gqlPullRequestMergeQueueEventsFragment}
|
|
394
409
|
`;
|
|
395
|
-
function gqlPullRequestEtagMergeQueueFragmentFor(options) {
|
|
396
|
-
return
|
|
410
|
+
function gqlPullRequestEtagMergeQueueFragmentFor(options, config) {
|
|
411
|
+
return readsMergeQueue(options, config) ? gqlPullRequestEtagMergeQueueFragment : "";
|
|
397
412
|
}
|
|
398
413
|
/**
|
|
399
414
|
* The selection each {@link GitHubPullRequestEtagInclude} adds to {@link gqlPullRequestEtagFragment}, copied from
|
|
@@ -722,7 +737,7 @@ var GitHubApi = class {
|
|
|
722
737
|
pullRequest(number: $number) {
|
|
723
738
|
${gqlPullRequestLiteFragment}
|
|
724
739
|
${gqlPullRequestStackFragmentFor(options)}
|
|
725
|
-
${gqlPullRequestMergeQueueFragmentFor(options)}
|
|
740
|
+
${gqlPullRequestMergeQueueFragmentFor(options, this.config)}
|
|
726
741
|
}
|
|
727
742
|
}
|
|
728
743
|
}`;
|
|
@@ -756,7 +771,7 @@ var GitHubApi = class {
|
|
|
756
771
|
nodes {
|
|
757
772
|
${gqlPullRequestLiteFragment}
|
|
758
773
|
${gqlPullRequestStackFragmentFor(options)}
|
|
759
|
-
${gqlPullRequestMergeQueueFragmentFor(options)}
|
|
774
|
+
${gqlPullRequestMergeQueueFragmentFor(options, this.config)}
|
|
760
775
|
}
|
|
761
776
|
}
|
|
762
777
|
}
|
|
@@ -794,7 +809,7 @@ var GitHubApi = class {
|
|
|
794
809
|
nodes {
|
|
795
810
|
${gqlPullRequestLiteFragment}
|
|
796
811
|
${gqlPullRequestStackFragmentFor(options)}
|
|
797
|
-
${gqlPullRequestMergeQueueFragmentFor(options)}
|
|
812
|
+
${gqlPullRequestMergeQueueFragmentFor(options, this.config)}
|
|
798
813
|
}
|
|
799
814
|
}
|
|
800
815
|
}
|
|
@@ -2161,7 +2176,7 @@ var GitHubApi = class {
|
|
|
2161
2176
|
...on PullRequest {
|
|
2162
2177
|
${options?.summary ? gqlPullRequestLiteFragment : gqlPullRequestFragment}
|
|
2163
2178
|
${gqlPullRequestStackFragmentFor(options)}
|
|
2164
|
-
${gqlPullRequestMergeQueueFragmentFor(options)}
|
|
2179
|
+
${gqlPullRequestMergeQueueFragmentFor(options, this.config)}
|
|
2165
2180
|
}
|
|
2166
2181
|
}
|
|
2167
2182
|
}
|
|
@@ -2488,6 +2503,8 @@ var GitHubApi = class {
|
|
|
2488
2503
|
async getPullRequestsBatch(provider, token, coordinates, options, cancellation) {
|
|
2489
2504
|
const scope = getScopedLogger();
|
|
2490
2505
|
if (coordinates.length === 0) return [];
|
|
2506
|
+
const stackFragment = gqlPullRequestStackFragmentFor(options);
|
|
2507
|
+
const mergeQueueFragment = gqlPullRequestMergeQueueFragmentFor(options, this.config);
|
|
2491
2508
|
const query = `query getPullRequestsBatch(
|
|
2492
2509
|
${coordinates.map((_, i) => `$o${i}: String!\n\t\t\t\t$n${i}: String!\n\t\t\t\t$k${i}: Int!`).join("\n ")}
|
|
2493
2510
|
$avatarSize: Int
|
|
@@ -2495,8 +2512,8 @@ var GitHubApi = class {
|
|
|
2495
2512
|
${coordinates.map((_, i) => `p${i}: repository(owner: $o${i}, name: $n${i}) {
|
|
2496
2513
|
pullRequest(number: $k${i}) {
|
|
2497
2514
|
${gqlPullRequestFragment}
|
|
2498
|
-
${
|
|
2499
|
-
${
|
|
2515
|
+
${stackFragment}
|
|
2516
|
+
${mergeQueueFragment}
|
|
2500
2517
|
}
|
|
2501
2518
|
}`).join("\n ")}
|
|
2502
2519
|
}`;
|
|
@@ -2555,13 +2572,14 @@ var GitHubApi = class {
|
|
|
2555
2572
|
const scope = getScopedLogger();
|
|
2556
2573
|
if (coordinates.length === 0) return [];
|
|
2557
2574
|
const includeFragments = Array.from(new Set(options?.etagIncludes), (include) => gqlPullRequestEtagIncludeFragments[include]);
|
|
2575
|
+
const mergeQueueFragment = gqlPullRequestEtagMergeQueueFragmentFor(options, this.config);
|
|
2558
2576
|
const query = `query getPullRequestsEtagFieldsBatch(
|
|
2559
2577
|
${coordinates.map((_, i) => `$o${i}: String!\n\t\t\t\t$n${i}: String!\n\t\t\t\t$k${i}: Int!`).join("\n ")}
|
|
2560
2578
|
) {
|
|
2561
2579
|
${coordinates.map((_, i) => `p${i}: repository(owner: $o${i}, name: $n${i}) {
|
|
2562
2580
|
pullRequest(number: $k${i}) {
|
|
2563
2581
|
${gqlPullRequestEtagFragment}
|
|
2564
|
-
${
|
|
2582
|
+
${mergeQueueFragment}
|
|
2565
2583
|
${includeFragments.join("")}
|
|
2566
2584
|
}
|
|
2567
2585
|
}`).join("\n ")}
|
|
@@ -2674,6 +2692,8 @@ var GitHubApi = class {
|
|
|
2674
2692
|
async getPullRequestsForBranches(provider, token, queries, options, cancellation) {
|
|
2675
2693
|
const scope = getScopedLogger();
|
|
2676
2694
|
if (queries.length === 0) return [];
|
|
2695
|
+
const stackFragment = gqlPullRequestStackFragmentFor(options);
|
|
2696
|
+
const mergeQueueFragment = gqlPullRequestMergeQueueFragmentFor(options, this.config);
|
|
2677
2697
|
const query = `query getPullRequestsForBranches(
|
|
2678
2698
|
${queries.map((_, i) => `$o${i}: String!\n\t\t\t\t$n${i}: String!\n\t\t\t\t$h${i}: String!`).join("\n ")}
|
|
2679
2699
|
$limit: Int!
|
|
@@ -2684,8 +2704,8 @@ var GitHubApi = class {
|
|
|
2684
2704
|
totalCount
|
|
2685
2705
|
nodes {
|
|
2686
2706
|
${gqlPullRequestFragment}
|
|
2687
|
-
${
|
|
2688
|
-
${
|
|
2707
|
+
${stackFragment}
|
|
2708
|
+
${mergeQueueFragment}
|
|
2689
2709
|
headRepositoryOwner {
|
|
2690
2710
|
login
|
|
2691
2711
|
}
|
|
@@ -3070,6 +3090,8 @@ var GitHubApi = class {
|
|
|
3070
3090
|
const defaultSize = options?.summary === true ? Math.max(1, Math.floor(maxPullRequestSearchPageSize / activeFacets.length)) : defaultPullRequestSearchPageSize;
|
|
3071
3091
|
const pageSize = Math.min(maxPullRequestSearchPageSize, Math.max(1, Math.trunc(options?.pageSize ?? defaultSize)));
|
|
3072
3092
|
const includeVar = (alias) => `include${alias.charAt(0).toUpperCase()}${alias.slice(1)}`;
|
|
3093
|
+
const stackFragment = gqlPullRequestStackFragmentFor(options);
|
|
3094
|
+
const mergeQueueFragment = gqlPullRequestMergeQueueFragmentFor(options, this.config);
|
|
3073
3095
|
const params = facets.flatMap((f) => [
|
|
3074
3096
|
`$${f.alias}Search: String!`,
|
|
3075
3097
|
`$${f.alias}Cursor: String`,
|
|
@@ -3085,8 +3107,8 @@ var GitHubApi = class {
|
|
|
3085
3107
|
nodes {
|
|
3086
3108
|
... on PullRequest {
|
|
3087
3109
|
${options?.summary ? gqlPullRequestLiteFragment : gqlPullRequestFragment}
|
|
3088
|
-
${
|
|
3089
|
-
${
|
|
3110
|
+
${stackFragment}
|
|
3111
|
+
${mergeQueueFragment}
|
|
3090
3112
|
}
|
|
3091
3113
|
}
|
|
3092
3114
|
}`);
|
|
@@ -3178,6 +3200,8 @@ var GitHubApi = class {
|
|
|
3178
3200
|
qualifier: toGitHubSearchStateQualifier(include)
|
|
3179
3201
|
}];
|
|
3180
3202
|
try {
|
|
3203
|
+
const stackFragment = gqlPullRequestStackFragmentFor(options);
|
|
3204
|
+
const mergeQueueFragment = gqlPullRequestMergeQueueFragmentFor(options, this.config);
|
|
3181
3205
|
const params = stateSearches.map(({ alias }) => alias === "search" ? "$searchQuery: String!" : `$${alias}SearchQuery: String!`);
|
|
3182
3206
|
const fields = stateSearches.map(({ alias }) => {
|
|
3183
3207
|
const fieldAlias = alias === "search" ? "" : `${alias}: `;
|
|
@@ -3186,8 +3210,8 @@ var GitHubApi = class {
|
|
|
3186
3210
|
nodes {
|
|
3187
3211
|
...on PullRequest {
|
|
3188
3212
|
${gqlPullRequestFragment}
|
|
3189
|
-
${
|
|
3190
|
-
${
|
|
3213
|
+
${stackFragment}
|
|
3214
|
+
${mergeQueueFragment}
|
|
3191
3215
|
}
|
|
3192
3216
|
}
|
|
3193
3217
|
}`;
|