@aviaratech/ai-delivery 0.3.38 → 0.3.40
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/README.md +14 -18
- package/dist/agent.d.ts +0 -4
- package/dist/agent.js +1 -8
- package/dist/agent.js.map +2 -2
- package/dist/cli.js +2 -72
- package/dist/cli.js.map +2 -2
- package/dist/cliResult.js +2 -14
- package/dist/cliResult.js.map +2 -2
- package/dist/cliResult.test.js +0 -74
- package/dist/cliResult.test.js.map +2 -2
- package/dist/config/deliveryConfig.d.ts +0 -6
- package/dist/config/deliveryConfig.js +2 -35
- package/dist/config/deliveryConfig.js.map +2 -2
- package/dist/config/deliveryConfig.test.js +1 -25
- package/dist/config/deliveryConfig.test.js.map +2 -2
- package/dist/contributorChecks.test.js +0 -1
- package/dist/contributorChecks.test.js.map +2 -2
- package/dist/delivery/common.d.ts +0 -14
- package/dist/delivery/common.js +1 -44
- package/dist/delivery/common.js.map +2 -2
- package/dist/directoryIndependent.test.js +2 -24
- package/dist/directoryIndependent.test.js.map +2 -2
- package/dist/dispatch.js +0 -46
- package/dist/dispatch.js.map +3 -3
- package/dist/fixtures/inertTarget.js +3 -5
- package/dist/fixtures/inertTarget.js.map +2 -2
- package/dist/fixtures/recordedGitHubFlows.d.ts +0 -72
- package/dist/fixtures/recordedGitHubFlows.js +1 -57
- package/dist/fixtures/recordedGitHubFlows.js.map +2 -2
- package/dist/git.d.ts +0 -6
- package/dist/git.js +0 -15
- package/dist/git.js.map +2 -2
- package/dist/github/client.js +0 -3
- package/dist/github/client.js.map +2 -2
- package/dist/github/commandIdentityPolicy.js +0 -1
- package/dist/github/commandIdentityPolicy.js.map +2 -2
- package/dist/github/issueHistory.d.ts +0 -6
- package/dist/github/issueHistory.js +0 -39
- package/dist/github/issueHistory.js.map +2 -2
- package/dist/github/nativeIssueMetadata.d.ts +0 -10
- package/dist/github/nativeIssueMetadata.js +1 -33
- package/dist/github/nativeIssueMetadata.js.map +3 -3
- package/dist/github/projectDelivery.d.ts +0 -34
- package/dist/github/projectDelivery.js +0 -211
- package/dist/github/projectDelivery.js.map +2 -2
- package/dist/github/repo.d.ts +0 -8
- package/dist/github/repo.js +0 -72
- package/dist/github/repo.js.map +2 -2
- package/dist/issue.js +23 -18
- package/dist/issue.js.map +2 -2
- package/dist/issue63Routes.test.js +1 -72
- package/dist/issue63Routes.test.js.map +2 -2
- package/dist/issueIntake.test.js +12 -0
- package/dist/issueIntake.test.js.map +2 -2
- package/dist/issueJournal.d.ts +0 -9
- package/dist/issueJournal.js +10 -76
- package/dist/issueJournal.js.map +2 -2
- package/dist/issueJournal.test.js +1 -108
- package/dist/issueJournal.test.js.map +2 -2
- package/dist/issueTracking.test.js +0 -48
- package/dist/issueTracking.test.js.map +2 -2
- package/dist/issueWriteRecovery.test.js +35 -0
- package/dist/issueWriteRecovery.test.js.map +2 -2
- package/dist/lifecycle.test.js +12 -48
- package/dist/lifecycle.test.js.map +2 -2
- package/dist/logger.d.ts +0 -4
- package/dist/logger.js +0 -31
- package/dist/logger.js.map +2 -2
- package/dist/mcp/tools.d.ts +2 -618
- package/dist/mcp/tools.js +8 -34
- package/dist/mcp/tools.js.map +2 -2
- package/dist/pluginAuthProbe.js +0 -3
- package/dist/pluginAuthProbe.js.map +2 -2
- package/dist/pluginDoctor.test.js +1 -1
- package/dist/pluginDoctor.test.js.map +2 -2
- package/dist/pluginInstaller.js +0 -3
- package/dist/pluginInstaller.js.map +2 -2
- package/dist/pluginInstaller.test.js +3 -19
- package/dist/pluginInstaller.test.js.map +2 -2
- package/dist/pluginPackaging.test.js +1 -118
- package/dist/pluginPackaging.test.js.map +2 -2
- package/dist/pr.d.ts +2 -73
- package/dist/pr.js +27 -220
- package/dist/pr.js.map +3 -3
- package/dist/pr.test.js +11 -304
- package/dist/pr.test.js.map +2 -2
- package/dist/prAssociation.test.js +112 -22
- package/dist/prAssociation.test.js.map +2 -2
- package/dist/prDispatch.test.js +4 -11
- package/dist/prDispatch.test.js.map +2 -2
- package/dist/releaseWorkflow.test.js +0 -1
- package/dist/releaseWorkflow.test.js.map +2 -2
- package/dist/review.d.ts +0 -82
- package/dist/review.js +3 -94
- package/dist/review.js.map +2 -2
- package/dist/review.test.js +2 -4
- package/dist/review.test.js.map +2 -2
- package/dist/services/agentReadinessService.d.ts +0 -1
- package/dist/services/agentReadinessService.js.map +2 -2
- package/dist/stdoutRegression.test.js +3 -22
- package/dist/stdoutRegression.test.js.map +2 -2
- package/dist/targetPolicyDiscovery.test.js +0 -86
- package/dist/targetPolicyDiscovery.test.js.map +2 -2
- package/dist/targetPolicyEntrypoints.test.js +1 -54
- package/dist/targetPolicyEntrypoints.test.js.map +2 -2
- package/dist/targetRepositoryExecution.test.js +1 -49
- package/dist/targetRepositoryExecution.test.js.map +2 -2
- package/dist/terminalMessages.d.ts +0 -10
- package/dist/terminalMessages.js +1 -31
- package/dist/terminalMessages.js.map +2 -2
- package/dist/toolOutput.js +0 -2
- package/dist/toolOutput.js.map +2 -2
- package/dist/toolOutput.test.js +15 -1
- package/dist/toolOutput.test.js.map +2 -2
- package/dist/verification.d.ts +1 -186
- package/dist/verification.js +29 -587
- package/dist/verification.js.map +3 -3
- package/dist/verificationGate.test.js +4 -90
- package/dist/verificationGate.test.js.map +2 -2
- package/dist/version.d.ts +0 -6
- package/dist/version.js +2 -39
- package/dist/version.js.map +2 -2
- package/package.json +1 -1
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/cli.js +123 -167
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/dist/boardReconcile.test.d.ts +0 -1
- package/dist/boardReconcile.test.js +0 -1746
- package/dist/boardReconcile.test.js.map +0 -7
- package/dist/delivery/delivery.test.d.ts +0 -1
- package/dist/delivery/delivery.test.js +0 -560
- package/dist/delivery/delivery.test.js.map +0 -7
- package/dist/delivery/evidence.d.ts +0 -92
- package/dist/delivery/evidence.js +0 -139
- package/dist/delivery/evidence.js.map +0 -7
- package/dist/delivery/legacy.d.ts +0 -8
- package/dist/delivery/legacy.js +0 -65
- package/dist/delivery/legacy.js.map +0 -7
- package/dist/delivery/policy.d.ts +0 -252
- package/dist/delivery/policy.js +0 -221
- package/dist/delivery/policy.js.map +0 -7
- package/dist/delivery/stage.d.ts +0 -179
- package/dist/delivery/stage.js +0 -242
- package/dist/delivery/stage.js.map +0 -7
- package/dist/deliveryBoard.d.ts +0 -74
- package/dist/deliveryBoard.js +0 -644
- package/dist/deliveryBoard.js.map +0 -7
- package/dist/deliveryBoard.test.d.ts +0 -1
- package/dist/deliveryBoard.test.js +0 -649
- package/dist/deliveryBoard.test.js.map +0 -7
- package/dist/deliveryHealth.test.d.ts +0 -1
- package/dist/deliveryHealth.test.js +0 -191
- package/dist/deliveryHealth.test.js.map +0 -7
- package/dist/fixtures/deliveryBoardReplay.d.ts +0 -56
- package/dist/fixtures/deliveryBoardReplay.js +0 -617
- package/dist/fixtures/deliveryBoardReplay.js.map +0 -7
- package/dist/genericCompatibility.test.d.ts +0 -1
- package/dist/genericCompatibility.test.js +0 -66
- package/dist/genericCompatibility.test.js.map +0 -7
- package/dist/services/boardReconcileService.d.ts +0 -1204
- package/dist/services/boardReconcileService.js +0 -1445
- package/dist/services/boardReconcileService.js.map +0 -7
- package/dist/services/deliveryHealthService.d.ts +0 -84
- package/dist/services/deliveryHealthService.js +0 -204
- package/dist/services/deliveryHealthService.js.map +0 -7
- package/dist/services/legacyIssueMigration.d.ts +0 -46
- package/dist/services/legacyIssueMigration.js +0 -299
- package/dist/services/legacyIssueMigration.js.map +0 -7
- package/dist/utils/filesystem.d.ts +0 -1
- package/dist/utils/filesystem.js +0 -5
- package/dist/utils/filesystem.js.map +0 -7
package/dist/github/repo.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { readdirSync, realpathSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
1
|
import { GIT_EXECUTABLE, inertGitArguments, gitEnvironment } from "../gitProcess.js";
|
|
4
2
|
import { spawnSync } from "node:child_process";
|
|
5
3
|
import { DeliveryError } from "../errors.js";
|
|
6
|
-
function formatRepoCoordinates(repo) {
|
|
7
|
-
return `${repo.owner}/${repo.repo}`;
|
|
8
|
-
}
|
|
9
4
|
function resolveDeliveryRepo(config, repoRoot, selectedRemote) {
|
|
10
5
|
if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/u.test(config.repository)) {
|
|
11
6
|
throw new DeliveryError("Invalid configured delivery repository.");
|
|
@@ -59,74 +54,7 @@ function resolveRepoFromRemote(repoRoot, selectedRemote) {
|
|
|
59
54
|
}
|
|
60
55
|
return { owner: match[1], repo: match[2] };
|
|
61
56
|
}
|
|
62
|
-
function resolveCheckout(input) {
|
|
63
|
-
const matches = (path) => {
|
|
64
|
-
try {
|
|
65
|
-
const remote = resolveRepoFromRemote(path, "origin");
|
|
66
|
-
if (formatRepoCoordinates(remote).toLowerCase() !== input.repository.toLowerCase()) return null;
|
|
67
|
-
const result = spawnSync(GIT_EXECUTABLE, [...inertGitArguments(path), "rev-parse", "--show-toplevel"], {
|
|
68
|
-
env: gitEnvironment(),
|
|
69
|
-
cwd: path,
|
|
70
|
-
encoding: "utf8",
|
|
71
|
-
maxBuffer: 1024 * 1024
|
|
72
|
-
});
|
|
73
|
-
return result.status === 0 ? realpathSync(result.stdout.trim()) : null;
|
|
74
|
-
} catch {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
const current = input.canonical ? null : matches(input.launchDirectory);
|
|
79
|
-
if (current) return current;
|
|
80
|
-
const candidates = /* @__PURE__ */ new Set();
|
|
81
|
-
for (const root of input.checkoutRoots) {
|
|
82
|
-
const direct = matches(root);
|
|
83
|
-
if (direct) {
|
|
84
|
-
candidates.add(direct);
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
let entries;
|
|
88
|
-
try {
|
|
89
|
-
entries = readdirSync(root, { withFileTypes: true });
|
|
90
|
-
} catch {
|
|
91
|
-
throw new DeliveryError(`Checkout root is unreadable: ${root}`);
|
|
92
|
-
}
|
|
93
|
-
for (const entry of entries) {
|
|
94
|
-
if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;
|
|
95
|
-
const path = matches(join(root, entry.name));
|
|
96
|
-
if (path) candidates.add(path);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
if (input.canonical) {
|
|
100
|
-
const common = /* @__PURE__ */ new Map();
|
|
101
|
-
for (const path of candidates) {
|
|
102
|
-
const result = spawnSync(
|
|
103
|
-
GIT_EXECUTABLE,
|
|
104
|
-
[...inertGitArguments(path), "rev-parse", "--path-format=absolute", "--git-common-dir"],
|
|
105
|
-
{
|
|
106
|
-
env: gitEnvironment(),
|
|
107
|
-
cwd: path,
|
|
108
|
-
encoding: "utf8",
|
|
109
|
-
maxBuffer: 1024 * 1024
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
if (result.status !== 0) throw new DeliveryError("Canonical queue Git directory is unavailable.");
|
|
113
|
-
common.set(realpathSync(result.stdout.trim()), path);
|
|
114
|
-
}
|
|
115
|
-
if (common.size !== 1)
|
|
116
|
-
throw new DeliveryError(
|
|
117
|
-
"Select exactly one canonical configured clone; independent matching clones are ambiguous."
|
|
118
|
-
);
|
|
119
|
-
return [...common.values()][0];
|
|
120
|
-
}
|
|
121
|
-
if (candidates.size !== 1)
|
|
122
|
-
throw new DeliveryError(
|
|
123
|
-
`Repository ${input.repository} has ${candidates.size === 0 ? "no matching" : "ambiguous"} checkout; select its checkout with --repo-root or configure checkoutRoots.`
|
|
124
|
-
);
|
|
125
|
-
return [...candidates][0];
|
|
126
|
-
}
|
|
127
57
|
export {
|
|
128
|
-
formatRepoCoordinates,
|
|
129
|
-
resolveCheckout,
|
|
130
58
|
resolveDeliveryRepo,
|
|
131
59
|
resolveGitRemoteName,
|
|
132
60
|
resolveRepoFromRemote
|
package/dist/github/repo.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/github/repo.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "AAAA,SAAS,
|
|
4
|
+
"sourcesContent": ["import { GIT_EXECUTABLE, inertGitArguments, gitEnvironment } from '../gitProcess.js';\n\nimport { spawnSync } from 'node:child_process';\n\nimport type { DeliveryConfig } from '../config/deliveryConfig.js';\n\nimport { DeliveryError } from '../errors.js';\n\nexport interface RepoCoordinates {\n owner: string;\n repo: string;\n}\n\nexport function resolveDeliveryRepo(\n config: Pick<DeliveryConfig, 'repository'>,\n repoRoot: string,\n selectedRemote?: string,\n): RepoCoordinates {\n if (!/^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$/u.test(config.repository)) {\n throw new DeliveryError('Invalid configured delivery repository.');\n }\n const [owner, repo] = config.repository.split('/');\n if (!owner || !repo) throw new DeliveryError('Invalid configured delivery repository.');\n const remote = resolveRepoFromRemote(repoRoot, selectedRemote);\n if (owner.toLowerCase() !== remote.owner.toLowerCase() || repo.toLowerCase() !== remote.repo.toLowerCase()) {\n throw new DeliveryError('Configured delivery repository does not match remote selection.');\n }\n return { owner, repo };\n}\n\nexport function resolveGitRemoteName(repoRoot: string, selectedRemote?: string): string {\n const remotes = spawnSync(GIT_EXECUTABLE, [...inertGitArguments(repoRoot), 'remote'], {\n env: gitEnvironment(),\n cwd: repoRoot,\n encoding: 'utf8',\n });\n if (remotes.status !== 0) throw new DeliveryError('Unable to list Git remotes.');\n const names = remotes.stdout.trim().split('\\n').filter(Boolean);\n if (selectedRemote !== undefined && !names.includes(selectedRemote)) {\n throw new DeliveryError('Selected Git remote does not exist in this checkout.');\n }\n if (selectedRemote === undefined && names.length !== 1) {\n throw new DeliveryError('Select a Git remote explicitly when the checkout has zero or multiple remotes.');\n }\n const remoteName = selectedRemote ?? names[0];\n if (!remoteName) throw new DeliveryError('Git remote selection is missing.');\n return remoteName;\n}\n\nexport function resolveRepoFromRemote(repoRoot: string, selectedRemote?: string): RepoCoordinates {\n const remoteName = resolveGitRemoteName(repoRoot, selectedRemote);\n const result = spawnSync(\n GIT_EXECUTABLE,\n [...inertGitArguments(repoRoot), 'config', '--local', '--no-includes', '--get', `remote.${remoteName}.url`],\n {\n env: gitEnvironment(),\n cwd: repoRoot,\n encoding: 'utf8',\n },\n );\n if (result.status !== 0) {\n throw new DeliveryError('Unable to determine repository identity from the selected Git remote.');\n }\n const remote = result.stdout.trim();\n const match =\n /^(?:git@github\\.com:|ssh:\\/\\/git@github\\.com\\/|https:\\/\\/github\\.com\\/)([A-Za-z0-9_.-]+)\\/([A-Za-z0-9_.-]+?)(?:\\.git)?\\/?$/u.exec(\n remote,\n );\n if (!match?.[1] || !match[2]) {\n throw new DeliveryError('The selected Git remote must be a github.com repository URL.');\n }\n return { owner: match[1], repo: match[2] };\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,gBAAgB,mBAAmB,sBAAsB;AAElE,SAAS,iBAAiB;AAI1B,SAAS,qBAAqB;AAOvB,SAAS,oBACd,QACA,UACA,gBACiB;AACjB,MAAI,CAAC,sCAAsC,KAAK,OAAO,UAAU,GAAG;AAClE,UAAM,IAAI,cAAc,yCAAyC;AAAA,EACnE;AACA,QAAM,CAAC,OAAO,IAAI,IAAI,OAAO,WAAW,MAAM,GAAG;AACjD,MAAI,CAAC,SAAS,CAAC,KAAM,OAAM,IAAI,cAAc,yCAAyC;AACtF,QAAM,SAAS,sBAAsB,UAAU,cAAc;AAC7D,MAAI,MAAM,YAAY,MAAM,OAAO,MAAM,YAAY,KAAK,KAAK,YAAY,MAAM,OAAO,KAAK,YAAY,GAAG;AAC1G,UAAM,IAAI,cAAc,iEAAiE;AAAA,EAC3F;AACA,SAAO,EAAE,OAAO,KAAK;AACvB;AAEO,SAAS,qBAAqB,UAAkB,gBAAiC;AACtF,QAAM,UAAU,UAAU,gBAAgB,CAAC,GAAG,kBAAkB,QAAQ,GAAG,QAAQ,GAAG;AAAA,IACpF,KAAK,eAAe;AAAA,IACpB,KAAK;AAAA,IACL,UAAU;AAAA,EACZ,CAAC;AACD,MAAI,QAAQ,WAAW,EAAG,OAAM,IAAI,cAAc,6BAA6B;AAC/E,QAAM,QAAQ,QAAQ,OAAO,KAAK,EAAE,MAAM,IAAI,EAAE,OAAO,OAAO;AAC9D,MAAI,mBAAmB,UAAa,CAAC,MAAM,SAAS,cAAc,GAAG;AACnE,UAAM,IAAI,cAAc,sDAAsD;AAAA,EAChF;AACA,MAAI,mBAAmB,UAAa,MAAM,WAAW,GAAG;AACtD,UAAM,IAAI,cAAc,gFAAgF;AAAA,EAC1G;AACA,QAAM,aAAa,kBAAkB,MAAM,CAAC;AAC5C,MAAI,CAAC,WAAY,OAAM,IAAI,cAAc,kCAAkC;AAC3E,SAAO;AACT;AAEO,SAAS,sBAAsB,UAAkB,gBAA0C;AAChG,QAAM,aAAa,qBAAqB,UAAU,cAAc;AAChE,QAAM,SAAS;AAAA,IACb;AAAA,IACA,CAAC,GAAG,kBAAkB,QAAQ,GAAG,UAAU,WAAW,iBAAiB,SAAS,UAAU,UAAU,MAAM;AAAA,IAC1G;AAAA,MACE,KAAK,eAAe;AAAA,MACpB,KAAK;AAAA,MACL,UAAU;AAAA,IACZ;AAAA,EACF;AACA,MAAI,OAAO,WAAW,GAAG;AACvB,UAAM,IAAI,cAAc,uEAAuE;AAAA,EACjG;AACA,QAAM,SAAS,OAAO,OAAO,KAAK;AAClC,QAAM,QACJ,8HAA8H;AAAA,IAC5H;AAAA,EACF;AACF,MAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG;AAC5B,UAAM,IAAI,cAAc,8DAA8D;AAAA,EACxF;AACA,SAAO,EAAE,OAAO,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,EAAE;AAC3C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/issue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { types } from "node:util";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { loadDeliveryConfig, WipLimits } from "./config/deliveryConfig.js";
|
|
4
|
-
import { digestValue } from "./delivery/
|
|
4
|
+
import { digestValue } from "./delivery/common.js";
|
|
5
5
|
import {
|
|
6
6
|
CollectionLimitError,
|
|
7
7
|
DeliveryError,
|
|
@@ -361,15 +361,20 @@ async function createIssue(context, input) {
|
|
|
361
361
|
const marker = `<!-- ai-delivery-create: ${key} intent: ${originalIntent} -->`;
|
|
362
362
|
const matches = [];
|
|
363
363
|
for (let page = 1; page <= Math.min(20, context.readPageLimit ?? 20); page++) {
|
|
364
|
-
const batch = (await clients.rest.issues.listForRepo({
|
|
364
|
+
const batch = (await clients.rest.issues.listForRepo({
|
|
365
|
+
...repo,
|
|
366
|
+
state: "all",
|
|
367
|
+
sort: "created",
|
|
368
|
+
direction: "desc",
|
|
369
|
+
page,
|
|
370
|
+
per_page: 100
|
|
371
|
+
})).data;
|
|
365
372
|
matches.push(
|
|
366
373
|
...batch.filter(
|
|
367
374
|
(row) => !("pull_request" in row) && row.body?.includes(`<!-- ai-delivery-create: ${key} intent:`)
|
|
368
375
|
)
|
|
369
376
|
);
|
|
370
377
|
if (batch.length < 100) break;
|
|
371
|
-
if (page === Math.min(20, context.readPageLimit ?? 20))
|
|
372
|
-
throw new DeliveryError("Create retry search exceeds the bounded readback window; reconcile the known issue.");
|
|
373
378
|
}
|
|
374
379
|
if (matches.length > 1) throw new DeliveryError("Conflicting issues claim the same create opId.");
|
|
375
380
|
prior = matches[0];
|
|
@@ -907,14 +912,13 @@ async function assertProjectTransition(context, plan, recordOverride = false, va
|
|
|
907
912
|
if (request.status === "Todo" && targets.some((x) => x.state === "open"))
|
|
908
913
|
throw new DeliveryError("Unresolved native blockers prevent Todo; resolve the blockers first.");
|
|
909
914
|
if (request.status === "In Progress") {
|
|
910
|
-
const ready = await readyCheck(context, plan.input.issueNumber);
|
|
911
|
-
if (!ready.ready) throw new IssueValidationError(ready.failures);
|
|
912
915
|
if (target.state !== "open") throw new DeliveryError("In Progress requires an open issue; inspect native state.");
|
|
913
916
|
await assertIssueStartCapacity(context, plan.input.issueNumber, plan.input.overrideReason, recordOverride);
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
917
|
+
await assertReadyAndOpen(
|
|
918
|
+
context,
|
|
919
|
+
plan.input.issueNumber,
|
|
920
|
+
"In Progress requires an open issue; inspect native state."
|
|
921
|
+
);
|
|
918
922
|
}
|
|
919
923
|
}
|
|
920
924
|
async function prepareIssueUpdate(context, input) {
|
|
@@ -2044,9 +2048,15 @@ async function startIssueBranch(context, issueNumber, selected) {
|
|
|
2044
2048
|
);
|
|
2045
2049
|
return { issueNumber, issueUrl: issue.html_url, branch: name, headSha: base, reused: false };
|
|
2046
2050
|
}
|
|
2051
|
+
async function assertReadyAndOpen(context, issueNumber, closedMessage) {
|
|
2052
|
+
let state;
|
|
2053
|
+
const ready = await readyCheck(context, issueNumber, ({ info }) => {
|
|
2054
|
+
state = info.state;
|
|
2055
|
+
});
|
|
2056
|
+
if (!ready.ready) throw new IssueValidationError(ready.failures);
|
|
2057
|
+
if (state !== "open") throw new DeliveryError(closedMessage);
|
|
2058
|
+
}
|
|
2047
2059
|
async function startIssueProject(context, issueNumber, overrideReason) {
|
|
2048
|
-
const readiness = await readyCheck(context, issueNumber);
|
|
2049
|
-
if (!readiness.ready) throw new IssueValidationError(readiness.failures);
|
|
2050
2060
|
const issue = (await context.clients.rest.issues.get({ ...context.repo, issue_number: issueNumber })).data;
|
|
2051
2061
|
if (issue.number !== issueNumber || "pull_request" in issue || issue.state !== "open" || !issue.node_id)
|
|
2052
2062
|
throw new DeliveryError("Start requires the requested open GitHub issue before Project synchronization.");
|
|
@@ -2058,13 +2068,8 @@ async function startIssueProject(context, issueNumber, overrideReason) {
|
|
|
2058
2068
|
settings: projectSettingsFromDeliveryConfig(context.config),
|
|
2059
2069
|
status: "In Progress",
|
|
2060
2070
|
beforeAdvance: async () => {
|
|
2061
|
-
const eligible = await readyCheck(context, issueNumber);
|
|
2062
|
-
if (!eligible.ready) throw new IssueValidationError(eligible.failures);
|
|
2063
2071
|
await assertIssueStartCapacity(context, issueNumber, overrideReason, true);
|
|
2064
|
-
|
|
2065
|
-
if (current.state !== "open") throw new DeliveryError("Start requires the requested open issue.");
|
|
2066
|
-
const finalEligibility = await readyCheck(context, issueNumber);
|
|
2067
|
-
if (!finalEligibility.ready) throw new IssueValidationError(finalEligibility.failures);
|
|
2072
|
+
await assertReadyAndOpen(context, issueNumber, "Start requires the requested open issue.");
|
|
2068
2073
|
}
|
|
2069
2074
|
});
|
|
2070
2075
|
}
|