@gitkraken/core-gitlens 0.15.3 → 0.15.4
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 +28 -1
- package/dist/git/cache.d.ts +24 -11
- package/dist/git/cache.js +44 -16
- package/dist/git/cache.js.map +1 -1
- package/dist/git/models/pullRequest.d.ts +7 -5
- package/dist/git/models/pullRequest.js.map +1 -1
- package/dist/git/models/reference.d.ts +8 -0
- package/dist/git/providers/branches.d.ts +43 -0
- package/dist/git/watching/changeEvent.d.ts +4 -2
- package/dist/git/watching/changeEvent.js +3 -1
- package/dist/git/watching/changeEvent.js.map +1 -1
- package/dist/git/watching/watchGroup.d.ts +3 -3
- package/dist/git/watching/watchGroup.js +1 -0
- package/dist/git/watching/watchGroup.js.map +1 -1
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git/watching/watchSession.d.ts +2 -1
- package/dist/git/watching/watchSession.js +3 -2
- package/dist/git/watching/watchSession.js.map +1 -1
- package/dist/git/watching/watcherPatterns.js +1 -0
- package/dist/git/watching/watcherPatterns.js.map +1 -1
- package/dist/git/watching/worktreeSummary.d.ts +19 -3
- package/dist/git/watching/worktreeSummary.js +107 -17
- package/dist/git/watching/worktreeSummary.js.map +1 -1
- package/dist/git-cli/parsers/refParser.js +2 -1
- package/dist/git-cli/parsers/refParser.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts +8 -1
- package/dist/git-cli/providers/branches.js +84 -12
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +32 -9
- package/dist/git-cli/providers/config.js +113 -24
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +29 -14
- package/dist/plus/integrations/models/gitHostIntegration.js +41 -19
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.d.ts +16 -16
- package/dist/plus/integrations/providers/azure/azure.js +45 -25
- package/dist/plus/integrations/providers/azure/azure.js.map +1 -1
- package/dist/plus/integrations/providers/azure/azure.utils.d.ts +12 -0
- package/dist/plus/integrations/providers/azure/azure.utils.js +17 -1
- package/dist/plus/integrations/providers/azure/azure.utils.js.map +1 -1
- package/dist/plus/integrations/providers/azure/search.d.ts +4 -0
- package/dist/plus/integrations/providers/azure/search.js +46 -2
- package/dist/plus/integrations/providers/azure/search.js.map +1 -1
- package/dist/plus/integrations/providers/azure/workItemSearch.d.ts +11 -0
- package/dist/plus/integrations/providers/azure/workItemSearch.js +54 -0
- package/dist/plus/integrations/providers/azure/workItemSearch.js.map +1 -0
- package/dist/plus/integrations/providers/azure/workItemStateCategories.d.ts +2 -2
- package/dist/plus/integrations/providers/azure/workItemStateCategories.js +19 -15
- package/dist/plus/integrations/providers/azure/workItemStateCategories.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +33 -20
- package/dist/plus/integrations/providers/azureDevOps.js +109 -48
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +16 -47
- package/dist/plus/integrations/providers/azureDevOpsServer.js +52 -91
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +5 -0
- package/dist/plus/integrations/providers/models.js +14 -3
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/reads/drains.d.ts +2 -2
- package/dist/plus/integrations/reads/drains.js +4 -4
- package/dist/plus/integrations/reads/drains.js.map +1 -1
- package/dist/plus/integrations/reads/issues.js +7 -4
- package/dist/plus/integrations/reads/issues.js.map +1 -1
- package/dist/plus/integrations/reads/resolveRepository.js +5 -5
- package/dist/plus/integrations/reads/resolveRepository.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,29 +2,20 @@ import { chunk } from "../../../utils/array.js";
|
|
|
2
2
|
import { CancellationError } from "../../../utils/cancellation.js";
|
|
3
3
|
import { mapSettledBounded } from "../../../utils/promise.js";
|
|
4
4
|
import { PromiseCache } from "../../../utils/promiseCache.js";
|
|
5
|
-
import { AuthenticationError } from "../../../git/errors.js";
|
|
6
5
|
import "../../../git/models/pullRequest.js";
|
|
7
6
|
import "../constants.js";
|
|
7
|
+
import { throwProviderError } from "./providerErrors.js";
|
|
8
8
|
import { throwIfCallerContractError, toCollectionScopeFailure } from "../collectionMetadata.js";
|
|
9
9
|
import { toTokenWithInfo } from "../authentication/models.js";
|
|
10
10
|
import "../providerFilters.js";
|
|
11
|
-
import { decodePathSegment } from "../utils/domain.utils.js";
|
|
12
11
|
import { collectProviderPagedResult, flatSettledResultsOrThrow, mergeCollectionMetadata, resolveBranchPullRequests, selectBranchPullRequests } from "./utils/providerPaging.js";
|
|
13
|
-
import { fromProviderIssue, fromProviderPullRequest, getProviderPullRequestIdentity, providerPullRequestMatchesSearch, providersMetadata, toIssueShape, toProviderIssueStates, toProviderPullRequestStates } from "./models.js";
|
|
12
|
+
import { fromProviderIssue, fromProviderPullRequest, getProviderPullRequestIdentity, isNativePullRequest, providerPullRequestMatchesSearch, providersMetadata, pullRequestNamesPeople, toIssueShape, toProviderIssueStates, toProviderPullRequestStates } from "./models.js";
|
|
14
13
|
import { toAzurePullRequestEtagFields, toAzureWorkItemEtagFields } from "./azure/models.js";
|
|
14
|
+
import { decodeAzurePathSegment, getAzurePullRequestIdentityFromMaybeUrl, getAzureRepositoryIdentity } from "./azure/azure.utils.js";
|
|
15
15
|
import { GitHostIntegration } from "../models/gitHostIntegration.js";
|
|
16
|
-
import { getAzurePullRequestIdentityFromMaybeUrl } from "./azure/azure.utils.js";
|
|
17
16
|
import { discoveryCacheTtl } from "./utils/discoveryCache.js";
|
|
18
17
|
import { GitPullRequestState } from "@gitkraken/provider-apis";
|
|
19
18
|
//#region ../plus/integrations/src/providers/azureDevOps.ts
|
|
20
|
-
function getAzureRepositoryIdentity(repo) {
|
|
21
|
-
const match = /^([^/]+)\/_git\/([^/]+)$/i.exec(repo.name);
|
|
22
|
-
return {
|
|
23
|
-
resourceName: repo.owner,
|
|
24
|
-
projectName: repo.project ?? match?.[1],
|
|
25
|
-
repositoryName: match?.[2] ?? repo.name
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
19
|
function getAzureRepositoryApiBaseUrl(baseUrl, repo) {
|
|
29
20
|
if (!isValidAzureVirtualDirectory(repo.virtualDirectory)) throw new Error(`Invalid Azure virtual directory '${repo.virtualDirectory}'.`);
|
|
30
21
|
const url = findAzureRepositoryApiBaseUrl(baseUrl, repo);
|
|
@@ -52,36 +43,37 @@ function isValidAzureVirtualDirectory(virtualDirectory) {
|
|
|
52
43
|
}
|
|
53
44
|
/**
|
|
54
45
|
* The paths a project-less reading's `{vdir}/{owner}` can be below the connection `baseUrl` addresses: the address
|
|
55
|
-
* itself, or its parent when the address names a collection (see {@link resolveAzureProjectlessRepository}).
|
|
46
|
+
* itself, or its parent when the address names a collection (see {@link resolveAzureProjectlessRepository}). Only the
|
|
47
|
+
* parent once the address is known to name a collection (`belowCollection`), since it then isn't the installation. A
|
|
56
48
|
* connection at the host root serves no virtual directory, so none.
|
|
57
49
|
*/
|
|
58
|
-
function getAzureProjectlessDirectories(baseUrl) {
|
|
50
|
+
function getAzureProjectlessDirectories(baseUrl, belowCollection) {
|
|
59
51
|
const configured = new URL(baseUrl).pathname.split("/").filter(Boolean);
|
|
60
|
-
return [configured, configured.slice(0, -1)].filter((path) => path.length > 0);
|
|
52
|
+
return (belowCollection ? [configured.slice(0, -1)] : [configured, configured.slice(0, -1)]).filter((path) => path.length > 0);
|
|
61
53
|
}
|
|
62
54
|
/**
|
|
63
55
|
* Whether `repo`'s path could be the project-less form of a repository named after its project, as read below the
|
|
64
56
|
* connection `baseUrl` addresses: that reading moves the parsed owner into the virtual directory, so its directory and
|
|
65
57
|
* owner must be one of {@link getAzureProjectlessDirectories}.
|
|
66
58
|
*/
|
|
67
|
-
function isAzureProjectlessCandidate(baseUrl, repo) {
|
|
59
|
+
function isAzureProjectlessCandidate(baseUrl, repo, belowCollection = false) {
|
|
68
60
|
if (getAzureRepositoryIdentity({
|
|
69
61
|
owner: repo.owner,
|
|
70
62
|
name: repo.name
|
|
71
63
|
}).projectName == null) return false;
|
|
72
64
|
const directory = [...repo.virtualDirectory?.split("/") ?? [], repo.owner];
|
|
73
|
-
return getAzureProjectlessDirectories(baseUrl).some((path) => path.length === directory.length && path.every((s, i) => sameAzurePathSegment(s, directory[i])));
|
|
65
|
+
return getAzureProjectlessDirectories(baseUrl, belowCollection).some((path) => path.length === directory.length && path.every((s, i) => sameAzurePathSegment(s, directory[i])));
|
|
74
66
|
}
|
|
75
67
|
/**
|
|
76
68
|
* The virtual directory ahead of `owner` (empty when nothing is) in whichever of {@link getAzureProjectlessDirectories}
|
|
77
69
|
* ends with it, `undefined` when none does. A caller-supplied repository scope carries only its owner, so this places
|
|
78
70
|
* it where {@link isAzureProjectlessCandidate} expects it.
|
|
79
71
|
*/
|
|
80
|
-
function getAzureScopeVirtualDirectory(baseUrl, owner) {
|
|
81
|
-
return getAzureProjectlessDirectories(baseUrl).find((p) => sameAzurePathSegment(p.at(-1), owner))?.slice(0, -1).map(
|
|
72
|
+
function getAzureScopeVirtualDirectory(baseUrl, owner, belowCollection = false) {
|
|
73
|
+
return getAzureProjectlessDirectories(baseUrl, belowCollection).find((p) => sameAzurePathSegment(p.at(-1), owner))?.slice(0, -1).map(decodeAzurePathSegment).join("/");
|
|
82
74
|
}
|
|
83
75
|
function sameAzurePathSegment(encoded, value) {
|
|
84
|
-
return
|
|
76
|
+
return decodeAzurePathSegment(encoded).toLowerCase() === value.toLowerCase();
|
|
85
77
|
}
|
|
86
78
|
/**
|
|
87
79
|
* Whether two collection or project names name the same scope. Azure DevOps treats them case-insensitively, so a
|
|
@@ -213,14 +205,30 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
213
205
|
const { tokenWithInfo, options } = this.getApiOptions(session);
|
|
214
206
|
return api.getAzureResourcesForUser(tokenWithInfo, userId, options);
|
|
215
207
|
}
|
|
208
|
+
_organizationUserIds = new PromiseCache({ capacity: 50 });
|
|
216
209
|
/**
|
|
217
|
-
* The identity id
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
210
|
+
* The current user's identity id in `organization` (Azure DevOps Server: the collection), which is what Azure's
|
|
211
|
+
* creator and reviewer filters, and its pull requests' authors and reviewers, compare against. Never the
|
|
212
|
+
* account's own id: Azure DevOps Services can know a person in an organization by an id other than their profile
|
|
213
|
+
* id, and Azure DevOps Server gives them a different id in each collection than at the server level. Cached per
|
|
214
|
+
* credential and organization, since it can't change for either.
|
|
221
215
|
*/
|
|
222
|
-
|
|
223
|
-
return (
|
|
216
|
+
getFilterUserId(session, organization) {
|
|
217
|
+
return this._organizationUserIds.getOrCreate(JSON.stringify([this.discoveryKey(session), organization.toLowerCase()]), async (cacheable) => {
|
|
218
|
+
const id = await this.requestOrganizationUserId(session, organization);
|
|
219
|
+
if (id == null) cacheable.invalidate();
|
|
220
|
+
return id;
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/** Reads the current user's identity id from `organization`'s own connection data; see {@link getFilterUserId}. */
|
|
224
|
+
async requestOrganizationUserId(session, organization) {
|
|
225
|
+
const api = await this.getProvidersApi();
|
|
226
|
+
const { tokenWithInfo } = this.getApiOptions(session);
|
|
227
|
+
try {
|
|
228
|
+
return (await api.getCurrentUserForInstance(tokenWithInfo, organization, this.getCollectionApiOptions(session, organization)))?.id;
|
|
229
|
+
} catch (ex) {
|
|
230
|
+
return throwProviderError(tokenWithInfo, ex);
|
|
231
|
+
}
|
|
224
232
|
}
|
|
225
233
|
/**
|
|
226
234
|
* The current user's groups per credential, collection and user, kept for {@link discoveryCacheTtl} like the other
|
|
@@ -250,15 +258,50 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
250
258
|
}
|
|
251
259
|
invalidateDiscoveryCaches() {
|
|
252
260
|
super.invalidateDiscoveryCaches();
|
|
261
|
+
this._organizationUserIds.clear();
|
|
253
262
|
this._reviewerGroupIds.clear();
|
|
254
263
|
}
|
|
255
264
|
/**
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* server override resolves each collection's own, once per read.
|
|
265
|
+
* The viewer each row of an account-wide read was read for (see {@link getProviderMyPullRequestsForUser}), so its
|
|
266
|
+
* mapping uses the identity that read resolved instead of resolving it again.
|
|
259
267
|
*/
|
|
260
|
-
|
|
261
|
-
|
|
268
|
+
_rowViewers = /* @__PURE__ */ new WeakMap();
|
|
269
|
+
/**
|
|
270
|
+
* Resolved per organization, which a raw row names as its repository owner: an organization's pull requests carry
|
|
271
|
+
* the id {@link getFilterUserId} resolves there, not necessarily the account's. A row an account-wide read returned
|
|
272
|
+
* keeps the one that read resolved, even once its session is gone. A row that names no organization or no one to
|
|
273
|
+
* match gets no viewer, nor does one in an organization whose id can't be read: its authorship stays unknown.
|
|
274
|
+
*/
|
|
275
|
+
async getPullRequestViewers(pullRequests, connectionId) {
|
|
276
|
+
const read = pullRequests.map((pr) => isNativePullRequest(pr) ? void 0 : this._rowViewers.get(pr));
|
|
277
|
+
const organizations = pullRequests.map((pr, i) => read[i] == null && !isNativePullRequest(pr) && pullRequestNamesPeople(pr) ? pr.repository?.owner?.login || void 0 : void 0);
|
|
278
|
+
if (!organizations.some((o) => o != null)) return read;
|
|
279
|
+
const session = await this.resolveReadSessionOrThrow(connectionId, void 0).catch(() => void 0);
|
|
280
|
+
if (session == null) return read;
|
|
281
|
+
const viewerFor = this.getOrganizationViewers(session);
|
|
282
|
+
return Promise.all(read.map((viewer, i) => {
|
|
283
|
+
const organization = organizations[i];
|
|
284
|
+
if (organization == null) return Promise.resolve(viewer);
|
|
285
|
+
return viewerFor(organization);
|
|
286
|
+
}));
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* For one read, the current user as each organization's pull requests identify them (see
|
|
290
|
+
* {@link getFilterUserId}). An organization whose id can't be read resolves `undefined`, since authorship is
|
|
291
|
+
* optional enrichment and one organization's failed lookup must not fail the read or blank the others; it is
|
|
292
|
+
* asked once per read, as a miss isn't cached.
|
|
293
|
+
*/
|
|
294
|
+
getOrganizationViewers(session) {
|
|
295
|
+
const viewers = /* @__PURE__ */ new Map();
|
|
296
|
+
return (organization) => {
|
|
297
|
+
const key = organization.toLowerCase();
|
|
298
|
+
let viewer = viewers.get(key);
|
|
299
|
+
if (viewer == null) {
|
|
300
|
+
viewer = this.getFilterUserId(session, organization).then((id) => id != null ? { id } : void 0, () => void 0);
|
|
301
|
+
viewers.set(key, viewer);
|
|
302
|
+
}
|
|
303
|
+
return viewer;
|
|
304
|
+
};
|
|
262
305
|
}
|
|
263
306
|
/**
|
|
264
307
|
* What the discovery caches (account, organizations, projects, and their stored copies) are keyed by. Azure DevOps
|
|
@@ -611,11 +654,12 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
611
654
|
* like the repo-scoped list rows — not through {@link fromAzureProviderPullRequest}, which only the
|
|
612
655
|
* account-wide searches use.
|
|
613
656
|
*/
|
|
614
|
-
async getProviderPullRequestsBatch(session, coordinates,
|
|
657
|
+
async getProviderPullRequestsBatch(session, coordinates, _options, _cancellation) {
|
|
615
658
|
const api = await this.getProvidersApi();
|
|
616
659
|
const { tokenWithInfo } = this.getApiOptions(session);
|
|
617
|
-
const viewerFor = this.getOrganizationViewers(session
|
|
660
|
+
const viewerFor = this.getOrganizationViewers(session);
|
|
618
661
|
return mapSettledBounded(coordinates, 6, async (c) => {
|
|
662
|
+
const viewer = viewerFor(c.owner);
|
|
619
663
|
const pr = await api.getPullRequestForRepo(tokenWithInfo, {
|
|
620
664
|
namespace: c.owner,
|
|
621
665
|
name: c.repo,
|
|
@@ -626,7 +670,7 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
626
670
|
});
|
|
627
671
|
if (pr == null) return void 0;
|
|
628
672
|
return fromProviderPullRequest(pr, this, {
|
|
629
|
-
currentAccount: await
|
|
673
|
+
currentAccount: await viewer,
|
|
630
674
|
projection: "batch"
|
|
631
675
|
});
|
|
632
676
|
});
|
|
@@ -782,7 +826,7 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
782
826
|
truncated
|
|
783
827
|
};
|
|
784
828
|
});
|
|
785
|
-
return resolveBranchPullRequests(targets, found, (coordinates) => this.getProviderPullRequestsBatch(session, coordinates,
|
|
829
|
+
return resolveBranchPullRequests(targets, found, (coordinates) => this.getProviderPullRequestsBatch(session, coordinates, void 0, cancellation));
|
|
786
830
|
}
|
|
787
831
|
async getProviderPullRequest(session, resource, id) {
|
|
788
832
|
return this.readRepository(session, resource, (azure, target) => azure.getPullRequest(this, toTokenWithInfo(this.id, session), target.repo.owner, target.repo.project ?? target.repo.name, id, { baseUrl: target.baseUrl }));
|
|
@@ -814,7 +858,7 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
814
858
|
const projects = (await this.getProviderProjectsForResources(session, await this.getProviderResourcesForUser(session) ?? [])).values;
|
|
815
859
|
if (projects.length === 0) return void 0;
|
|
816
860
|
const repoDescriptors = [...(await this.getRepoDescriptorsForProjects(session, projects) ?? /* @__PURE__ */ new Map()).values()].filter((r) => r != null).flat();
|
|
817
|
-
return result.values.map((pr) => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects, "search"));
|
|
861
|
+
return result.values.map((pr) => this.fromAzureProviderPullRequest(pr, repoDescriptors, projects, "search", this._rowViewers.get(pr)));
|
|
818
862
|
}
|
|
819
863
|
async getProviderMyPullRequestsForUser(session, options) {
|
|
820
864
|
const api = await this.getProvidersApi();
|
|
@@ -853,6 +897,7 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
853
897
|
return {
|
|
854
898
|
prs: collected,
|
|
855
899
|
projectIdentity,
|
|
900
|
+
organization: project.namespace,
|
|
856
901
|
failure: toCollectionScopeFailure(scope, /* @__PURE__ */ new Error("Azure DevOps returned no page after advertising a continuation"))
|
|
857
902
|
};
|
|
858
903
|
}
|
|
@@ -863,6 +908,7 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
863
908
|
return {
|
|
864
909
|
prs: collected,
|
|
865
910
|
projectIdentity,
|
|
911
|
+
organization: project.namespace,
|
|
866
912
|
failure: toCollectionScopeFailure(scope, /* @__PURE__ */ new Error("Azure DevOps returned no advancing pull request continuation"))
|
|
867
913
|
};
|
|
868
914
|
}
|
|
@@ -873,12 +919,14 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
873
919
|
return {
|
|
874
920
|
prs: collected,
|
|
875
921
|
projectIdentity,
|
|
922
|
+
organization: project.namespace,
|
|
876
923
|
failure: toCollectionScopeFailure(scope, ex)
|
|
877
924
|
};
|
|
878
925
|
}
|
|
879
926
|
return {
|
|
880
927
|
prs: collected,
|
|
881
|
-
projectIdentity
|
|
928
|
+
projectIdentity,
|
|
929
|
+
organization: project.namespace
|
|
882
930
|
};
|
|
883
931
|
};
|
|
884
932
|
const requested = options?.filters?.length ? new Set(options.filters) : void 0;
|
|
@@ -886,12 +934,16 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
886
934
|
const wantReviewed = requested == null || requested.has("assignee") || requested.has("review-requested");
|
|
887
935
|
const userIds = /* @__PURE__ */ new Map();
|
|
888
936
|
const identityFailures = /* @__PURE__ */ new Map();
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
if (
|
|
894
|
-
|
|
937
|
+
const organizations = uniqueAzureNames(projects.values.map((p) => p.resourceName));
|
|
938
|
+
const identities = await mapSettledBounded(organizations, 6, (org) => this.getFilterUserId(session, org));
|
|
939
|
+
for (const [i, identity] of identities.entries()) {
|
|
940
|
+
const key = organizations[i].toLowerCase();
|
|
941
|
+
if (identity.status === "fulfilled") {
|
|
942
|
+
userIds.set(key, identity.value);
|
|
943
|
+
continue;
|
|
944
|
+
}
|
|
945
|
+
throwIfCallerContractError(identity.reason);
|
|
946
|
+
identityFailures.set(key, identity.reason);
|
|
895
947
|
}
|
|
896
948
|
const groups = wantReviewed ? await this.getReviewerGroupsByOrganization(session, projects.values, userIds, failures) : void 0;
|
|
897
949
|
if (groups?.incomplete) truncated = true;
|
|
@@ -927,7 +979,10 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
927
979
|
if (outcome.failure != null) failures.push(outcome.failure);
|
|
928
980
|
for (const pr of outcome.prs) {
|
|
929
981
|
const key = getProviderPullRequestIdentity(pr) ?? `project:${outcome.projectIdentity}:pull-request:${pr.id}`;
|
|
930
|
-
if (!prsByIdentity.has(key)) prsByIdentity.set(key,
|
|
982
|
+
if (!prsByIdentity.has(key)) prsByIdentity.set(key, {
|
|
983
|
+
pr,
|
|
984
|
+
organization: outcome.organization
|
|
985
|
+
});
|
|
931
986
|
}
|
|
932
987
|
}
|
|
933
988
|
const metadata = mergeCollectionMetadata(failures.length > 0 ? {
|
|
@@ -936,7 +991,11 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
936
991
|
} : void 0, projects.metadata);
|
|
937
992
|
const groupIds = groups?.groupIds ?? /* @__PURE__ */ new Set();
|
|
938
993
|
return {
|
|
939
|
-
values: Array.from(prsByIdentity.values(), (pr) =>
|
|
994
|
+
values: Array.from(prsByIdentity.values(), ({ pr, organization }) => {
|
|
995
|
+
const row = markMyGroupReviews(pr, groupIds);
|
|
996
|
+
this._rowViewers.set(row, { id: userIds.get(organization.toLowerCase()) });
|
|
997
|
+
return row;
|
|
998
|
+
}),
|
|
940
999
|
paging: {
|
|
941
1000
|
cursor: "{}",
|
|
942
1001
|
more: false,
|
|
@@ -1200,9 +1259,10 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
1200
1259
|
this._organizations = void 0;
|
|
1201
1260
|
this._projects = void 0;
|
|
1202
1261
|
this._accounts = void 0;
|
|
1262
|
+
this._organizationUserIds.clear();
|
|
1203
1263
|
this._reviewerGroupIds.clear();
|
|
1204
1264
|
}
|
|
1205
|
-
fromAzureProviderPullRequest(azurePullRequest, repoDescriptors, projectDescriptors, projection) {
|
|
1265
|
+
fromAzureProviderPullRequest(azurePullRequest, repoDescriptors, projectDescriptors, projection, currentAccount) {
|
|
1206
1266
|
const baseRepoDescriptor = repoDescriptors.find((r) => r.id === azurePullRequest.repository.id);
|
|
1207
1267
|
const headRepoDescriptor = azurePullRequest.headRepository != null ? repoDescriptors.find((r) => r.id === azurePullRequest.headRepository.id) : void 0;
|
|
1208
1268
|
let project;
|
|
@@ -1225,7 +1285,8 @@ var AzureDevOpsIntegrationBase = class extends GitHostIntegration {
|
|
|
1225
1285
|
if (baseRepoDescriptor?.projectName != null) project = projectDescriptors.find((p) => p.resourceName === baseRepoDescriptor.resourceName && p.name === baseRepoDescriptor.projectName);
|
|
1226
1286
|
return fromProviderPullRequest(azurePullRequest, this, {
|
|
1227
1287
|
project,
|
|
1228
|
-
projection
|
|
1288
|
+
projection,
|
|
1289
|
+
currentAccount
|
|
1229
1290
|
});
|
|
1230
1291
|
}
|
|
1231
1292
|
};
|
|
@@ -1247,6 +1308,6 @@ var AzureDevOpsIntegration = class extends AzureDevOpsIntegrationBase {
|
|
|
1247
1308
|
}
|
|
1248
1309
|
};
|
|
1249
1310
|
//#endregion
|
|
1250
|
-
export { AzureDevOpsIntegration, AzureDevOpsIntegrationBase, findAzureRepositoryApiBaseUrl, getAzureRepositoryApiBaseUrl,
|
|
1311
|
+
export { AzureDevOpsIntegration, AzureDevOpsIntegrationBase, findAzureRepositoryApiBaseUrl, getAzureRepositoryApiBaseUrl, getAzureScopeVirtualDirectory, isAzureProjectlessCandidate, markMyGroupReviews, resolveAzureProjectlessRepository, sameAzureName, toAzureReviewerReads, uniqueAzureNames };
|
|
1251
1312
|
|
|
1252
1313
|
//# sourceMappingURL=azureDevOps.js.map
|