@gitkraken/core-gitlens 0.53.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 +20 -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/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 +4 -4
- package/dist/plus/integrations/index.js +1 -1
- package/dist/plus/integrations/index.js.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +8 -7
- package/dist/plus/integrations/integrationService.js +11 -9
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +12 -7
- package/dist/plus/integrations/models/azurePullRequestWrites.d.ts +31 -8
- 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/writeIdentity.d.ts +9 -0
- package/dist/plus/integrations/providers/azure/writeIdentity.js +19 -1
- package/dist/plus/integrations/providers/azure/writeIdentity.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +1 -1
- package/dist/plus/integrations/providers/azureDevOps.js +1 -1
- package/dist/plus/integrations/providers/azureDevOpsServer.d.ts +4 -0
- package/dist/plus/integrations/providers/azureDevOpsServer.js +21 -8
- package/dist/plus/integrations/providers/azureDevOpsServer.js.map +1 -1
- package/dist/plus/integrations/providers/azurePullRequestWrites.d.ts +12 -4
- package/dist/plus/integrations/providers/azurePullRequestWrites.js +55 -11
- package/dist/plus/integrations/providers/azurePullRequestWrites.js.map +1 -1
- package/dist/plus/integrations/providers/azureWorkItemWrites.js +6 -15
- package/dist/plus/integrations/providers/azureWorkItemWrites.js.map +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/providers/providersApi.d.ts +16 -6
- package/dist/plus/integrations/providers/providersApi.js +43 -14
- package/dist/plus/integrations/providers/providersApi.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/resolveRepository.js +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/docs/integrations.md +102 -1
- package/package.json +1 -1
package/docs/integrations.md
CHANGED
|
@@ -353,6 +353,15 @@ drops them. Each target is judged by its own failure, so one target's rate limit
|
|
|
353
353
|
failed to answer. The cheap check counts toward its connection's failure budget only when the credential is
|
|
354
354
|
refused; any other failure of it is left to the full reads, so a call counts at most twice, once per full read.
|
|
355
355
|
|
|
356
|
+
The sweeps also take `etagIncludes`. With it, each row as complete as a `getPullRequestsBatch` row from the same
|
|
357
|
+
provider (judged by [field presence](#field-presence), with no `checkRuns` and the sweep's own `mergeQueue` selection)
|
|
358
|
+
carries the `etag` that read would compute with the same `etagIncludes`, so the first batch read of a pull request the
|
|
359
|
+
sweep just listed can answer `unchanged`. Only GitHub and GitHub Enterprise rows carry one, since elsewhere a sweep row
|
|
360
|
+
and a batch row come from different converters and their etags would never match. Of those, only an account-wide sweep
|
|
361
|
+
with `includeReviews` is that complete; a repo-scoped row has no reviews or review decision and carries none. An unknown include refuses the target. A
|
|
362
|
+
`getPullRequestsBatch` read with `checkRuns` never matches a sweep's etag (sweeps select no check runs), and a sweep seeds
|
|
363
|
+
only the batch reads with its own `mergeQueue` selection.
|
|
364
|
+
|
|
356
365
|
`getPullRequestsForBranches` answers "which pull requests have this branch as their head" without the user's
|
|
357
366
|
relationship to them, so unlike the sweeps it finds a teammate's pull request from the user's branch. A target names
|
|
358
367
|
the repository the pull requests are opened against, the branch's short name and, for a branch in a fork,
|
|
@@ -1161,6 +1170,75 @@ failure. Use the typed read to reconcile pending completion before publishing a
|
|
|
1161
1170
|
`outcome-unknown` means Core dispatched a write and could not confirm the result. For pending or
|
|
1162
1171
|
uncertain writes, reconcile with a read before attempting another write. Core sends each mutation once.
|
|
1163
1172
|
|
|
1173
|
+
### Azure DevOps Server pull request writes
|
|
1174
|
+
|
|
1175
|
+
The same three Azure PR methods accept an additive `AzureServerPullRequestWriteScope`, discriminated by
|
|
1176
|
+
`providerId: 'azure-devops-server'`. Existing Services inputs, including inputs without `providerId`,
|
|
1177
|
+
retain their behavior, and the existing option types keep their Services shape: Server inputs are typed
|
|
1178
|
+
`AzureServerPullRequestWriteScope`, `AzureServerPullRequestWriteTargetOptions` and
|
|
1179
|
+
`AzureServerPullRequestWriteOptions`. The Server scope reuses the installation and collection coordinates of
|
|
1180
|
+
`AzureServerWorkItemWriteScope` and adds `repository` (name or GUID):
|
|
1181
|
+
|
|
1182
|
+
```ts
|
|
1183
|
+
const scope = {
|
|
1184
|
+
providerId: GitSelfManagedHostIntegrationId.AzureDevOpsServer,
|
|
1185
|
+
connectionId,
|
|
1186
|
+
baseUrl, // The selected connection's configured installation or collection URL.
|
|
1187
|
+
collectionUrl, // The collection URL returned by listOrgs for that connection.
|
|
1188
|
+
organizationId, // The collection's connectionData.instanceId.
|
|
1189
|
+
organizationName, // The collection name, including spaces when present.
|
|
1190
|
+
projectId, // A project GUID, never an ambiguous project name.
|
|
1191
|
+
repository, // Name or GUID within that project.
|
|
1192
|
+
};
|
|
1193
|
+
const capability = await manager.getAzurePullRequestCreateCapability(scope);
|
|
1194
|
+
const target = await manager.resolveAzurePullRequestWriteTarget({ ...scope, number });
|
|
1195
|
+
```
|
|
1196
|
+
|
|
1197
|
+
Use the existing action fields with `writeAzurePullRequest`, replacing `repository` with the canonical
|
|
1198
|
+
`repositoryId` and setting `expectedAccountId` to the resolved collection's authenticated user ID.
|
|
1199
|
+
Server receipts retain the existing repository fields and add `repository.server` with `providerId`,
|
|
1200
|
+
`connectionId`, `baseUrl`, `collectionUrl` and `organizationId`. `repository.organization` is the collection
|
|
1201
|
+
name. Keep these coordinates and the canonical project/repository GUIDs across confirmation. A repository
|
|
1202
|
+
URL, including a project-less clone URL, is not a write address: resolve its collection and project through
|
|
1203
|
+
the selected connection first. Duplicate names in other projects, collections or installations cannot
|
|
1204
|
+
substitute for the approved GUIDs.
|
|
1205
|
+
|
|
1206
|
+
Core matches installation and collection URLs against the selected connection before using its PAT,
|
|
1207
|
+
then verifies collection `connectionData.instanceId`, collection name and authenticated user. It refuses
|
|
1208
|
+
Services hosts in Server scopes and sends requests only through that connection's collection address,
|
|
1209
|
+
with redirects disabled on identity, repository, PR, ref, policy and mutation requests. Both host-root
|
|
1210
|
+
installations and `/tfs` virtual directories are supported, including a connection configured at its
|
|
1211
|
+
collection URL. `domain` is only a fallback from trusted connection configuration, as for Server work
|
|
1212
|
+
items. Azure enforces code write permission at dispatch; capability discovery does not grant it.
|
|
1213
|
+
|
|
1214
|
+
| Server release | Negotiated PR REST API | Completion strategies before policy filtering | Completion request |
|
|
1215
|
+
| --------------------- | ---------------------- | -------------------------------------------------- | ---------------------------- |
|
|
1216
|
+
| TFS 2018 | 4.x | Unavailable | No mutation |
|
|
1217
|
+
| Server 2019 | 5.0 | `noFastForward`, `squash` | Legacy `squashMerge` boolean |
|
|
1218
|
+
| Server 2020 | 6.0 | `noFastForward`, `squash`, `rebase`, `rebaseMerge` | Explicit `mergeStrategy` |
|
|
1219
|
+
| Server 2022 and later | 7.0 (capped) | `noFastForward`, `squash`, `rebase`, `rebaseMerge` | Explicit `mergeStrategy` |
|
|
1220
|
+
|
|
1221
|
+
PR resource discovery negotiates the instance's released API and refuses resources below 5.0 or
|
|
1222
|
+
preview-only PR contracts. Create, edit, abandon and reactivate use that same negotiated version.
|
|
1223
|
+
The [Microsoft version mapping](https://learn.microsoft.com/en-us/azure/devops/integrate/concepts/rest-api-versioning)
|
|
1224
|
+
identifies the Server releases. The [5.0 update contract](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/update?view=azure-devops-rest-5.0)
|
|
1225
|
+
exposes `squashMerge`; the [6.0 update contract](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/update?view=azure-devops-rest-6.0)
|
|
1226
|
+
and [7.0 update contract](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/update?view=azure-devops-rest-7.0)
|
|
1227
|
+
expose `mergeStrategy` and both rebase modes. The API deliberately does not infer rebase support from a
|
|
1228
|
+
Server 2019 update level while using the 5.0 contract.
|
|
1229
|
+
|
|
1230
|
+
Server merge policies use the documented [scoped Git policy list API, 5.0-preview.1](https://learn.microsoft.com/en-us/rest/api/azure/devops/git/policy-configurations/list?view=azure-devops-rest-5.0),
|
|
1231
|
+
which accepts repository, target ref and policy type filters. Blocking policies intersect the available
|
|
1232
|
+
strategies, including legacy `useSquashMerge` settings. A policy read failure makes completion unavailable;
|
|
1233
|
+
it never enables all strategies. An unsupported version or unavailable PR resource prevents mutation.
|
|
1234
|
+
Provider validation, permission and policy failures remain typed failures, with no fallback write.
|
|
1235
|
+
|
|
1236
|
+
The Services completion invariants described above also apply to Server: approved source/target refs and
|
|
1237
|
+
SHAs are rechecked (`expectedTargetSha` is the live target ref tip, even when the Server merge preview
|
|
1238
|
+
reports an older `lastMergeTargetCommit`), policies are never bypassed, queued completion remains `pending`, and uncertain
|
|
1239
|
+
results remain `outcome-unknown` without retries. Azure does not offer an atomic target-tip or PR-revision
|
|
1240
|
+
guard. Consumers must reconcile pending or uncertain results with reads before proposing another write.
|
|
1241
|
+
|
|
1164
1242
|
### GitHub and GitHub Enterprise Server pull request writes
|
|
1165
1243
|
|
|
1166
1244
|
Use `providerId: 'github'` and the `connectionId` that read the repository or pull request. Pass the
|
|
@@ -1343,6 +1421,28 @@ Pass `cancellation` to abort the read: the request in flight, a retry waiting to
|
|
|
1343
1421
|
page-number walk still has to read. The read then rejects with a `CancellationError` rather than resolving, so a
|
|
1344
1422
|
cancelled read is never mistaken for a failed or an empty one.
|
|
1345
1423
|
|
|
1424
|
+
`criteria.changedSince` (GitHub/GHE only; check `pullRequestSearch.changedSince`) turns the search into a change
|
|
1425
|
+
feed. It takes a UTC timestamp, `YYYY-MM-DDTHH:MM:SSZ`, and returns pull requests in every state updated at or after
|
|
1426
|
+
it (and within `updatedAfter`, when both are set), oldest update first. It requires `states` omitted or `['all']`,
|
|
1427
|
+
`sort` omitted or `'updated:asc'`, and at most one relationship; anything else, or a malformed timestamp, is refused
|
|
1428
|
+
like any unsupported criterion. Every page of the walk also carries `openCount`: the number of open pull requests the
|
|
1429
|
+
same search with `states: ['open']` and no `changedSince` would report as its total. It is absent when the count
|
|
1430
|
+
couldn't be read.
|
|
1431
|
+
|
|
1432
|
+
To keep a list of open pull requests current with it:
|
|
1433
|
+
|
|
1434
|
+
- Advance your cursor to the newest `updatedDate` returned, minus a few minutes. Never use your local clock: the
|
|
1435
|
+
search index lags behind the pull requests it indexes. On a walk of more than one page, advance only to the newest
|
|
1436
|
+
`updatedDate` of the first page: GitHub's search cursors are positions, so a pull request updated mid-walk moves to
|
|
1437
|
+
the end and pushes a row back onto a page already read, and the next pass must read from before it.
|
|
1438
|
+
- Merge the returned rows into what you hold by number, and drop the ones no longer open.
|
|
1439
|
+
- Do a full read instead when `openCount` disagrees with the number of open rows you hold, when it is absent, or
|
|
1440
|
+
when the read was truncated. Above GitHub's 1,000-result search ceiling a full read can't reach `openCount`, so the
|
|
1441
|
+
count can't confirm such a list: narrow the scope.
|
|
1442
|
+
|
|
1443
|
+
It sees only what moves a pull request's update time. Checks, mergeability and a push to the base branch don't, so
|
|
1444
|
+
cover those with `getPullRequestsBatch` etags.
|
|
1445
|
+
|
|
1346
1446
|
### 5.1 The filtered issue search and its count probe
|
|
1347
1447
|
|
|
1348
1448
|
`searchIssuesPage` answers "every issue in this scope matching X", which no other issue read can: the
|
|
@@ -1798,7 +1898,8 @@ const filters = wanted.filter(f => capability.includes(f));
|
|
|
1798
1898
|
`relationships` and `states`, plus `text`, `updatedAfter`, `createdAfter`, `includeArchived`, `draft`,
|
|
1799
1899
|
`repositoryScope`, `organizationScope`, and `sorts` — the ordering vocabulary, as `field:direction` keys. A key
|
|
1800
1900
|
not in `sorts` refuses the whole read, exactly like an inexpressible filter; `updated:desc` is always in it when
|
|
1801
|
-
the search exists at all, so omitting `criteria.sort` never refuses.
|
|
1901
|
+
the search exists at all, so omitting `criteria.sort` never refuses. `changedSince` says whether
|
|
1902
|
+
`criteria.changedSince` and the `openCount` it returns are supported (GitHub/GHE only; see §5).
|
|
1802
1903
|
- `issues` — the **repo-scoped** git-host read, **and** the issue-tracker read
|
|
1803
1904
|
(`listIssueTrackerIssuesPage` validates against this field).
|
|
1804
1905
|
- `issuesAccountWide` — the account-wide git-host read only. Usually narrower (GitLab can express
|
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.
|
|
4
|
+
"version": "0.55.0",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "GitKraken",
|