@gitkraken/core-gitlens 0.26.0 → 0.28.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 +19 -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 +12 -5
- package/dist/plus/git-github/api/github.js +31 -14
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +3 -2
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.js +1 -1
- package/dist/plus/integrations/providers/github.d.ts +4 -3
- package/dist/plus/integrations/providers/github.js +37 -10
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/reads/resolveRepository.js +24 -1
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +20 -0
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/utils/env/node/exec.js +2 -2
- package/docs/integrations.md +9 -2
- package/docs/kepler-read-api-parity.md +3 -2
- package/package.json +1 -1
|
@@ -505,21 +505,28 @@ export declare class GitHubApi {
|
|
|
505
505
|
* {@link getPullRequestNumbersForBranch} settles such a target, though it can't see a deleted fork's pull
|
|
506
506
|
* request, so its caller keeps the rows matched here as well.
|
|
507
507
|
*
|
|
508
|
+
* One alias per query, however many head owners ask it: the owner filter runs on the returned nodes, so
|
|
509
|
+
* queries that differ only by owner would send identical subqueries. The caller names each query once, with
|
|
510
|
+
* every owner it wants answered from it (`headOwners`, where `undefined` means the base repository), and
|
|
511
|
+
* the answer holds one list per owner, in `headOwners` order. The caller must keep queries distinct (same
|
|
512
|
+
* repository, case-insensitively, and branch), or it pays for the duplicates.
|
|
513
|
+
*
|
|
508
514
|
* Returns POSITIONALLY, with the same per-alias rules as {@link getPullRequestsBatch}: a missing base
|
|
509
|
-
* repository (NOT_FOUND on a null repository) is a PROVEN "none" — an empty list — while any other
|
|
510
|
-
* a
|
|
515
|
+
* repository (NOT_FOUND on a null repository) is a PROVEN "none" — an empty list per owner — while any other
|
|
516
|
+
* error on a query's alias rejects that query (every owner of it), and a whole-request failure still throws.
|
|
517
|
+
* `truncated` is a property of the query, so it is shared by every owner.
|
|
511
518
|
*/
|
|
512
|
-
getPullRequestsForBranches(provider: Provider, token: GitHubTokenInfo,
|
|
519
|
+
getPullRequestsForBranches(provider: Provider, token: GitHubTokenInfo, queries: readonly {
|
|
513
520
|
owner: string;
|
|
514
521
|
repo: string;
|
|
515
522
|
branch: string;
|
|
516
|
-
|
|
523
|
+
headOwners: readonly (string | undefined)[];
|
|
517
524
|
}[], options: {
|
|
518
525
|
baseUrl?: string;
|
|
519
526
|
avatarSize?: number;
|
|
520
527
|
limit: number;
|
|
521
528
|
}, cancellation?: AbortSignal): Promise<PromiseSettledResult<{
|
|
522
|
-
pullRequests: PullRequest[];
|
|
529
|
+
pullRequests: PullRequest[][];
|
|
523
530
|
truncated: boolean;
|
|
524
531
|
}>[]>;
|
|
525
532
|
/**
|
|
@@ -2575,19 +2575,26 @@ var GitHubApi = class {
|
|
|
2575
2575
|
* {@link getPullRequestNumbersForBranch} settles such a target, though it can't see a deleted fork's pull
|
|
2576
2576
|
* request, so its caller keeps the rows matched here as well.
|
|
2577
2577
|
*
|
|
2578
|
+
* One alias per query, however many head owners ask it: the owner filter runs on the returned nodes, so
|
|
2579
|
+
* queries that differ only by owner would send identical subqueries. The caller names each query once, with
|
|
2580
|
+
* every owner it wants answered from it (`headOwners`, where `undefined` means the base repository), and
|
|
2581
|
+
* the answer holds one list per owner, in `headOwners` order. The caller must keep queries distinct (same
|
|
2582
|
+
* repository, case-insensitively, and branch), or it pays for the duplicates.
|
|
2583
|
+
*
|
|
2578
2584
|
* Returns POSITIONALLY, with the same per-alias rules as {@link getPullRequestsBatch}: a missing base
|
|
2579
|
-
* repository (NOT_FOUND on a null repository) is a PROVEN "none" — an empty list — while any other
|
|
2580
|
-
* a
|
|
2585
|
+
* repository (NOT_FOUND on a null repository) is a PROVEN "none" — an empty list per owner — while any other
|
|
2586
|
+
* error on a query's alias rejects that query (every owner of it), and a whole-request failure still throws.
|
|
2587
|
+
* `truncated` is a property of the query, so it is shared by every owner.
|
|
2581
2588
|
*/
|
|
2582
|
-
async getPullRequestsForBranches(provider, token,
|
|
2589
|
+
async getPullRequestsForBranches(provider, token, queries, options, cancellation) {
|
|
2583
2590
|
const scope = getScopedLogger();
|
|
2584
|
-
if (
|
|
2591
|
+
if (queries.length === 0) return [];
|
|
2585
2592
|
const query = `query getPullRequestsForBranches(
|
|
2586
|
-
${
|
|
2593
|
+
${queries.map((_, i) => `$o${i}: String!\n\t\t\t\t$n${i}: String!\n\t\t\t\t$h${i}: String!`).join("\n ")}
|
|
2587
2594
|
$limit: Int!
|
|
2588
2595
|
$avatarSize: Int
|
|
2589
2596
|
) {
|
|
2590
|
-
${
|
|
2597
|
+
${queries.map((_, i) => `b${i}: repository(owner: $o${i}, name: $n${i}) {
|
|
2591
2598
|
pullRequests(headRefName: $h${i}, states: [OPEN, CLOSED, MERGED], first: $limit, orderBy: {field: UPDATED_AT, direction: DESC}) {
|
|
2592
2599
|
totalCount
|
|
2593
2600
|
nodes {
|
|
@@ -2605,7 +2612,7 @@ var GitHubApi = class {
|
|
|
2605
2612
|
avatarSize: options.avatarSize,
|
|
2606
2613
|
limit: options.limit
|
|
2607
2614
|
};
|
|
2608
|
-
|
|
2615
|
+
queries.forEach((t, i) => {
|
|
2609
2616
|
variables[`o${i}`] = t.owner;
|
|
2610
2617
|
variables[`n${i}`] = t.repo;
|
|
2611
2618
|
variables[`h${i}`] = t.branch;
|
|
@@ -2613,7 +2620,7 @@ var GitHubApi = class {
|
|
|
2613
2620
|
try {
|
|
2614
2621
|
const rsp = await this.graphql(provider, token, query, variables, scope, cancellation, "aliased");
|
|
2615
2622
|
if (rsp?.data == null) throw new Error("GitHub returned no data for the pull requests by branch");
|
|
2616
|
-
return
|
|
2623
|
+
return queries.map((t, i) => {
|
|
2617
2624
|
const alias = `b${i}`;
|
|
2618
2625
|
const repository = rsp.data[alias];
|
|
2619
2626
|
const verdict = getAliasErrorVerdict(rsp.errors, alias, repository);
|
|
@@ -2621,7 +2628,7 @@ var GitHubApi = class {
|
|
|
2621
2628
|
if (repository == null) return {
|
|
2622
2629
|
status: "fulfilled",
|
|
2623
2630
|
value: {
|
|
2624
|
-
pullRequests: [],
|
|
2631
|
+
pullRequests: t.headOwners.map(() => []),
|
|
2625
2632
|
truncated: false
|
|
2626
2633
|
}
|
|
2627
2634
|
};
|
|
@@ -2630,15 +2637,25 @@ var GitHubApi = class {
|
|
|
2630
2637
|
status: "rejected",
|
|
2631
2638
|
reason: /* @__PURE__ */ new Error(`GitHub returned no pull requests for ${t.owner}/${t.repo}:${t.branch}`)
|
|
2632
2639
|
};
|
|
2633
|
-
const
|
|
2634
|
-
const nodes =
|
|
2635
|
-
const matches = nodes.filter((pr) => pr.headRefName === t.branch && (headOwner == null ? !pr.isCrossRepository : pr.isCrossRepository && pr.headRepositoryOwner?.login.toLowerCase() === headOwner));
|
|
2640
|
+
const returned = connection.nodes.filter((pr) => pr != null);
|
|
2641
|
+
const nodes = returned.filter((pr) => pr.headRefName === t.branch);
|
|
2636
2642
|
try {
|
|
2643
|
+
const mapped = /* @__PURE__ */ new Map();
|
|
2637
2644
|
return {
|
|
2638
2645
|
status: "fulfilled",
|
|
2639
2646
|
value: {
|
|
2640
|
-
pullRequests:
|
|
2641
|
-
|
|
2647
|
+
pullRequests: t.headOwners.map((owner) => {
|
|
2648
|
+
const headOwner = owner?.toLowerCase();
|
|
2649
|
+
return nodes.filter((pr) => headOwner == null ? !pr.isCrossRepository : pr.isCrossRepository && pr.headRepositoryOwner?.login.toLowerCase() === headOwner).map((pr) => {
|
|
2650
|
+
let converted = mapped.get(pr);
|
|
2651
|
+
if (converted == null) {
|
|
2652
|
+
converted = fromGitHubPullRequest(pr, provider);
|
|
2653
|
+
mapped.set(pr, converted);
|
|
2654
|
+
}
|
|
2655
|
+
return converted;
|
|
2656
|
+
}).sort((a, b) => b.updatedDate.getTime() - a.updatedDate.getTime());
|
|
2657
|
+
}),
|
|
2658
|
+
truncated: connection.totalCount > returned.length
|
|
2642
2659
|
}
|
|
2643
2660
|
};
|
|
2644
2661
|
} catch (ex) {
|