@gitkraken/core-gitlens 0.5.113 → 0.5.115
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 +42 -1
- package/dist/git/cache.d.ts +4 -0
- package/dist/git/cache.d.ts.map +1 -1
- package/dist/git/cache.js +33 -0
- package/dist/git/cache.js.map +1 -1
- package/dist/git/context.d.ts +10 -0
- package/dist/git/context.d.ts.map +1 -1
- package/dist/git/context.js.map +1 -1
- package/dist/git/errors.d.ts +6 -3
- package/dist/git/errors.d.ts.map +1 -1
- package/dist/git/errors.js +9 -1
- package/dist/git/errors.js.map +1 -1
- package/dist/git/features.d.ts +1 -1
- package/dist/git/features.d.ts.map +1 -1
- package/dist/git/features.js +38 -0
- package/dist/git/features.js.map +1 -1
- package/dist/git/gitHealth.d.ts +153 -0
- package/dist/git/gitHealth.d.ts.map +1 -0
- package/dist/git/gitHealth.js +353 -0
- package/dist/git/gitHealth.js.map +1 -0
- package/dist/git/models/search.d.ts +6 -3
- package/dist/git/models/search.d.ts.map +1 -1
- package/dist/git/models/search.js +5 -1
- package/dist/git/models/search.js.map +1 -1
- package/dist/git/parsers/diffParser.d.ts +8 -2
- package/dist/git/parsers/diffParser.d.ts.map +1 -1
- package/dist/git/parsers/diffParser.js +27 -4
- package/dist/git/parsers/diffParser.js.map +1 -1
- package/dist/git/providers/config.d.ts +36 -3
- package/dist/git/providers/config.d.ts.map +1 -1
- package/dist/git/providers/graph.d.ts +9 -0
- package/dist/git/providers/graph.d.ts.map +1 -1
- package/dist/git/providers/maintenance.d.ts +222 -0
- package/dist/git/providers/maintenance.d.ts.map +1 -0
- package/dist/git/providers/maintenance.js +20 -0
- package/dist/git/providers/maintenance.js.map +1 -0
- package/dist/git/providers/operations.d.ts +10 -0
- package/dist/git/providers/operations.d.ts.map +1 -1
- package/dist/git/providers/pausedOperations.d.ts +3 -0
- package/dist/git/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git/providers/provider.d.ts +2 -0
- package/dist/git/providers/provider.d.ts.map +1 -1
- package/dist/git/providers/tags.d.ts +3 -0
- package/dist/git/providers/tags.d.ts.map +1 -1
- package/dist/git/repositoryService.d.ts +1 -0
- package/dist/git/repositoryService.d.ts.map +1 -1
- package/dist/git/repositoryService.js.map +1 -1
- package/dist/git/run.types.d.ts +8 -0
- package/dist/git/run.types.d.ts.map +1 -1
- package/dist/git/service.js +3 -0
- package/dist/git/service.js.map +1 -1
- package/dist/git/utils/search.utils.d.ts.map +1 -1
- package/dist/git/utils/search.utils.js +112 -5
- package/dist/git/utils/search.utils.js.map +1 -1
- package/dist/git/watching/watchService.d.ts +3 -0
- package/dist/git/watching/watchService.d.ts.map +1 -1
- package/dist/git/watching/watchService.js +8 -0
- package/dist/git/watching/watchService.js.map +1 -1
- package/dist/git-cli/cliGitProvider.d.ts +11 -0
- package/dist/git-cli/cliGitProvider.d.ts.map +1 -1
- package/dist/git-cli/cliGitProvider.js +12 -0
- package/dist/git-cli/cliGitProvider.js.map +1 -1
- package/dist/git-cli/exec/git.d.ts +23 -1
- package/dist/git-cli/exec/git.d.ts.map +1 -1
- package/dist/git-cli/exec/git.js +83 -8
- package/dist/git-cli/exec/git.js.map +1 -1
- package/dist/git-cli/exec/gitQueue.d.ts +2 -0
- package/dist/git-cli/exec/gitQueue.d.ts.map +1 -1
- package/dist/git-cli/exec/gitQueue.js +19 -17
- package/dist/git-cli/exec/gitQueue.js.map +1 -1
- package/dist/git-cli/parsers/logParser.d.ts.map +1 -1
- package/dist/git-cli/parsers/logParser.js +4 -1
- package/dist/git-cli/parsers/logParser.js.map +1 -1
- package/dist/git-cli/providers/blame.d.ts.map +1 -1
- package/dist/git-cli/providers/blame.js +4 -7
- package/dist/git-cli/providers/blame.js.map +1 -1
- package/dist/git-cli/providers/branches.d.ts.map +1 -1
- package/dist/git-cli/providers/branches.js +13 -3
- package/dist/git-cli/providers/branches.js.map +1 -1
- package/dist/git-cli/providers/commits.d.ts.map +1 -1
- package/dist/git-cli/providers/commits.js +34 -3
- package/dist/git-cli/providers/commits.js.map +1 -1
- package/dist/git-cli/providers/config.d.ts +27 -0
- package/dist/git-cli/providers/config.d.ts.map +1 -1
- package/dist/git-cli/providers/config.js +31 -6
- package/dist/git-cli/providers/config.js.map +1 -1
- package/dist/git-cli/providers/graph.d.ts +8 -0
- package/dist/git-cli/providers/graph.d.ts.map +1 -1
- package/dist/git-cli/providers/graph.js +85 -6
- package/dist/git-cli/providers/graph.js.map +1 -1
- package/dist/git-cli/providers/maintenance.d.ts +306 -0
- package/dist/git-cli/providers/maintenance.d.ts.map +1 -0
- package/dist/git-cli/providers/maintenance.js +2129 -0
- package/dist/git-cli/providers/maintenance.js.map +1 -0
- package/dist/git-cli/providers/operations.d.ts +1 -0
- package/dist/git-cli/providers/operations.d.ts.map +1 -1
- package/dist/git-cli/providers/operations.js +8 -0
- package/dist/git-cli/providers/operations.js.map +1 -1
- package/dist/git-cli/providers/pausedOperations.d.ts +1 -0
- package/dist/git-cli/providers/pausedOperations.d.ts.map +1 -1
- package/dist/git-cli/providers/pausedOperations.js +1 -1
- package/dist/git-cli/providers/pausedOperations.js.map +1 -1
- package/dist/git-cli/providers/tags.d.ts +3 -0
- package/dist/git-cli/providers/tags.d.ts.map +1 -1
- package/dist/git-cli/providers/tags.js +23 -1
- package/dist/git-cli/providers/tags.js.map +1 -1
- package/dist/plus/agents/agentCapabilities.d.ts +77 -0
- package/dist/plus/agents/agentCapabilities.d.ts.map +1 -0
- package/dist/plus/agents/agentCapabilities.js +197 -0
- package/dist/plus/agents/agentCapabilities.js.map +1 -0
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts +77 -13
- package/dist/plus/agents/providers/claudeCodeTranscript.d.ts.map +1 -1
- package/dist/plus/agents/providers/claudeCodeTranscript.js +263 -55
- package/dist/plus/agents/providers/claudeCodeTranscript.js.map +1 -1
- package/dist/plus/agents/providers/{claudeCodeProvider.d.ts → gkAgentProvider.d.ts} +52 -19
- package/dist/plus/agents/providers/gkAgentProvider.d.ts.map +1 -0
- package/dist/plus/agents/providers/{claudeCodeProvider.js → gkAgentProvider.js} +935 -262
- package/dist/plus/agents/providers/gkAgentProvider.js.map +1 -0
- package/dist/plus/agents/types.d.ts +113 -35
- package/dist/plus/agents/types.d.ts.map +1 -1
- package/dist/plus/agents/types.js +7 -4
- package/dist/plus/agents/types.js.map +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts +1 -1
- package/dist/plus/ai/models/promptTemplates.d.ts.map +1 -1
- package/dist/plus/ai/prompts.d.ts +4 -0
- package/dist/plus/ai/prompts.d.ts.map +1 -1
- package/dist/plus/ai/prompts.js +59 -4
- package/dist/plus/ai/prompts.js.map +1 -1
- package/dist/plus/git-github/api/github.d.ts +44 -1
- package/dist/plus/git-github/api/github.d.ts.map +1 -1
- package/dist/plus/git-github/api/github.js +355 -62
- package/dist/plus/git-github/api/github.js.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.d.ts +13 -0
- package/dist/plus/git-github/api/issueSearchQuery.d.ts.map +1 -1
- package/dist/plus/git-github/api/issueSearchQuery.js +41 -0
- package/dist/plus/git-github/api/issueSearchQuery.js.map +1 -1
- package/dist/plus/git-github/providers/github/blame.d.ts.map +1 -1
- package/dist/plus/git-github/providers/github/blame.js +2 -1
- package/dist/plus/git-github/providers/github/blame.js.map +1 -1
- package/dist/plus/integrations/collectionMetadata.d.ts +2 -0
- package/dist/plus/integrations/collectionMetadata.d.ts.map +1 -1
- package/dist/plus/integrations/collectionMetadata.js +17 -1
- package/dist/plus/integrations/collectionMetadata.js.map +1 -1
- package/dist/plus/integrations/context.d.ts +4 -1
- package/dist/plus/integrations/context.d.ts.map +1 -1
- package/dist/plus/integrations/index.d.ts +1 -0
- package/dist/plus/integrations/index.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.d.ts +20 -1
- package/dist/plus/integrations/integrationService.d.ts.map +1 -1
- package/dist/plus/integrations/integrationService.js +12 -4
- package/dist/plus/integrations/integrationService.js.map +1 -1
- package/dist/plus/integrations/manager.d.ts +48 -0
- package/dist/plus/integrations/manager.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.d.ts +53 -26
- package/dist/plus/integrations/models/gitHostIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/gitHostIntegration.js +123 -47
- package/dist/plus/integrations/models/gitHostIntegration.js.map +1 -1
- package/dist/plus/integrations/models/integration.d.ts +10 -1
- package/dist/plus/integrations/models/integration.d.ts.map +1 -1
- package/dist/plus/integrations/models/integration.js +52 -19
- package/dist/plus/integrations/models/integration.js.map +1 -1
- package/dist/plus/integrations/models/issueCache.d.ts +16 -0
- package/dist/plus/integrations/models/issueCache.d.ts.map +1 -0
- package/dist/plus/integrations/models/issueCache.js +9 -0
- package/dist/plus/integrations/models/issueCache.js.map +1 -0
- package/dist/plus/integrations/models/issueReads.d.ts +13 -0
- package/dist/plus/integrations/models/issueReads.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.d.ts +11 -13
- package/dist/plus/integrations/models/issuesIntegration.d.ts.map +1 -1
- package/dist/plus/integrations/models/issuesIntegration.js +15 -1
- package/dist/plus/integrations/models/issuesIntegration.js.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.d.ts +3 -5
- package/dist/plus/integrations/providers/azureDevOps.d.ts.map +1 -1
- package/dist/plus/integrations/providers/azureDevOps.js +9 -8
- package/dist/plus/integrations/providers/azureDevOps.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.d.ts +3 -5
- package/dist/plus/integrations/providers/bitbucket-server.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket-server.js +2 -2
- package/dist/plus/integrations/providers/bitbucket-server.js.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.d.ts +3 -5
- package/dist/plus/integrations/providers/bitbucket.d.ts.map +1 -1
- package/dist/plus/integrations/providers/bitbucket.js +2 -1
- package/dist/plus/integrations/providers/bitbucket.js.map +1 -1
- package/dist/plus/integrations/providers/github.d.ts +12 -5
- package/dist/plus/integrations/providers/github.d.ts.map +1 -1
- package/dist/plus/integrations/providers/github.js +10 -3
- package/dist/plus/integrations/providers/github.js.map +1 -1
- package/dist/plus/integrations/providers/gitlab.d.ts +3 -5
- package/dist/plus/integrations/providers/gitlab.d.ts.map +1 -1
- package/dist/plus/integrations/providers/gitlab.js +2 -2
- package/dist/plus/integrations/providers/gitlab.js.map +1 -1
- package/dist/plus/integrations/providers/jira.d.ts +3 -7
- package/dist/plus/integrations/providers/jira.d.ts.map +1 -1
- package/dist/plus/integrations/providers/jira.js +35 -22
- package/dist/plus/integrations/providers/jira.js.map +1 -1
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts +7 -0
- package/dist/plus/integrations/providers/jiraIssueByKey.d.ts.map +1 -0
- package/dist/plus/integrations/providers/jiraIssueByKey.js +102 -0
- package/dist/plus/integrations/providers/jiraIssueByKey.js.map +1 -0
- package/dist/plus/integrations/providers/linear.d.ts +3 -7
- package/dist/plus/integrations/providers/linear.d.ts.map +1 -1
- package/dist/plus/integrations/providers/linear.js +23 -22
- package/dist/plus/integrations/providers/linear.js.map +1 -1
- package/dist/plus/integrations/providers/models.d.ts +3 -1
- package/dist/plus/integrations/providers/models.d.ts.map +1 -1
- package/dist/plus/integrations/providers/models.js +10 -4
- package/dist/plus/integrations/providers/models.js.map +1 -1
- package/dist/plus/integrations/providers/providerErrors.d.ts +7 -0
- package/dist/plus/integrations/providers/providerErrors.d.ts.map +1 -0
- package/dist/plus/integrations/providers/providerErrors.js +91 -0
- package/dist/plus/integrations/providers/providerErrors.js.map +1 -0
- package/dist/plus/integrations/providers/providersApi.d.ts +3 -2
- package/dist/plus/integrations/providers/providersApi.d.ts.map +1 -1
- package/dist/plus/integrations/providers/providersApi.js +18 -52
- package/dist/plus/integrations/providers/providersApi.js.map +1 -1
- package/dist/plus/integrations/providers/trello.d.ts +2 -7
- package/dist/plus/integrations/providers/trello.d.ts.map +1 -1
- package/dist/plus/integrations/providers/trello.js +3 -1
- package/dist/plus/integrations/providers/trello.js.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts +2 -0
- package/dist/plus/integrations/providers/utils/providerPaging.d.ts.map +1 -1
- package/dist/plus/integrations/providers/utils/providerPaging.js +12 -7
- package/dist/plus/integrations/providers/utils/providerPaging.js.map +1 -1
- package/dist/plus/integrations/reads/broaden.d.ts +47 -10
- package/dist/plus/integrations/reads/broaden.d.ts.map +1 -1
- package/dist/plus/integrations/reads/broaden.js +144 -33
- package/dist/plus/integrations/reads/broaden.js.map +1 -1
- package/dist/plus/integrations/reads/filters.d.ts +18 -0
- package/dist/plus/integrations/reads/filters.d.ts.map +1 -1
- package/dist/plus/integrations/reads/filters.js +37 -1
- package/dist/plus/integrations/reads/filters.js.map +1 -1
- package/dist/plus/integrations/reads/issueBatch.d.ts +51 -0
- package/dist/plus/integrations/reads/issueBatch.d.ts.map +1 -0
- package/dist/plus/integrations/reads/issueBatch.js +91 -0
- package/dist/plus/integrations/reads/issueBatch.js.map +1 -0
- package/dist/plus/integrations/reads/issueTracker.d.ts.map +1 -1
- package/dist/plus/integrations/reads/issueTracker.js +23 -17
- package/dist/plus/integrations/reads/issueTracker.js.map +1 -1
- package/dist/plus/integrations/reads/sweeps.d.ts.map +1 -1
- package/dist/plus/integrations/reads/sweeps.js +5 -3
- package/dist/plus/integrations/reads/sweeps.js.map +1 -1
- package/dist/plus/integrations/reads/trackerIssue.d.ts +21 -0
- package/dist/plus/integrations/reads/trackerIssue.d.ts.map +1 -0
- package/dist/plus/integrations/reads/trackerIssue.js +51 -0
- package/dist/plus/integrations/reads/trackerIssue.js.map +1 -0
- package/dist/plus/integrations/reads/warnings.d.ts +2 -15
- package/dist/plus/integrations/reads/warnings.d.ts.map +1 -1
- package/dist/plus/integrations/reads/warnings.js +19 -1
- package/dist/plus/integrations/reads/warnings.js.map +1 -1
- package/dist/plus/integrations/results.d.ts +4 -20
- package/dist/plus/integrations/results.d.ts.map +1 -1
- package/dist/plus/integrations/results.js.map +1 -1
- package/dist/utils/promise.d.ts +2 -0
- package/dist/utils/promise.d.ts.map +1 -1
- package/dist/utils/promise.js +11 -0
- package/dist/utils/promise.js.map +1 -1
- package/dist/utils/promiseCache.d.ts +19 -0
- package/dist/utils/promiseCache.d.ts.map +1 -1
- package/dist/utils/promiseCache.js +30 -0
- package/dist/utils/promiseCache.js.map +1 -1
- package/dist/utils/resourceUsage.d.ts +5 -0
- package/dist/utils/resourceUsage.d.ts.map +1 -0
- package/dist/utils/resourceUsage.js +2 -0
- package/dist/utils/resourceUsage.js.map +1 -0
- package/dist/utils/string.d.ts +12 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +36 -1
- package/dist/utils/string.js.map +1 -1
- package/docs/integrations.md +48 -33
- package/docs/kepler-read-api-parity.md +25 -4
- package/package.json +12 -4
- package/src/git/cache.ts +36 -0
- package/src/git/context.ts +11 -0
- package/src/git/errors.ts +13 -1
- package/src/git/features.ts +51 -0
- package/src/git/gitHealth.ts +522 -0
- package/src/git/models/search.ts +19 -4
- package/src/git/parsers/diffParser.ts +27 -4
- package/src/git/providers/config.ts +42 -1
- package/src/git/providers/graph.ts +12 -0
- package/src/git/providers/maintenance.ts +224 -0
- package/src/git/providers/operations.ts +10 -0
- package/src/git/providers/pausedOperations.ts +3 -0
- package/src/git/providers/provider.ts +2 -0
- package/src/git/providers/tags.ts +1 -0
- package/src/git/repositoryService.ts +1 -0
- package/src/git/run.types.ts +8 -0
- package/src/git/service.ts +3 -0
- package/src/git/utils/search.utils.ts +129 -5
- package/src/git/watching/watchService.ts +10 -0
- package/src/git-cli/cliGitProvider.ts +25 -0
- package/src/git-cli/exec/git.ts +120 -6
- package/src/git-cli/exec/gitQueue.ts +19 -17
- package/src/git-cli/parsers/logParser.ts +4 -1
- package/src/git-cli/providers/blame.ts +3 -8
- package/src/git-cli/providers/branches.ts +28 -8
- package/src/git-cli/providers/commits.ts +34 -2
- package/src/git-cli/providers/config.ts +38 -6
- package/src/git-cli/providers/graph.ts +107 -7
- package/src/git-cli/providers/maintenance.ts +2599 -0
- package/src/git-cli/providers/operations.ts +11 -0
- package/src/git-cli/providers/pausedOperations.ts +7 -2
- package/src/git-cli/providers/tags.ts +36 -1
- package/src/plus/agents/agentCapabilities.ts +286 -0
- package/src/plus/agents/providers/claudeCodeTranscript.ts +313 -58
- package/src/plus/agents/providers/{claudeCodeProvider.ts → gkAgentProvider.ts} +1123 -277
- package/src/plus/agents/types.ts +137 -40
- package/src/plus/ai/models/promptTemplates.ts +1 -1
- package/src/plus/ai/prompts.ts +62 -4
- package/src/plus/git-github/api/github.ts +404 -82
- package/src/plus/git-github/api/issueSearchQuery.ts +49 -1
- package/src/plus/git-github/providers/github/blame.ts +2 -1
- package/src/plus/integrations/collectionMetadata.ts +23 -1
- package/src/plus/integrations/context.ts +1 -1
- package/src/plus/integrations/index.ts +1 -0
- package/src/plus/integrations/integrationService.ts +29 -4
- package/src/plus/integrations/manager.ts +48 -0
- package/src/plus/integrations/models/gitHostIntegration.ts +165 -129
- package/src/plus/integrations/models/integration.ts +57 -22
- package/src/plus/integrations/models/issueCache.ts +29 -0
- package/src/plus/integrations/models/issueReads.ts +15 -0
- package/src/plus/integrations/models/issuesIntegration.ts +38 -8
- package/src/plus/integrations/providers/azureDevOps.ts +16 -13
- package/src/plus/integrations/providers/bitbucket-server.ts +4 -6
- package/src/plus/integrations/providers/bitbucket.ts +3 -4
- package/src/plus/integrations/providers/github.ts +23 -7
- package/src/plus/integrations/providers/gitlab.ts +4 -6
- package/src/plus/integrations/providers/jira.ts +52 -26
- package/src/plus/integrations/providers/jiraIssueByKey.ts +155 -0
- package/src/plus/integrations/providers/linear.ts +38 -25
- package/src/plus/integrations/providers/models.ts +17 -5
- package/src/plus/integrations/providers/providerErrors.ts +115 -0
- package/src/plus/integrations/providers/providersApi.ts +26 -68
- package/src/plus/integrations/providers/trello.ts +5 -4
- package/src/plus/integrations/providers/utils/providerPaging.ts +14 -7
- package/src/plus/integrations/reads/broaden.ts +282 -70
- package/src/plus/integrations/reads/filters.ts +39 -1
- package/src/plus/integrations/reads/issueBatch.ts +197 -0
- package/src/plus/integrations/reads/issueTracker.ts +26 -24
- package/src/plus/integrations/reads/sweeps.ts +19 -12
- package/src/plus/integrations/reads/trackerIssue.ts +105 -0
- package/src/plus/integrations/reads/warnings.ts +23 -17
- package/src/plus/integrations/results.ts +4 -20
- package/src/utils/promise.ts +15 -0
- package/src/utils/promiseCache.ts +43 -0
- package/src/utils/resourceUsage.ts +5 -0
- package/src/utils/string.ts +38 -1
- package/dist/plus/agents/providers/claudeCodeProvider.d.ts.map +0 -1
- package/dist/plus/agents/providers/claudeCodeProvider.js.map +0 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
IssueSearchCriteria,
|
|
3
|
+
IssueSearchRelationship,
|
|
4
|
+
IssueSortField,
|
|
5
|
+
IssueSorting,
|
|
6
|
+
} from '../../../git/models/issue.js';
|
|
2
7
|
|
|
3
8
|
/**
|
|
4
9
|
* Translation of the provider-neutral issue-search criteria into GitHub search qualifiers, and the sanitizing
|
|
@@ -120,6 +125,49 @@ export function toGitHubIssueSortQualifier(sort: IssueSorting | undefined): stri
|
|
|
120
125
|
return sort != null ? gitHubIssueSortQualifiers[sort] : undefined;
|
|
121
126
|
}
|
|
122
127
|
|
|
128
|
+
/**
|
|
129
|
+
* The sort keys a CEILING SLIDE can continue past, and the qualifier each one continues with.
|
|
130
|
+
*
|
|
131
|
+
* The slide works by re-issuing the search bounded to the far side of what has already been served, which needs
|
|
132
|
+
* two things from the sort key: a value carried on the returned issue (so the boundary can be read off the last
|
|
133
|
+
* item), and a GitHub range qualifier over that same value (so the continuation can be expressed). Only the two
|
|
134
|
+
* date keys have both. `comments`/`reactions` have range qualifiers but their values are unstable under
|
|
135
|
+
* concurrent activity — a comment added mid-walk moves an issue across the boundary, which would drop or repeat
|
|
136
|
+
* it — and `title` has no range qualifier at all. Those keep reporting the ceiling instead, which is correct
|
|
137
|
+
* rather than a gap: the read stays truthful about what it could not reach.
|
|
138
|
+
*
|
|
139
|
+
* A `Partial<Record<…>>` over the union rather than a lookup with a default, so a sort key added later is
|
|
140
|
+
* NOT-slidable by construction and has to be opted in deliberately.
|
|
141
|
+
*/
|
|
142
|
+
const gitHubSlidableSortFields: Partial<Record<IssueSortField, string>> = {
|
|
143
|
+
created: 'created',
|
|
144
|
+
updated: 'updated',
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The qualifier that continues a search past the provider's result ceiling: everything at or beyond the last
|
|
149
|
+
* item already served, under the same key the search is ordered by.
|
|
150
|
+
*
|
|
151
|
+
* INCLUSIVE (`<=` / `>=`) rather than exclusive, and that is a correctness requirement rather than a preference.
|
|
152
|
+
* GitHub timestamps have one-second resolution and ties genuinely occur (measured: one shared second in a
|
|
153
|
+
* 100-issue sample), so an exclusive bound would silently drop every issue sharing the boundary second with the
|
|
154
|
+
* last one served. Being inclusive re-serves that second instead, which the caller dedupes.
|
|
155
|
+
*
|
|
156
|
+
* Returns `undefined` when the key can't be slid ({@link gitHubSlidableSortFields}), which is the signal to
|
|
157
|
+
* report the ceiling rather than to continue.
|
|
158
|
+
*/
|
|
159
|
+
export function toGitHubIssueSearchSlideQualifier(sort: IssueSorting, boundary: Date): string | undefined {
|
|
160
|
+
const [field, direction] = sort.split(':') as [IssueSortField, 'asc' | 'desc'];
|
|
161
|
+
const qualifier = gitHubSlidableSortFields[field];
|
|
162
|
+
if (qualifier == null) return undefined;
|
|
163
|
+
|
|
164
|
+
// Whole seconds, matching both GitHub's own resolution and what its range qualifiers accept.
|
|
165
|
+
const value = boundary.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
166
|
+
// Descending walks toward older, so the remainder is everything at or BEFORE the boundary; ascending is the
|
|
167
|
+
// mirror. Getting this backwards would re-request the half already served, forever.
|
|
168
|
+
return `${qualifier}:${direction === 'desc' ? '<=' : '>='}${value}`;
|
|
169
|
+
}
|
|
170
|
+
|
|
123
171
|
/**
|
|
124
172
|
* The scope half of an issue search query: `org:` plus one `repo:` per repository.
|
|
125
173
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Cache } from '../../../../git/cache.js';
|
|
2
|
+
import { shouldEvictBlameCacheEntry } from '../../../../git/cache.js';
|
|
2
3
|
import type { GitBlame, GitBlameAuthor, ProgressiveGitBlame } from '../../../../git/models/blame.js';
|
|
3
4
|
import type { GitCommitLine } from '../../../../git/models/commit.js';
|
|
4
5
|
import { GitCommit, GitCommitIdentity } from '../../../../git/models/commit.js';
|
|
@@ -48,7 +49,7 @@ export class BlameGitHubSubProvider implements GitBlameSubProvider {
|
|
|
48
49
|
|
|
49
50
|
return createCompletedBlame(blame);
|
|
50
51
|
},
|
|
51
|
-
{ errorTTL: 1000 * 60 },
|
|
52
|
+
{ errorTTL: 1000 * 60, evictWhen: shouldEvictBlameCacheEntry },
|
|
52
53
|
);
|
|
53
54
|
return progressive?.completed;
|
|
54
55
|
}
|
|
@@ -7,7 +7,13 @@ import type {
|
|
|
7
7
|
// Matched by its `code` discriminator rather than by `instanceof`: the SDK ships one bundle per entry point, so
|
|
8
8
|
// the class reached through the root is not the same object as the one reached through `/providers`.
|
|
9
9
|
import { isInvalidRequestError, isUnsupportedSortError } from '@gitkraken/provider-apis';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
AuthenticationError,
|
|
12
|
+
RequestClientError,
|
|
13
|
+
RequestNotFoundError,
|
|
14
|
+
RequestRateLimitError,
|
|
15
|
+
} from '../../git/errors.js';
|
|
16
|
+
import type { TokenWithInfo } from './authentication/models.js';
|
|
11
17
|
import type { IntegrationIds } from './constants.js';
|
|
12
18
|
import { isRateLimitResponse } from './errors.js';
|
|
13
19
|
import type { ProviderWarning, ProviderWarningOmission } from './results.js';
|
|
@@ -97,6 +103,22 @@ function toCollectionFailureWarningKind(failure: CollectionScopeFailure): Provid
|
|
|
97
103
|
}
|
|
98
104
|
}
|
|
99
105
|
|
|
106
|
+
export function toCollectionFailureError(failure: CollectionScopeFailure, tokenWithInfo: TokenWithInfo): Error {
|
|
107
|
+
const error = new Error(failure.message ?? 'Provider request failed');
|
|
108
|
+
const kind = toCollectionFailureWarningKind(failure);
|
|
109
|
+
const { accessToken, ...tokenInfo } = tokenWithInfo;
|
|
110
|
+
if (kind === 'auth') return new AuthenticationError(tokenInfo, error.message, error);
|
|
111
|
+
if (kind === 'rate-limit') return new RequestRateLimitError(error, accessToken, undefined);
|
|
112
|
+
if (kind === 'not-found') return new RequestNotFoundError(error);
|
|
113
|
+
|
|
114
|
+
const status = getCollectionFailureStatus(failure.message);
|
|
115
|
+
if (kind === 'other' && status != null && status >= 400 && status < 500) {
|
|
116
|
+
return new RequestClientError(error);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return error;
|
|
120
|
+
}
|
|
121
|
+
|
|
100
122
|
/** ` (resource r, project p, repository o/n)` for the scope IDs present; empty when the scope names none. */
|
|
101
123
|
function collectionScopeText(scope: CollectionScope | undefined): string {
|
|
102
124
|
const parts: string[] = [];
|
|
@@ -148,7 +148,7 @@ export interface IntegrationCacheProvider {
|
|
|
148
148
|
resource: ResourceDescriptor,
|
|
149
149
|
integration: IntegrationBase | undefined,
|
|
150
150
|
cacheable: Cacheable<Issue>,
|
|
151
|
-
options?: CacheExpiryOptions,
|
|
151
|
+
options?: CacheExpiryOptions & { connectionId?: string; etag?: string },
|
|
152
152
|
): CacheResult<Issue>;
|
|
153
153
|
getCurrentAccount(
|
|
154
154
|
integration: IntegrationBase,
|
|
@@ -225,6 +225,7 @@ export type { IssueSearchCapabilities, IssueSearchCriteria, IssueSearchRelations
|
|
|
225
225
|
export type { PullRequestSearchCapabilities, PullRequestSearchCriteria } from './providerFilters.js';
|
|
226
226
|
// The count-only issue probe's input and result shapes.
|
|
227
227
|
export type { IssueCountResult, IssueCountScope } from './reads/counts.js';
|
|
228
|
+
export type { TrackerIssueResult } from './reads/trackerIssue.js';
|
|
228
229
|
// Cross-provider PR/issue state filters (string unions in the git models).
|
|
229
230
|
export type { PullRequestStateFilter } from '../../git/models/pullRequest.js';
|
|
230
231
|
export type { IssueStateFilter } from '../../git/models/issue.js';
|
|
@@ -87,6 +87,8 @@ import { countIssues, countPullRequests } from './reads/counts.js';
|
|
|
87
87
|
import type { SupportedFilters } from './reads/filters.js';
|
|
88
88
|
import { getSupportedFilters } from './reads/filters.js';
|
|
89
89
|
import { listOrgs, listProjects, listRepos } from './reads/hierarchy.js';
|
|
90
|
+
import type { IssueBatchResult, IssueBatchTarget } from './reads/issueBatch.js';
|
|
91
|
+
import { getIssuesBatch } from './reads/issueBatch.js';
|
|
90
92
|
import { listIssuesPage } from './reads/issues.js';
|
|
91
93
|
import { listIssueTrackerIssuesPage } from './reads/issueTracker.js';
|
|
92
94
|
import { listPullRequestsPage } from './reads/pullRequests.js';
|
|
@@ -94,6 +96,8 @@ import { resolveRepository } from './reads/resolveRepository.js';
|
|
|
94
96
|
import { searchIssuesPage } from './reads/searchIssues.js';
|
|
95
97
|
import { searchPullRequestsPage } from './reads/searchPullRequests.js';
|
|
96
98
|
import { sweepClosedPullRequests, sweepPullRequests } from './reads/sweeps.js';
|
|
99
|
+
import type { TrackerIssueResult } from './reads/trackerIssue.js';
|
|
100
|
+
import { getTrackerIssue } from './reads/trackerIssue.js';
|
|
97
101
|
import { noConnectionWarning } from './reads/warnings.js';
|
|
98
102
|
import type {
|
|
99
103
|
ConnectionStateChangeEvent,
|
|
@@ -745,7 +749,6 @@ export class IntegrationService implements Disposable, RepositoryResolutionConte
|
|
|
745
749
|
async getMyPullRequests(
|
|
746
750
|
integrationIds?: (GitCloudHostIntegrationId | CloudGitSelfManagedHostIntegrationIds)[],
|
|
747
751
|
cancellation?: AbortSignal,
|
|
748
|
-
silent?: boolean,
|
|
749
752
|
options?: SearchMyPullRequestsOptions,
|
|
750
753
|
): Promise<IntegrationResult<PullRequest[] | undefined>> {
|
|
751
754
|
const integrations: Map<GitHostIntegration, ResourceDescriptor[] | undefined> = new Map();
|
|
@@ -762,13 +765,12 @@ export class IntegrationService implements Disposable, RepositoryResolutionConte
|
|
|
762
765
|
}
|
|
763
766
|
if (integrations.size === 0) return undefined;
|
|
764
767
|
|
|
765
|
-
return this.getMyPullRequestsCore(integrations, cancellation,
|
|
768
|
+
return this.getMyPullRequestsCore(integrations, cancellation, options);
|
|
766
769
|
}
|
|
767
770
|
|
|
768
771
|
private async getMyPullRequestsCore(
|
|
769
772
|
integrations: Map<GitHostIntegration, ResourceDescriptor[] | undefined>,
|
|
770
773
|
cancellation?: AbortSignal,
|
|
771
|
-
silent?: boolean,
|
|
772
774
|
options?: SearchMyPullRequestsOptions,
|
|
773
775
|
): Promise<IntegrationResult<PullRequest[] | undefined>> {
|
|
774
776
|
const start = performance.now();
|
|
@@ -777,7 +779,7 @@ export class IntegrationService implements Disposable, RepositoryResolutionConte
|
|
|
777
779
|
for (const [integration, repos] of integrations) {
|
|
778
780
|
if (integration == null) continue;
|
|
779
781
|
|
|
780
|
-
promises.push(integration.searchMyPullRequests(repos, cancellation,
|
|
782
|
+
promises.push(integration.searchMyPullRequests(repos, cancellation, options));
|
|
781
783
|
}
|
|
782
784
|
|
|
783
785
|
const results = await Promise.allSettled(promises);
|
|
@@ -1156,6 +1158,29 @@ export class IntegrationService implements Disposable, RepositoryResolutionConte
|
|
|
1156
1158
|
return countIssues(this, options);
|
|
1157
1159
|
}
|
|
1158
1160
|
|
|
1161
|
+
async getIssuesBatch(options: {
|
|
1162
|
+
providerId: IntegrationIds;
|
|
1163
|
+
targets: readonly IssueBatchTarget[];
|
|
1164
|
+
connectionId?: string;
|
|
1165
|
+
/**
|
|
1166
|
+
* Explicit self-managed host domain. Used only when the requested connection has no configured domain;
|
|
1167
|
+
* it must come from the trusted authentication configuration, not repository or remote data.
|
|
1168
|
+
*/
|
|
1169
|
+
domain?: string;
|
|
1170
|
+
}): Promise<ProviderResult<IssueBatchResult>> {
|
|
1171
|
+
return getIssuesBatch(this, options);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
async getTrackerIssue(options: {
|
|
1175
|
+
providerId: IntegrationIds;
|
|
1176
|
+
resourceId: string;
|
|
1177
|
+
resourceUrl?: string;
|
|
1178
|
+
key: string;
|
|
1179
|
+
connectionId?: string;
|
|
1180
|
+
}): Promise<ProviderResult<TrackerIssueResult>> {
|
|
1181
|
+
return getTrackerIssue(this, options);
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1159
1184
|
/**
|
|
1160
1185
|
* How many pull requests match each scope, without fetching any — the PR twin of {@link countIssues}. See
|
|
1161
1186
|
* {@link IntegrationManager.countPullRequests} for the cost model, the per-scope isolation rules, and why
|
|
@@ -16,6 +16,8 @@ import type {
|
|
|
16
16
|
PullRequestCountScope,
|
|
17
17
|
} from './reads/counts.js';
|
|
18
18
|
import type { SupportedFilters } from './reads/filters.js';
|
|
19
|
+
import type { IssueBatchResult, IssueBatchTarget } from './reads/issueBatch.js';
|
|
20
|
+
import type { TrackerIssueResult } from './reads/trackerIssue.js';
|
|
19
21
|
import type {
|
|
20
22
|
ConnectionStateChangeEvent,
|
|
21
23
|
ProviderBroadenResult,
|
|
@@ -563,6 +565,52 @@ export interface IntegrationManager {
|
|
|
563
565
|
/** Self-managed host domain fallback; see {@link ProviderSweepTarget.domain}. */
|
|
564
566
|
domain?: string;
|
|
565
567
|
}): Promise<ProviderResult<IssueCountResult>>;
|
|
568
|
+
/**
|
|
569
|
+
* Resolves several issues BY COORDINATE — `(owner, repo, number)` — in one request.
|
|
570
|
+
*
|
|
571
|
+
* The read for "which issue does this branch name reference", which is an IDENTITY question rather than a
|
|
572
|
+
* search. Emulating it by paging a scoped list and matching the identifier cannot prove absence without
|
|
573
|
+
* walking the whole scope, so a miss stays unproven, uncacheable, and repeats its whole budget on every pass.
|
|
574
|
+
* This answers it in one request per chunk, and a miss is final.
|
|
575
|
+
*
|
|
576
|
+
* Results are echoed under the caller's own `key`, so no positional matching is needed. Per-target isolation
|
|
577
|
+
* is the rule: a chunk that fails upstream warns and drops only its own targets (with `fetchFailed` set) while
|
|
578
|
+
* every other target still answers.
|
|
579
|
+
*
|
|
580
|
+
* `issue: undefined` means PROVEN ABSENT — the issue does not exist, or is not visible to this connection —
|
|
581
|
+
* and is safe to cache. A target whose chunk failed is NOT returned at all, so the two are distinguishable;
|
|
582
|
+
* caching a failure as an absence is exactly the bug this distinction prevents. GitHub/GHE only: a provider
|
|
583
|
+
* that cannot batch refuses outright rather than degrading into N requests behind the caller's back.
|
|
584
|
+
*/
|
|
585
|
+
getIssuesBatch(options: {
|
|
586
|
+
providerId: IntegrationIds;
|
|
587
|
+
/** Each `key` must be unique — a duplicate refuses the whole call, since keys identify results. */
|
|
588
|
+
targets: readonly IssueBatchTarget[];
|
|
589
|
+
connectionId?: string;
|
|
590
|
+
/** Self-managed host domain fallback; see {@link ProviderSweepTarget.domain}. */
|
|
591
|
+
domain?: string;
|
|
592
|
+
}): Promise<ProviderResult<IssueBatchResult>>;
|
|
593
|
+
/**
|
|
594
|
+
* Resolves one issue-tracker issue by key within a resource — the tracker counterpart of
|
|
595
|
+
* {@link getIssuesBatch}, which cannot serve one.
|
|
596
|
+
*
|
|
597
|
+
* `issue: undefined` is a proven absence and may be cached. A failed read returns no item and sets
|
|
598
|
+
* `fetchFailed`. `resourceId` is required and trusted; Jira also requires the resource's site URL so the result
|
|
599
|
+
* retains its browser link. The read performs no resource discovery.
|
|
600
|
+
*
|
|
601
|
+
* Jira and Linear only. Trello refuses: its single-issue read falls back to a capped board scan for a numeric
|
|
602
|
+
* identifier, so it cannot prove absence.
|
|
603
|
+
*/
|
|
604
|
+
getTrackerIssue(options: {
|
|
605
|
+
providerId: IntegrationIds;
|
|
606
|
+
/** Provider resource ID for the Atlassian site or Linear workspace. */
|
|
607
|
+
resourceId: string;
|
|
608
|
+
/** Jira site URL from resource discovery. Required for Jira so the result retains a browser link. */
|
|
609
|
+
resourceUrl?: string;
|
|
610
|
+
/** The provider's own key, e.g. `ABC-123`. Not a number. */
|
|
611
|
+
key: string;
|
|
612
|
+
connectionId?: string;
|
|
613
|
+
}): Promise<ProviderResult<TrackerIssueResult>>;
|
|
566
614
|
/**
|
|
567
615
|
* How many pull requests match each scope, fetching none of them — the PR twin of {@link countIssues}, behind a
|
|
568
616
|
* "this will fetch ~N pull requests" preview and a live count next to an unapplied filter. Same cost model,
|