@gitkraken/core-gitlens 0.54.0 → 0.55.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 +9 -1
- package/dist/git/models/pullRequest.d.ts +14 -0
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/utils/pullRequest.utils.d.ts +3 -1
- package/dist/git/utils/pullRequest.utils.js +9 -1
- package/dist/git/utils/pullRequest.utils.js.map +1 -1
- package/dist/git-cli/providers/config.js +2 -2
- package/dist/git-cli/providers/pausedOperations.js +2 -2
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/staging.js +1 -1
- package/dist/ipc/discovery.js +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +6 -6
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/ai/providers/openAICompatibleProviderBase.js +1 -1
- package/dist/plus/git-github/api/github.d.ts +2 -0
- package/dist/plus/git-github/api/github.js +16 -6
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/pullRequestSearchQuery.d.ts +1 -0
- package/dist/plus/git-github/api/pullRequestSearchQuery.js +29 -5
- package/dist/plus/git-github/api/pullRequestSearchQuery.js.map +1 -1
- package/dist/plus/integrations/fieldPresence.d.ts +3 -0
- package/dist/plus/integrations/fieldPresence.js +7 -1
- package/dist/plus/integrations/fieldPresence.js.map +1 -1
- package/dist/plus/integrations/index.d.ts +2 -2
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +2 -2
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +7 -2
- package/dist/plus/integrations/models/publicIntegration.d.ts +1 -0
- package/dist/plus/integrations/models/pullRequestReads.d.ts +2 -0
- package/dist/plus/integrations/providers/azure/azure.js +1 -1
- package/dist/plus/integrations/providers/github.js +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +1 -0
- package/dist/plus/integrations/providers/metadata.js +6 -3
- package/dist/plus/integrations/providers/metadata.js.map +1 -1
- package/dist/plus/integrations/reads/drains.d.ts +1 -0
- package/dist/plus/integrations/reads/filters.js +13 -1
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/pullRequestBatch.js +3 -3
- package/dist/plus/integrations/reads/pullRequestBatch.js.map +1 -1
- package/dist/plus/integrations/reads/searchPullRequests.d.ts +3 -3
- package/dist/plus/integrations/reads/searchPullRequests.js +4 -3
- package/dist/plus/integrations/reads/searchPullRequests.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.js +20 -6
- package/dist/plus/integrations/reads/sweeps.js.map +1 -1
- package/dist/plus/integrations/reads/warnings.d.ts +1 -0
- package/dist/plus/integrations/reads/warnings.js +7 -2
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +7 -0
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/utils/env/node/exec.js +2 -2
- package/docs/integrations.md +33 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ import { base64 } from "../../../utils/base64.js";
|
|
|
15
15
|
import { getGitHubNoReplyAddressParts } from "../../../git/remotes/github.js";
|
|
16
16
|
import { defaultIssueSort } from "../../../git/models/issue.js";
|
|
17
17
|
import "../../../git/models/pullRequest.js";
|
|
18
|
-
import { getPullRequestComparator } from "../../../git/utils/pullRequest.utils.js";
|
|
18
|
+
import { effectivePullRequestSearchSort, getPullRequestComparator } from "../../../git/utils/pullRequest.utils.js";
|
|
19
19
|
import { effectiveIssueSort, getIssueComparator } from "../../../git/utils/issue.utils.js";
|
|
20
20
|
import { fromGitHubIssue, fromGitHubIssueOrPullRequestState, fromGitHubMergeQueueEntry, fromGitHubPullRequest, fromGitHubPullRequestLite } from "../models.js";
|
|
21
21
|
import { githubSearchResultLimit } from "./config.js";
|
|
@@ -26,7 +26,7 @@ import { etagCheckContextsFragment, gqlPullRequestCheckRunsFragment, isCheckCont
|
|
|
26
26
|
import { gitHubIssueSearchRelationships, toGitHubIssueSearchQualifiers, toGitHubIssueSearchScopeQualifiers, toGitHubIssueSearchSlideQualifier, toGitHubIssueSortQualifier } from "./issueSearchQuery.js";
|
|
27
27
|
import { mutateGitHubIssue } from "./issueWrites.js";
|
|
28
28
|
import { readGitHubPullRequestActivity } from "./pullRequestActivity.js";
|
|
29
|
-
import { toGitHubPullRequestSearchFacets } from "./pullRequestSearchQuery.js";
|
|
29
|
+
import { toGitHubPullRequestOpenCountQualifiers, toGitHubPullRequestSearchFacets } from "./pullRequestSearchQuery.js";
|
|
30
30
|
import { getGitHubPullRequestCreateCapability, resolveGitHubPullRequestWriteTarget, writeGitHubPullRequest } from "./pullRequestWrites.js";
|
|
31
31
|
import * as l10n from "@vscode/l10n";
|
|
32
32
|
import { captureReadNodes, copyReadProvenance, createReadCapture } from "@gitkraken/provider-apis/read-provenance";
|
|
@@ -2088,7 +2088,7 @@ var GitHubApi = class {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
}
|
|
2090
2090
|
_pendingGraphQL = /* @__PURE__ */ new Map();
|
|
2091
|
-
async graphql(provider, token, query, variables, scope, cancellation, allowPartialNotFound, gatewayFailures) {
|
|
2091
|
+
async graphql(provider, token, query, variables, scope, cancellation, allowPartialNotFound, gatewayFailures, optionalAliases) {
|
|
2092
2092
|
const { accessToken, ...tokenInfo } = token;
|
|
2093
2093
|
const readQuery = graphqlReadQueryRegex.test(query);
|
|
2094
2094
|
const dedupable = readQuery && cancellation == null && variables?.request == null;
|
|
@@ -2101,6 +2101,7 @@ var GitHubApi = class {
|
|
|
2101
2101
|
provider?.id,
|
|
2102
2102
|
allowPartialNotFound,
|
|
2103
2103
|
gatewayFailures,
|
|
2104
|
+
optionalAliases,
|
|
2104
2105
|
query,
|
|
2105
2106
|
variables
|
|
2106
2107
|
]);
|
|
@@ -2148,6 +2149,7 @@ var GitHubApi = class {
|
|
|
2148
2149
|
}
|
|
2149
2150
|
throw new RequestRateLimitError(ex, accessToken, resetAt);
|
|
2150
2151
|
}
|
|
2152
|
+
if (optionalAliases?.length && ex.data != null && ex.errors?.length && ex.errors.every((e) => e.path?.[0] != null && optionalAliases.includes(e.path[0]))) return ex.data;
|
|
2151
2153
|
if (allowPartialNotFound === "aliased" && ex.data != null && ex.errors != null && ex.errors.length > 0) {
|
|
2152
2154
|
if (ex.errors.every((e) => e.path != null && e.path.length > 0 && e.path[0] in ex.data)) return {
|
|
2153
2155
|
data: ex.data,
|
|
@@ -3356,6 +3358,8 @@ var GitHubApi = class {
|
|
|
3356
3358
|
const facetAliases = facets.map((f) => f.alias).sort();
|
|
3357
3359
|
const scopeQualifiers = toGitHubIssueSearchScopeQualifiers(options?.org, options?.repos);
|
|
3358
3360
|
const facetSearches = new Map(facets.map((f) => [f.alias, [...scopeQualifiers, ...f.qualifiers].join(" ")]));
|
|
3361
|
+
const openCountQualifiers = toGitHubPullRequestOpenCountQualifiers(options?.criteria);
|
|
3362
|
+
const openCountQuery = openCountQualifiers != null ? [...scopeQualifiers, ...openCountQualifiers].join(" ") : void 0;
|
|
3359
3363
|
let cursorKeyHash = 2166136261;
|
|
3360
3364
|
for (const value of [...facetSearches.entries()].sort(([a], [b]) => a.localeCompare(b)).flat()) {
|
|
3361
3365
|
for (let i = 0; i < value.length; i++) {
|
|
@@ -3406,6 +3410,7 @@ var GitHubApi = class {
|
|
|
3406
3410
|
`$${f.alias}Cursor: String`,
|
|
3407
3411
|
`$${includeVar(f.alias)}: Boolean!`
|
|
3408
3412
|
]);
|
|
3413
|
+
if (openCountQuery != null) params.push("$openCountQuery: String!");
|
|
3409
3414
|
const toQuery = (size) => {
|
|
3410
3415
|
const fields = facets.map((f) => `${f.alias}: search(first: ${size}, after: $${f.alias}Cursor, query: $${f.alias}Search, type: ISSUE)
|
|
3411
3416
|
@include(if: $${includeVar(f.alias)}) {
|
|
@@ -3422,6 +3427,7 @@ var GitHubApi = class {
|
|
|
3422
3427
|
}
|
|
3423
3428
|
}
|
|
3424
3429
|
}`);
|
|
3430
|
+
if (openCountQuery != null) fields.push("openCount: search(type: ISSUE, query: $openCountQuery, first: 0) { issueCount }");
|
|
3425
3431
|
return `query searchPullRequestsPage(
|
|
3426
3432
|
${params.join("\n ")}
|
|
3427
3433
|
$avatarSize: Int
|
|
@@ -3438,7 +3444,8 @@ var GitHubApi = class {
|
|
|
3438
3444
|
variables[`${facet.alias}Cursor`] = cursor?.facets[facet.alias] ?? void 0;
|
|
3439
3445
|
variables[includeVar(facet.alias)] = isActive(facet.alias);
|
|
3440
3446
|
}
|
|
3441
|
-
|
|
3447
|
+
if (openCountQuery != null) variables.openCountQuery = openCountQuery;
|
|
3448
|
+
const read = (size, gatewayFailures) => this.graphql(provider, token, toQuery(size), variables, scope, cancellation, void 0, gatewayFailures, openCountQuery != null ? ["openCount"] : void 0);
|
|
3442
3449
|
try {
|
|
3443
3450
|
let pageSize = requestedPageSize;
|
|
3444
3451
|
let rsp;
|
|
@@ -3465,7 +3472,7 @@ var GitHubApi = class {
|
|
|
3465
3472
|
scope?.warn(`skipped unmappable pull request; id=${node.id}, url=${node.url}, ex=${ex}`);
|
|
3466
3473
|
}
|
|
3467
3474
|
}
|
|
3468
|
-
const comparator = getPullRequestComparator(options?.criteria
|
|
3475
|
+
const comparator = getPullRequestComparator(effectivePullRequestSearchSort(options?.criteria));
|
|
3469
3476
|
if (comparator != null) pullRequests.sort(comparator);
|
|
3470
3477
|
const values = [...uniqueBy(pullRequests, (pr) => pr.url, (original, _current) => original)];
|
|
3471
3478
|
const nextFacets = {};
|
|
@@ -3495,13 +3502,16 @@ var GitHubApi = class {
|
|
|
3495
3502
|
totalCount,
|
|
3496
3503
|
budget: pageSize < requestedPageSize ? pageSize * activeFacets.length : cursor?.budget
|
|
3497
3504
|
};
|
|
3505
|
+
const openCount = openCountQuery != null ? rsp.openCount?.issueCount : void 0;
|
|
3506
|
+
if (openCountQuery != null && openCount == null) scope?.warn("The open pull request count failed; returning the page without it");
|
|
3498
3507
|
return {
|
|
3499
3508
|
values,
|
|
3500
3509
|
cursor: hasMore ? JSON.stringify(next) : void 0,
|
|
3501
3510
|
hasMore,
|
|
3502
3511
|
page,
|
|
3503
3512
|
truncated,
|
|
3504
|
-
totalCount
|
|
3513
|
+
totalCount,
|
|
3514
|
+
openCount
|
|
3505
3515
|
};
|
|
3506
3516
|
} catch (ex) {
|
|
3507
3517
|
throw this.handleException(ex, provider, scope);
|