@gitkraken/core-gitlens 0.5.108 → 0.5.109
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 +17 -1
- package/dist/git/models/issue.d.ts +70 -0
- package/dist/git/models/issue.d.ts.map +1 -1
- package/dist/git/models/issue.js +17 -0
- package/dist/git/models/issue.js.map +1 -1
- package/dist/git/utils/issue.utils.d.ts +41 -1
- package/dist/git/utils/issue.utils.d.ts.map +1 -1
- package/dist/git/utils/issue.utils.js +80 -0
- package/dist/git/utils/issue.utils.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +33 -6
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +137 -15
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.d.ts +49 -5
- package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.js +64 -6
- package/dist/plus/git-github/api/issueSearchQuery.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +18 -0
- package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -1
- package/dist/plus/integrations/collectionMetadata.js +24 -0
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +15 -9
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +40 -26
- package/dist/plus/integrations/manager.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +6 -31
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +11 -1
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/issueReads.d.ts +63 -1
- package/dist/plus/integrations/models/issueReads.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts +7 -21
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providerFilters.d.ts +1 -1
- package/dist/plus/integrations/providerFilters.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.js +1 -0
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github.js +1 -0
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab.js +1 -0
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/issueSorts.d.ts +36 -0
- package/dist/plus/integrations/providers/issueSorts.d.ts.map +1 -0
- package/dist/plus/integrations/providers/issueSorts.js +76 -0
- package/dist/plus/integrations/providers/issueSorts.js.map +1 -0
- package/dist/plus/integrations/providers/jira.d.ts +3 -9
- package/dist/plus/integrations/providers/jira.d.ts.map +1 -1
- package/dist/plus/integrations/providers/jira.js +5 -1
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/linear.d.ts +24 -9
- package/dist/plus/integrations/providers/linear.d.ts.map +1 -1
- package/dist/plus/integrations/providers/linear.js +63 -5
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +63 -7
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js +55 -0
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providersApi.d.ts +18 -3
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
- package/dist/plus/integrations/providers/providersApi.js +24 -7
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +3 -9
- package/dist/plus/integrations/providers/trello.d.ts.map +1 -1
- package/dist/plus/integrations/providers/trello.js +1 -0
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.js +5 -1
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts +6 -0
- package/dist/plus/integrations/reads/broaden.d.ts.map +1 -1
- package/dist/plus/integrations/reads/broaden.js.map +1 -1
- package/dist/plus/integrations/reads/counts.d.ts +8 -1
- package/dist/plus/integrations/reads/counts.d.ts.map +1 -1
- package/dist/plus/integrations/reads/counts.js.map +1 -1
- package/dist/plus/integrations/reads/filters.d.ts +59 -9
- package/dist/plus/integrations/reads/filters.d.ts.map +1 -1
- package/dist/plus/integrations/reads/filters.js +17 -0
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts +18 -1
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.js +40 -3
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/issues.d.ts +27 -3
- package/dist/plus/integrations/reads/issues.d.ts.map +1 -1
- package/dist/plus/integrations/reads/issues.js +223 -123
- package/dist/plus/integrations/reads/issues.js.map +1 -1
- package/dist/plus/integrations/reads/ordering.d.ts +101 -0
- package/dist/plus/integrations/reads/ordering.d.ts.map +1 -0
- package/dist/plus/integrations/reads/ordering.js +48 -0
- package/dist/plus/integrations/reads/ordering.js.map +1 -0
- package/dist/plus/integrations/reads/searchIssues.d.ts +7 -2
- package/dist/plus/integrations/reads/searchIssues.d.ts.map +1 -1
- package/dist/plus/integrations/reads/searchIssues.js +9 -3
- package/dist/plus/integrations/reads/searchIssues.js.map +1 -1
- package/dist/plus/integrations/reads/warnings.d.ts +34 -2
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -1
- package/dist/plus/integrations/reads/warnings.js +47 -2
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +10 -0
- package/dist/plus/integrations/results.d.ts.map +1 -1
- package/dist/plus/integrations/results.js.map +1 -1
- package/package.json +2 -2
- package/src/git/models/issue.ts +73 -0
- package/src/git/utils/issue.utils.ts +91 -1
- package/src/plus/git-github/api/github.ts +180 -20
- package/src/plus/git-github/api/issueSearchQuery.ts +67 -7
- package/src/plus/integrations/collectionMetadata.ts +24 -0
- package/src/plus/integrations/integrationService.ts +15 -10
- package/src/plus/integrations/manager.ts +40 -31
- package/src/plus/integrations/models/gitHostIntegration.ts +18 -31
- package/src/plus/integrations/models/issueReads.ts +65 -1
- package/src/plus/integrations/models/issuesIntegration.ts +7 -6
- package/src/plus/integrations/providerFilters.ts +2 -0
- package/src/plus/integrations/providers/azureDevOps.ts +1 -0
- package/src/plus/integrations/providers/github.ts +1 -0
- package/src/plus/integrations/providers/gitlab.ts +1 -0
- package/src/plus/integrations/providers/issueSorts.ts +89 -0
- package/src/plus/integrations/providers/jira.ts +9 -3
- package/src/plus/integrations/providers/linear.ts +77 -8
- package/src/plus/integrations/providers/models.ts +122 -5
- package/src/plus/integrations/providers/providersApi.ts +51 -13
- package/src/plus/integrations/providers/trello.ts +4 -3
- package/src/plus/integrations/providers/utils/providerPaging.ts +6 -1
- package/src/plus/integrations/reads/broaden.ts +6 -0
- package/src/plus/integrations/reads/counts.ts +8 -1
- package/src/plus/integrations/reads/filters.ts +70 -8
- package/src/plus/integrations/reads/issueTracker.ts +78 -4
- package/src/plus/integrations/reads/issues.ts +386 -194
- package/src/plus/integrations/reads/ordering.ts +124 -0
- package/src/plus/integrations/reads/searchIssues.ts +15 -3
- package/src/plus/integrations/reads/warnings.ts +72 -1
- package/src/plus/integrations/results.ts +10 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { defaultIssueSort } from '../../../git/models/issue.js';
|
|
2
|
+
import { getIssueComparator } from '../../../git/utils/issue.utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the order an issue read should request: validates a caller-supplied key against what one provider
|
|
5
|
+
* surface can express server-side, and supplies this facade's default when the caller asked for none.
|
|
6
|
+
*
|
|
7
|
+
* Three outcomes, and each is a decision rather than a convenience:
|
|
8
|
+
* - A key the surface can't express is REJECTED and the read refused whole, never resolved to the nearest
|
|
9
|
+
* supported key. Same reason a dropped filter isn't dropped: the provider serves at most a bounded window of
|
|
10
|
+
* matches, so a list ordered by something else is a DIFFERENT subset than the one asked for, and the cursor that
|
|
11
|
+
* comes with it describes that other subset — indistinguishable, from the result, from the order requested.
|
|
12
|
+
* - An omitted key becomes {@link defaultIssueSort}, because leaving it to the provider is what makes the same
|
|
13
|
+
* read return different things on different hosts (Azure by creation, Jira by nothing at all). The default is
|
|
14
|
+
* this facade's promise; the SDK deliberately has no opinion.
|
|
15
|
+
* - An omitted key on a surface that can't express even the default returns `undefined`, leaving that provider's
|
|
16
|
+
* own order. A default the caller never asked for must not refuse a read that works today.
|
|
17
|
+
*
|
|
18
|
+
* Takes the supported list rather than an `IntegrationIds`, unlike the filter validators, because which list
|
|
19
|
+
* applies is the CALLER's decision — `supportedIssueSorts` for a repo-scoped or tracker read,
|
|
20
|
+
* `supportedAccountWideIssueSorts` for an account-wide one — and that branch already exists at the call site
|
|
21
|
+
* (`repos` present or not). Resolving it in here would duplicate it.
|
|
22
|
+
*/
|
|
23
|
+
export function resolveIssueSort(supported, sort) {
|
|
24
|
+
if (sort == null) {
|
|
25
|
+
return supported?.includes(defaultIssueSort) ? { sort: defaultIssueSort } : {};
|
|
26
|
+
}
|
|
27
|
+
if (!supported?.includes(sort)) {
|
|
28
|
+
return { rejection: { reason: 'unsupported-sort', requested: sort, supported: supported } };
|
|
29
|
+
}
|
|
30
|
+
return { sort: sort };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Binds a resolved sort key to the shape of the page about to be built.
|
|
34
|
+
*
|
|
35
|
+
* `merged` is the caller's own count of provider queries reduced to the only thing that matters: GitHub sends one
|
|
36
|
+
* search however many repositories are named, GitLab one per repository, Azure and the trackers one per project,
|
|
37
|
+
* and every account-wide read is a union of several. Above one, the union is what gets published, and only a field
|
|
38
|
+
* an {@link IssueShape} carries can order it.
|
|
39
|
+
*/
|
|
40
|
+
export function toIssueOrdering(sort, merged) {
|
|
41
|
+
const comparator = sort != null ? getIssueComparator(sort) : undefined;
|
|
42
|
+
return {
|
|
43
|
+
sort: sort,
|
|
44
|
+
unmergeable: merged && sort != null && comparator == null ? { requested: sort } : undefined,
|
|
45
|
+
order: (items) => (merged && comparator != null ? [...items].sort(comparator) : items),
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=ordering.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ordering.js","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/ordering.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AA4BvE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,gBAAgB,CAC/B,SAAqC,EACrC,IAA8B;IAE9B,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,SAAS,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAChF,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC;IAC7F,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACvB,CAAC;AA8CD;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,IAA8B,EAAE,MAAe;IAC9E,MAAM,UAAU,GAAG,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACvE,OAAO;QACN,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,MAAM,IAAI,IAAI,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS;QAC3F,KAAK,EAAE,CAAC,KAAmB,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,UAAU,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;KACpG,CAAC;AACH,CAAC"}
|
|
@@ -17,8 +17,13 @@ import type { ProviderReadContext } from './context.js';
|
|
|
17
17
|
* for the same reason `broaden.ts`, `sweeps.ts` and `issueTracker.ts` are separate files.
|
|
18
18
|
*
|
|
19
19
|
* Contract details worth knowing before calling:
|
|
20
|
-
* - Ordering is
|
|
21
|
-
*
|
|
20
|
+
* - Ordering is `criteria.sort`, most-recently-updated-first by default, and validated like every other criterion
|
|
21
|
+
* against `getSupportedFilters().issueSearch.sorts`. SOME order is always requested — a "show the N most recent"
|
|
22
|
+
* policy at the provider's result ceiling is only correct under a guaranteed one, and the ceiling warning names
|
|
23
|
+
* the key it selected the window under. A key the provider can't express refuses the read rather than serving a
|
|
24
|
+
* differently-ordered result; do not change it mid-pagination (a cursor is bound to the order it was made under,
|
|
25
|
+
* and threading it under a different key is refused with a warning + `fetchFailed` — drop the cursor and read
|
|
26
|
+
* from the first page instead).
|
|
22
27
|
* - Paging is cursor-only. `page` alone walks 1..N internally (O(N) requests); a page past the last one is an
|
|
23
28
|
* empty page N, never page N−1 relabeled.
|
|
24
29
|
* - At the provider's result ceiling the read SUCCEEDS and reports an omission carrying the total match count,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchIssues.d.ts","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/searchIssues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"searchIssues.d.ts","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/searchIssues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAmB,MAAM,eAAe,CAAC;AAM1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAmBxD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,gBAAgB,CACrC,GAAG,EAAE,mBAAmB,EACxB,OAAO,EAAE;IACR,UAAU,EAAE,cAAc,CAAC;IAC3B,oGAAoG;IACpG,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,GACC,OAAO,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC,CAkL1C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { effectiveIssueSort } from '../../../git/utils/issue.utils.js';
|
|
1
2
|
import { isGitHostIntegration, isIssuesHostIntegrationId, warnOnMissingSessionForDomain, } from '../utils/integration.utils.js';
|
|
2
3
|
import { runCaptured } from './drains.js';
|
|
3
4
|
import { resolveIssueSearchCriteria, resolveIssueSearchScope } from './filters.js';
|
|
@@ -17,8 +18,13 @@ import { gitHostOnlySurfaceWarning, issueSearchCapResultWarning, issuesUnsupport
|
|
|
17
18
|
* for the same reason `broaden.ts`, `sweeps.ts` and `issueTracker.ts` are separate files.
|
|
18
19
|
*
|
|
19
20
|
* Contract details worth knowing before calling:
|
|
20
|
-
* - Ordering is
|
|
21
|
-
*
|
|
21
|
+
* - Ordering is `criteria.sort`, most-recently-updated-first by default, and validated like every other criterion
|
|
22
|
+
* against `getSupportedFilters().issueSearch.sorts`. SOME order is always requested — a "show the N most recent"
|
|
23
|
+
* policy at the provider's result ceiling is only correct under a guaranteed one, and the ceiling warning names
|
|
24
|
+
* the key it selected the window under. A key the provider can't express refuses the read rather than serving a
|
|
25
|
+
* differently-ordered result; do not change it mid-pagination (a cursor is bound to the order it was made under,
|
|
26
|
+
* and threading it under a different key is refused with a warning + `fetchFailed` — drop the cursor and read
|
|
27
|
+
* from the first page instead).
|
|
22
28
|
* - Paging is cursor-only. `page` alone walks 1..N internally (O(N) requests); a page past the last one is an
|
|
23
29
|
* empty page N, never page N−1 relabeled.
|
|
24
30
|
* - At the provider's result ceiling the read SUCCEEDS and reports an omission carrying the total match count,
|
|
@@ -112,7 +118,7 @@ export async function searchIssuesPage(ctx, options) {
|
|
|
112
118
|
// The result ceiling is the one truncation cause this read can EXPLAIN with a number, so it gets its own
|
|
113
119
|
// warning carrying the total. Anything else truncated (an unusable continuation, a provider that stopped
|
|
114
120
|
// advancing) falls back to the generic wording.
|
|
115
|
-
warnings.push(issueSearchCapResultWarning(options.providerId, domain, options.connectionId, totalCount) ??
|
|
121
|
+
warnings.push(issueSearchCapResultWarning(options.providerId, domain, options.connectionId, totalCount, effectiveIssueSort(options.criteria?.sort)) ??
|
|
116
122
|
truncationWarning(options.providerId, domain, options.connectionId, 'Issue search',
|
|
117
123
|
// `exhausted`: this read exposes no budget the caller could raise, so nothing it could call
|
|
118
124
|
// would return the withheld items.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchIssues.js","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/searchIssues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"searchIssues.js","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/searchIssues.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAIvE,OAAO,EACN,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,GAC7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EACN,6BAA6B,EAC7B,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,YAAY,EACZ,iBAAiB,EACjB,qCAAqC,GACrC,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,GAAwB,EACxB,OA2BC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IACxD,wFAAwF;IACxF,gCAAgC;IAChC,MAAM,OAAO,GAAG,CAAC,OAAwB,EAAE,EAAE,CA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BACN,CAAC,CAAC,kBAAkB,CAAC;oBACnB,YAAY,EAAE,WAAW;oBACzB,aAAa,EAAE,IAAI;oBACnB,cAAc,EAAE,OAAO,CAAC,MAAM;oBAC9B,eAAe,EAAE,KAAK;iBACtB,CAAC;YACJ,YAAY,EAAE,KAAK,CAAC,MAAM;YAC1B,SAAS,EAAE,SAAS,IAAI,SAAS;SACjC;QACD,OAAO,EAAE,YAAY,CAAC,OAAO;QAC7B,MAAM,EAAE,YAAY,CAAC,MAAM;QAC3B,WAAW,EAAE,eAAe,IAAI,SAAS;KACzC,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IntegrationIds } from '../constants.js';
|
|
2
|
-
import type { IssueFilter, PullRequestFilter } from '../providerFilters.js';
|
|
2
|
+
import type { IssueFilter, IssueSorting, PullRequestFilter } from '../providerFilters.js';
|
|
3
3
|
import type { ProviderWarning } from '../results.js';
|
|
4
4
|
import type { IssueSearchCriteriaRejection, PullRequestSearchCriteriaRejection } from './filters.js';
|
|
5
|
+
import type { UnmergeableIssueSort, UnsupportedIssueSortRejection } from './ordering.js';
|
|
5
6
|
/**
|
|
6
7
|
* The warnings the provider facade raises on its OWN terms, as opposed to the ones derived from a caught
|
|
7
8
|
* provider error ({@link toProviderWarning}) or from SDK collection metadata (`collectionMetadata.ts`).
|
|
@@ -94,6 +95,33 @@ export declare function unsupportedPullRequestSearchCriteriaWarning(id: Integrat
|
|
|
94
95
|
* the wording can't drift from the check that produced it (see {@link resolveIssueSearchCriteria}).
|
|
95
96
|
*/
|
|
96
97
|
export declare function unsupportedIssueSearchCriteriaWarning(id: IntegrationIds, domain: string | undefined, connectionId: string | undefined, rejection: IssueSearchCriteriaRejection): ProviderWarning;
|
|
98
|
+
/**
|
|
99
|
+
* Warning for an issue read asked to order by a key its provider can't express server-side.
|
|
100
|
+
*
|
|
101
|
+
* Separate from {@link unsupportedIssueSearchCriteriaWarning} because it serves the reads that take `sort` as an
|
|
102
|
+
* OPTION rather than as a criterion — repo-scoped, account-wide, and issue-tracker — where there is no criteria
|
|
103
|
+
* set to fold it into. The filtered search keeps reporting it as one more `unsupported-criteria` entry, so a
|
|
104
|
+
* caller there still gets a single refusal listing everything at once.
|
|
105
|
+
*
|
|
106
|
+
* Takes the rejection the check produced rather than a re-read supported list: which of the two tables applies is
|
|
107
|
+
* the caller's own branch (`repos` present or not), so reading it back here — or threading it by hand — would be
|
|
108
|
+
* free to disagree with the check that refused.
|
|
109
|
+
*/
|
|
110
|
+
export declare function unsupportedIssueSortWarning(id: IntegrationIds, domain: string | undefined, connectionId: string | undefined, rejection: UnsupportedIssueSortRejection): ProviderWarning;
|
|
111
|
+
/**
|
|
112
|
+
* Warning for a merged issue read asked to order by a key that no normalized issue carries.
|
|
113
|
+
*
|
|
114
|
+
* The distinction this exists to make is not about the provider: the provider orders by `priority` perfectly well
|
|
115
|
+
* within ONE project. It is about the read, which fans out over several and merges the results here, where the
|
|
116
|
+
* only fields available are the ones {@link IssueShape} models. Serving the concatenated per-scope runs would look
|
|
117
|
+
* ordered without being so, which is why this refuses instead — and why the message says WHY, since the same key
|
|
118
|
+
* against the same provider succeeds on a single-scope read.
|
|
119
|
+
*
|
|
120
|
+
* What a read fans out OVER differs by read, hence the `scope`: repositories, projects, or — where one query is
|
|
121
|
+
* issued per requested relationship and the runs are unioned within a single project (Jira) — the filters
|
|
122
|
+
* themselves. Naming the wrong one would tell a caller to narrow something that isn't what merged.
|
|
123
|
+
*/
|
|
124
|
+
export declare function unmergeableIssueSortWarning(id: IntegrationIds, domain: string | undefined, connectionId: string | undefined, unmergeable: UnmergeableIssueSort, scope: 'repositories' | 'projects' | 'filters'): ProviderWarning;
|
|
97
125
|
/**
|
|
98
126
|
* The omission for a filtered issue search that hit the provider's RESULT CEILING: more issues matched than the
|
|
99
127
|
* provider will ever serve for one query, however it is paged.
|
|
@@ -104,10 +132,14 @@ export declare function unsupportedIssueSearchCriteriaWarning(id: IntegrationIds
|
|
|
104
132
|
* 'none'` because the items past the ceiling are UNREACHABLE, not merely unfetched: no budget, no retry, and no
|
|
105
133
|
* cursor would return them. Narrowing the criteria is the only way through, which is a decision for the caller.
|
|
106
134
|
*
|
|
135
|
+
* The message names the ORDER, and has to now that ordering is an option: the reachable window is the top `limit`
|
|
136
|
+
* under that key, so "the 1.000 most recent" is a true sentence only while the key is the default one. The same
|
|
137
|
+
* value goes on the omission, so a consumer wording its own sentence doesn't have to remember what it asked for.
|
|
138
|
+
*
|
|
107
139
|
* Returns `undefined` when the provider declares no ceiling, so the caller falls back to the generic wording
|
|
108
140
|
* rather than reporting a limit it invented.
|
|
109
141
|
*/
|
|
110
|
-
export declare function issueSearchCapResultWarning(id: IntegrationIds, domain: string | undefined, connectionId: string | undefined, totalCount: number | undefined): ProviderWarning | undefined;
|
|
142
|
+
export declare function issueSearchCapResultWarning(id: IntegrationIds, domain: string | undefined, connectionId: string | undefined, totalCount: number | undefined, sort: IssueSorting): ProviderWarning | undefined;
|
|
111
143
|
/** Quantified omission for a pull-request search that exceeded the provider's reachable result window. */
|
|
112
144
|
export declare function pullRequestSearchCapResultWarning(id: IntegrationIds, domain: string | undefined, connectionId: string | undefined, totalCount: number | undefined): ProviderWarning | undefined;
|
|
113
145
|
/** Warning for a git host that doesn't expose issues on this surface (e.g. Bitbucket, deprecated in favor of Jira). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warnings.d.ts","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/warnings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EACX,WAAW,EAEX,iBAAiB,EAEjB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,4BAA4B,EAAE,kCAAkC,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"warnings.d.ts","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SearchCapabilities(capabilities) {
|
|
|
194
194
|
return [
|
|
195
195
|
...capabilities.relationships.map(r => `relationships:${r}`),
|
|
196
196
|
...flags.filter(([, supported]) => supported).map(([name]) => name),
|
|
197
|
+
...capabilities.sorts.map(s => `sort:${s}`),
|
|
197
198
|
].join(', ');
|
|
198
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Warning for an issue read asked to order by a key its provider can't express server-side.
|
|
202
|
+
*
|
|
203
|
+
* Separate from {@link unsupportedIssueSearchCriteriaWarning} because it serves the reads that take `sort` as an
|
|
204
|
+
* OPTION rather than as a criterion — repo-scoped, account-wide, and issue-tracker — where there is no criteria
|
|
205
|
+
* set to fold it into. The filtered search keeps reporting it as one more `unsupported-criteria` entry, so a
|
|
206
|
+
* caller there still gets a single refusal listing everything at once.
|
|
207
|
+
*
|
|
208
|
+
* Takes the rejection the check produced rather than a re-read supported list: which of the two tables applies is
|
|
209
|
+
* the caller's own branch (`repos` present or not), so reading it back here — or threading it by hand — would be
|
|
210
|
+
* free to disagree with the check that refused.
|
|
211
|
+
*/
|
|
212
|
+
export function unsupportedIssueSortWarning(id, domain, connectionId, rejection) {
|
|
213
|
+
return otherWarning(id, domain, connectionId, unsupportedNarrowingMessage(id, 'issue sort', rejection.requested, (rejection.supported ?? []).join(', ')));
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Warning for a merged issue read asked to order by a key that no normalized issue carries.
|
|
217
|
+
*
|
|
218
|
+
* The distinction this exists to make is not about the provider: the provider orders by `priority` perfectly well
|
|
219
|
+
* within ONE project. It is about the read, which fans out over several and merges the results here, where the
|
|
220
|
+
* only fields available are the ones {@link IssueShape} models. Serving the concatenated per-scope runs would look
|
|
221
|
+
* ordered without being so, which is why this refuses instead — and why the message says WHY, since the same key
|
|
222
|
+
* against the same provider succeeds on a single-scope read.
|
|
223
|
+
*
|
|
224
|
+
* What a read fans out OVER differs by read, hence the `scope`: repositories, projects, or — where one query is
|
|
225
|
+
* issued per requested relationship and the runs are unioned within a single project (Jira) — the filters
|
|
226
|
+
* themselves. Naming the wrong one would tell a caller to narrow something that isn't what merged.
|
|
227
|
+
*/
|
|
228
|
+
export function unmergeableIssueSortWarning(id, domain, connectionId, unmergeable, scope) {
|
|
229
|
+
// Both forms are spelled out rather than depluralized at runtime: the message needs each, and
|
|
230
|
+
// `'repositories'.replace(/s$/, '')` is `'repositorie'`.
|
|
231
|
+
const nouns = {
|
|
232
|
+
repositories: { many: 'repositories', one: 'repository' },
|
|
233
|
+
projects: { many: 'projects', one: 'project' },
|
|
234
|
+
filters: { many: 'issue relationships', one: 'relationship' },
|
|
235
|
+
}[scope];
|
|
236
|
+
return otherWarning(id, domain, connectionId, `Cannot order by '${unmergeable.requested}' across several ${nouns.many}: this read merges their results, and a normalized issue carries no such field to merge on. Read one ${nouns.one} at a time, or order by a date, title, comment or reaction count.`);
|
|
237
|
+
}
|
|
199
238
|
/**
|
|
200
239
|
* The omission for a filtered issue search that hit the provider's RESULT CEILING: more issues matched than the
|
|
201
240
|
* provider will ever serve for one query, however it is paged.
|
|
@@ -206,24 +245,30 @@ function describeIssueSearchCapabilities(capabilities) {
|
|
|
206
245
|
* 'none'` because the items past the ceiling are UNREACHABLE, not merely unfetched: no budget, no retry, and no
|
|
207
246
|
* cursor would return them. Narrowing the criteria is the only way through, which is a decision for the caller.
|
|
208
247
|
*
|
|
248
|
+
* The message names the ORDER, and has to now that ordering is an option: the reachable window is the top `limit`
|
|
249
|
+
* under that key, so "the 1.000 most recent" is a true sentence only while the key is the default one. The same
|
|
250
|
+
* value goes on the omission, so a consumer wording its own sentence doesn't have to remember what it asked for.
|
|
251
|
+
*
|
|
209
252
|
* Returns `undefined` when the provider declares no ceiling, so the caller falls back to the generic wording
|
|
210
253
|
* rather than reporting a limit it invented.
|
|
211
254
|
*/
|
|
212
|
-
export function issueSearchCapResultWarning(id, domain, connectionId, totalCount) {
|
|
255
|
+
export function issueSearchCapResultWarning(id, domain, connectionId, totalCount, sort) {
|
|
213
256
|
const limit = providersMetadata[id]?.issueSearchResultLimit;
|
|
214
257
|
if (limit == null)
|
|
215
258
|
return undefined;
|
|
216
259
|
// Below the ceiling this warning would be a false claim; the caller's truncation had another cause.
|
|
217
260
|
if (totalCount == null || totalCount <= limit)
|
|
218
261
|
return undefined;
|
|
262
|
+
const [field, direction] = sort.split(':');
|
|
219
263
|
return {
|
|
220
|
-
...otherWarning(id, domain, connectionId, `Issue search matched ${totalCount} results, but '${id}' serves at most ${limit}; narrow the search to read the rest.`),
|
|
264
|
+
...otherWarning(id, domain, connectionId, `Issue search matched ${totalCount} results, but '${id}' serves at most ${limit}, ordered by ${field} ${direction}ending; narrow the search to read the rest.`),
|
|
221
265
|
omission: {
|
|
222
266
|
kind: 'provider-limit',
|
|
223
267
|
// The items past the ceiling can't be fetched by anything, so never offer a "load more".
|
|
224
268
|
recovery: 'none',
|
|
225
269
|
limit: limit,
|
|
226
270
|
totalCount: totalCount,
|
|
271
|
+
sort: sort,
|
|
227
272
|
},
|
|
228
273
|
};
|
|
229
274
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/warnings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"warnings.js","sourceRoot":"","sources":["../../../../src/plus/integrations/reads/warnings.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAK3D;;;;;;;GAOG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAC3B,EAAkB,EAClB,MAA0B,EAC1B,YAAgC,EAChC,OAAe;IAEf,OAAO;QACN,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,YAAY;QAC1B,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,KAAK;KACb,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBA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EACF,MAAM,EACN,YAAY,EACZ,gCAAgC,EAAE,2DAA2D,CAC7F,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IssueSorting } from '../../git/models/issue.js';
|
|
1
2
|
import type { IntegrationIds } from './constants.js';
|
|
2
3
|
export interface ConnectionStateChangeEvent {
|
|
3
4
|
key: string;
|
|
@@ -70,6 +71,15 @@ export interface ProviderWarningOmission {
|
|
|
70
71
|
limit?: number;
|
|
71
72
|
/** Total matches the provider reported, when it reports one. Only GitHub's search cap does today. */
|
|
72
73
|
totalCount?: number;
|
|
74
|
+
/**
|
|
75
|
+
* The order the reachable window was selected under, as `field:direction`, when the omission is a result
|
|
76
|
+
* ceiling.
|
|
77
|
+
*
|
|
78
|
+
* Present so a consumer can word its own "N matched, showing the first M" without assuming WHICH M: the
|
|
79
|
+
* provider serves the top M under this key, so the sentence is only true if it names it. Absent for every
|
|
80
|
+
* omission that isn't a ceiling, where no window was selected by an order.
|
|
81
|
+
*/
|
|
82
|
+
sort?: IssueSorting;
|
|
73
83
|
/** Which repository / project / resource was affected, when one is attributed. */
|
|
74
84
|
scope?: ProviderWarningOmissionScope;
|
|
75
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../../src/plus/integrations/results.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,0BAA0B;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,WAAW,GAAG,cAAc,CAAC;CACrC;AAED;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,eAAe,GAAG,OAAO,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,2BAA2B,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,uBAAuB,CAAC;AAEzG;;;;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AAC;IACb,uCAAuC;IACvC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAChC,UAAU,EAAE,cAAc,EAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,EAAE,EAAE,OAAO,GACT,eAAe,CAoBjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,4BAA4B,GAAG,SAAS,GAAG,MAAM,CAI1F;AAsBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CAerG;AAmBD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAK5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../../src/plus/integrations/results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"results.js","sourceRoot":"","sources":["../../../src/plus/integrations/results.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAiR1G,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAE5C,SAAS,sBAAsB,CAAC,EAAW;IAC1C,MAAM,GAAG,GAAG,CAAC,EAAE,YAAY,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAA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,UAAU,EAAE,OAAO,CAAC,CAAC;YAC1C,SAAS;QACV,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;QACjD,oBAAoB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC;AACpD,CAAC;AAED;;;;;GAKG;AACH,SAAS,kBAAkB,CAAC,OAAwB;IACnD,OAAO;QACN,OAAO,CAAC,UAAU;QAClB,OAAO,CAAC,YAAY,IAAI,EAAE;QAC1B,OAAO,CAAC,MAAM,IAAI,EAAE;QACpB,OAAO,CAAC,IAAI;QACZ,0BAA0B,CAAC,OAAO,CAAC,QAAQ,CAAC;QAC5C,OAAO,CAAC,OAAO;KACf,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAuB,EAAE,OAAwB;IACrF,MAAM,GAAG,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC;QAAE,OAAO;IAExE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitkraken/core-gitlens",
|
|
3
3
|
"description": "GitLens core — shared Git / AI / GitHub primitives for internal GitKraken consumption",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.109",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "GitKraken",
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
}
|
|
221
221
|
},
|
|
222
222
|
"dependencies": {
|
|
223
|
-
"@gitkraken/provider-apis": "0.
|
|
223
|
+
"@gitkraken/provider-apis": "0.56.0",
|
|
224
224
|
"@octokit/graphql": "9.0.3",
|
|
225
225
|
"@octokit/request": "10.0.11",
|
|
226
226
|
"@octokit/request-error": "7.1.0",
|
package/src/git/models/issue.ts
CHANGED
|
@@ -25,6 +25,60 @@ export type IssueSearchRelationship =
|
|
|
25
25
|
/** Assigned to nobody. The complement of `any-assignee`, not a broadening of it. */
|
|
26
26
|
| 'unassigned';
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* A field an issue read can be ordered by, provider-neutral. No provider expresses all of them: each read
|
|
30
|
+
* validates the requested key against the capability its provider declares and refuses one it can't express
|
|
31
|
+
* server-side, rather than serving a differently-ordered list under the name of the one that was asked for.
|
|
32
|
+
*
|
|
33
|
+
* `closed` and `resolved` are deliberately SEPARATE, not two names for the same date. Azure DevOps tracks both
|
|
34
|
+
* and they differ (an issue can be closed without being resolved and resolved without being closed), and Jira
|
|
35
|
+
* has no close date at all — it models the equivalent as `resolutiondate`. Collapsing them would force one of
|
|
36
|
+
* those two providers to lie about which date it ordered by.
|
|
37
|
+
*/
|
|
38
|
+
export type IssueSortField =
|
|
39
|
+
/** Creation date. */
|
|
40
|
+
| 'created'
|
|
41
|
+
/** Last activity. */
|
|
42
|
+
| 'updated'
|
|
43
|
+
/** Close date. Only where the provider orders by it server-side — notably NOT GitHub. */
|
|
44
|
+
| 'closed'
|
|
45
|
+
/** Resolution date (Jira `resolutiondate`, Azure `ResolvedDate`). Distinct from `closed`. */
|
|
46
|
+
| 'resolved'
|
|
47
|
+
/** Number of comments. */
|
|
48
|
+
| 'comments'
|
|
49
|
+
/** Reactions/upvotes. */
|
|
50
|
+
| 'reactions'
|
|
51
|
+
/** The provider's own priority field. */
|
|
52
|
+
| 'priority'
|
|
53
|
+
/** Due date. */
|
|
54
|
+
| 'dueDate'
|
|
55
|
+
/** Alphabetical by title. */
|
|
56
|
+
| 'title';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* How an issue read is ordered, as `field:direction` — the same shape `BranchSorting`/`TagSorting` already use,
|
|
60
|
+
* so it is one serializable string a consumer can persist, compare, or bind straight to a setting or a dropdown.
|
|
61
|
+
*/
|
|
62
|
+
export type IssueSorting = `${IssueSortField}:asc` | `${IssueSortField}:desc`;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The order every issue read that HAS a default applies when the caller asks for none: most recently updated
|
|
66
|
+
* first, which is what those reads served before ordering was an option.
|
|
67
|
+
*
|
|
68
|
+
* One definition rather than one per layer, because it is a promise made in several places at once — the criteria
|
|
69
|
+
* model documents it, the GitHub query emits it, and the result-ceiling warning quotes it — and three copies would
|
|
70
|
+
* be free to disagree about what "the default" is.
|
|
71
|
+
*
|
|
72
|
+
* Note it is not a default every read has, and the two layers differ. The API client's account-wide "my issues"
|
|
73
|
+
* search (`GitHubApi.searchMyIssues`) never requested an order, so a direct caller omitting `sort` still gets
|
|
74
|
+
* GitHub's relevance order — the default is opt-in there, to keep that read's already-shipped results unchanged.
|
|
75
|
+
* The FACADE does apply it: GitHub declares `updated:desc` among its account-wide keys, so
|
|
76
|
+
* `readAccountWideIssuesPage` resolves the omission to this default and forwards it, and that read's emitted query
|
|
77
|
+
* gained a `sort:updated` qualifier it did not have before. A read whose surface cannot express even this key is
|
|
78
|
+
* the only one the facade leaves in the provider's own order.
|
|
79
|
+
*/
|
|
80
|
+
export const defaultIssueSort: IssueSorting = 'updated:desc';
|
|
81
|
+
|
|
28
82
|
/**
|
|
29
83
|
* What a filtered issue search narrows on: a provider-neutral criteria set, translated to each provider's own
|
|
30
84
|
* query language by its integration.
|
|
@@ -67,6 +121,19 @@ export interface IssueSearchCriteria {
|
|
|
67
121
|
withoutLinkedPullRequest?: boolean;
|
|
68
122
|
/** Includes issues in archived repositories, which are excluded by default. */
|
|
69
123
|
includeArchived?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* How to order the results. Omitted means `updated:desc`, which is what this search has always served.
|
|
126
|
+
*
|
|
127
|
+
* Validated like every other criterion — all-or-nothing against {@link IssueSearchCapabilities.sorts}: a key
|
|
128
|
+
* the provider can't express server-side refuses the WHOLE read rather than falling back to the default.
|
|
129
|
+
* Serving another order is not a smaller error than serving a wider result: combined with the provider's
|
|
130
|
+
* result ceiling it returns a different subset than was asked for, and the paging that comes with it describes
|
|
131
|
+
* that other subset.
|
|
132
|
+
*
|
|
133
|
+
* Do not change it mid-pagination. A cursor carries the sort it was produced under, and threading it under a
|
|
134
|
+
* different key is refused rather than serving a sequence with gaps and repeats: drop the cursor instead.
|
|
135
|
+
*/
|
|
136
|
+
sort?: IssueSorting;
|
|
70
137
|
}
|
|
71
138
|
|
|
72
139
|
/**
|
|
@@ -86,6 +153,12 @@ export interface IssueSearchCapabilities {
|
|
|
86
153
|
withoutLinkedPullRequest: boolean;
|
|
87
154
|
/** Whether {@link IssueSearchCriteria.state} can select anything other than the provider's default (open). */
|
|
88
155
|
states: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Sort keys the search can express IN SERVER. Always contains at least `updated:desc` — the historical default
|
|
158
|
+
* — when the search exists at all, so it is never empty for a usable surface; a provider without a filtered
|
|
159
|
+
* search reports an empty `relationships`, which is already the signal that there is no surface to order.
|
|
160
|
+
*/
|
|
161
|
+
sorts: IssueSorting[];
|
|
89
162
|
}
|
|
90
163
|
|
|
91
164
|
export interface IssueShape extends IssueOrPullRequest {
|
|
@@ -1,4 +1,94 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
Issue,
|
|
3
|
+
IssueRepositoryIdentityDescriptor,
|
|
4
|
+
IssueShape,
|
|
5
|
+
IssueSortField,
|
|
6
|
+
IssueSorting,
|
|
7
|
+
} from '../models/issue.js';
|
|
8
|
+
import { defaultIssueSort } from '../models/issue.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* How each sort field is read off an {@link IssueShape}, for the reads that MERGE several provider queries and so
|
|
12
|
+
* have to order the union themselves instead of letting the provider do it.
|
|
13
|
+
*
|
|
14
|
+
* Only the fields the shape actually carries appear. `priority`, `dueDate` and `resolved` are absent because
|
|
15
|
+
* `IssueOrPullRequest`/`IssueShape` doesn't model them: a provider may well order by them server-side on a
|
|
16
|
+
* single-query read, but a merged one cannot — which is exactly what {@link getIssueComparator} returning
|
|
17
|
+
* `undefined` lets its caller refuse, instead of concatenating unordered runs and calling them sorted.
|
|
18
|
+
*/
|
|
19
|
+
const issueSortValues: Partial<Record<IssueSortField, (issue: IssueShape) => number | Date | string | undefined>> = {
|
|
20
|
+
created: i => i.createdDate,
|
|
21
|
+
updated: i => i.updatedDate,
|
|
22
|
+
closed: i => i.closedDate,
|
|
23
|
+
comments: i => i.commentsCount,
|
|
24
|
+
reactions: i => i.thumbsUpCount,
|
|
25
|
+
title: i => i.title,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The order a read that ALWAYS orders is being made under: the caller's key, or the facade's default.
|
|
30
|
+
*
|
|
31
|
+
* The one place `?? defaultIssueSort` may be written. Several things downstream must agree on the answer — the
|
|
32
|
+
* emitted provider qualifier, the fingerprint sealed into a cursor, the comparator that re-sorts a merged page and
|
|
33
|
+
* the ceiling warning that names the order — and re-deriving the fallback at each is how they come to disagree,
|
|
34
|
+
* which is not cosmetic: a cursor sealed with a key its query wasn't built with makes the fingerprint check refuse
|
|
35
|
+
* valid resumptions.
|
|
36
|
+
*
|
|
37
|
+
* Note this is for a surface that CAN always order. A read whose provider may not express even the default resolves
|
|
38
|
+
* through `resolveIssueSort` instead, which can answer "leave the provider's own order".
|
|
39
|
+
*/
|
|
40
|
+
export function effectiveIssueSort(sort: IssueSorting | undefined): IssueSorting {
|
|
41
|
+
return sort ?? defaultIssueSort;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* A comparator for one sort key over normalized issues, or `undefined` when the field isn't derivable from an
|
|
46
|
+
* {@link IssueShape} — the signal that the key is only honorable on a SINGLE-origin read, where the provider
|
|
47
|
+
* already ordered the page.
|
|
48
|
+
*
|
|
49
|
+
* `@gitkraken/provider-apis` carries a twin of this over its own `Issue` shape (`src/issueSort.ts`), which it uses
|
|
50
|
+
* for the merges it performs itself. It is not importable — the SDK does not export it, and it takes a different
|
|
51
|
+
* shape — so the two are separate implementations of one rule, and the rule below is the part that must not drift.
|
|
52
|
+
*
|
|
53
|
+
* Missing values sort LAST in both directions. That is deliberately not the same as negating the descending
|
|
54
|
+
* comparator (which would float them to the front when ascending), and it is why they're partitioned before any
|
|
55
|
+
* arithmetic rather than mapped to an infinite sentinel: two missing values have to compare equal, and
|
|
56
|
+
* `-Infinity - -Infinity` is `NaN`, which makes the comparator inconsistent and the resulting order
|
|
57
|
+
* implementation-defined.
|
|
58
|
+
*
|
|
59
|
+
* Note it orders whatever it is handed. Sorting a page that was already capped does not make it the top N.
|
|
60
|
+
*
|
|
61
|
+
* KNOWN DIVERGENCE, `title` only: strings are compared by code unit, so `'B' < 'a'`. A single-scope read is
|
|
62
|
+
* ordered by the provider's own database instead — case-insensitive and accent-aware — so the same `title:asc`
|
|
63
|
+
* yields "Banana, apple, ábaco" from a merged page and "ábaco, apple, Banana" from one repository. Deliberately
|
|
64
|
+
* NOT fixed with `localeCompare`: the SDK's twin comparator (which performs the merges core doesn't, notably
|
|
65
|
+
* GitLab's repo-ids aggregate) compares by code unit, so switching here would make two paths of the SAME
|
|
66
|
+
* multi-repo read disagree — a worse divergence than the one it closes, and it would break the parity test in
|
|
67
|
+
* `issueSortCapabilities.test.ts`. Closing this properly means changing the rule on BOTH sides at once; until
|
|
68
|
+
* then it is a cosmetic ordering difference on one key, not wrong data.
|
|
69
|
+
*/
|
|
70
|
+
export function getIssueComparator(sort: IssueSorting): ((a: IssueShape, b: IssueShape) => number) | undefined {
|
|
71
|
+
// The union's shape guarantees both halves, so this needs no validation — only the cast tsc can't infer.
|
|
72
|
+
const [field, direction] = sort.split(':') as [IssueSortField, 'asc' | 'desc'];
|
|
73
|
+
const getValue = issueSortValues[field];
|
|
74
|
+
if (getValue == null) return undefined;
|
|
75
|
+
|
|
76
|
+
return (a, b) => {
|
|
77
|
+
const left = toComparable(getValue(a));
|
|
78
|
+
const right = toComparable(getValue(b));
|
|
79
|
+
if (left == null || right == null) {
|
|
80
|
+
if (left == null && right == null) return 0;
|
|
81
|
+
return left == null ? 1 : -1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const ordered = left < right ? -1 : left > right ? 1 : 0;
|
|
85
|
+
return direction === 'asc' ? ordered : -ordered;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function toComparable(value: number | Date | string | undefined): number | string | undefined {
|
|
90
|
+
return value instanceof Date ? value.getTime() : value;
|
|
91
|
+
}
|
|
2
92
|
|
|
3
93
|
export function getRepositoryIdentityForIssue(issue: IssueShape | Issue): IssueRepositoryIdentityDescriptor {
|
|
4
94
|
if (issue.repository == null) throw new Error('Missing repository');
|