@intentius/chant 0.124.43 → 0.124.45
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/dist/ci-identity.d.ts +183 -12
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +362 -53
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +17 -1
- package/dist/cli/handlers/pr-env.d.ts +8 -2
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +126 -225
- package/dist/cli/handlers/pr.d.ts +3 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +1 -0
- package/dist/components/cli-support.d.ts +2 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +4 -2
- package/dist/components/fan-out-support.d.ts +3 -0
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/fan-out-support.js +1 -1
- package/dist/components/pr-env-run.d.ts +270 -0
- package/dist/components/pr-env-run.d.ts.map +1 -0
- package/dist/components/pr-env-run.js +440 -0
- package/dist/components/pr-environment.d.ts +89 -14
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +94 -8
- package/dist/components/pr-pipeline.d.ts +10 -1
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/op/op-waves.d.ts +17 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +23 -1
- package/dist/pr-forge.d.ts +15 -1
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +28 -16
- package/dist/pr-requires.d.ts +5 -1
- package/dist/pr-requires.d.ts.map +1 -1
- package/dist/wave-runtime.mjs +179 -179
- package/dist/workspace/ci-cloud-identity.d.ts +3 -1
- package/dist/workspace/ci-cloud-identity.d.ts.map +1 -1
- package/dist/workspace/ci-cloud-identity.js +16 -1
- package/dist/workspace/ci-run.d.ts +35 -8
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +95 -21
- package/dist/workspace/ci-secrets.d.ts.map +1 -1
- package/dist/workspace/ci-secrets.js +4 -3
- package/dist/workspace/declaration.d.ts +10 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +17 -1
- package/dist/workspace/declaration.schema.json +36 -1
- package/package.json +1 -1
- package/src/ci-identity-targets.test.ts +275 -0
- package/src/ci-identity.ts +394 -61
- package/src/cli/handlers/build.ts +15 -1
- package/src/cli/handlers/pr-env.ts +136 -227
- package/src/cli/handlers/pr.ts +4 -0
- package/src/components/cli-support.ts +6 -1
- package/src/components/fan-out-support.ts +4 -1
- package/src/components/pr-env-run.test.ts +290 -0
- package/src/components/pr-env-run.ts +634 -0
- package/src/components/pr-environment.ts +159 -12
- package/src/components/pr-pipeline.ts +10 -1
- package/src/op/op-waves.ts +38 -1
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.ts +44 -17
- package/src/pr-requires.test.ts +43 -6
- package/src/pr-requires.ts +5 -1
- package/src/workspace/ci-cloud-identity.test.ts +20 -0
- package/src/workspace/ci-cloud-identity.ts +14 -1
- package/src/workspace/ci-run.test.ts +74 -1
- package/src/workspace/ci-run.ts +122 -29
- package/src/workspace/ci-secrets.test.ts +1 -1
- package/src/workspace/ci-secrets.ts +4 -3
- package/src/workspace/declaration.schema.json +36 -1
- package/src/workspace/declaration.test.ts +7 -0
- package/src/workspace/declaration.ts +24 -2
|
@@ -25,17 +25,23 @@
|
|
|
25
25
|
* `down` reads the environment's record on chant/lifecycle, checks it names
|
|
26
26
|
* this pull request's environment, and tears down what `planTeardown` finds
|
|
27
27
|
* under the record's marker, after dropping any entry whose marker is not
|
|
28
|
-
* exactly that one.
|
|
29
|
-
*
|
|
28
|
+
* exactly that one. The lexicons tear down what they own, and the command
|
|
29
|
+
* `ci.prEnvironment.teardown` names tears down the rest (#4330). No gate
|
|
30
|
+
* holds it: closing the pull request is the decision, as is the TTL the base
|
|
31
|
+
* set for `sweep`.
|
|
32
|
+
*
|
|
33
|
+
* The runs themselves are ../../components/pr-env-run.ts, which a product
|
|
34
|
+
* calls with an adapter of its own (#4330). This file supplies the
|
|
35
|
+
* components adapter and the CLI's ports.
|
|
30
36
|
*/
|
|
31
37
|
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
32
38
|
import { join, resolve } from "node:path";
|
|
33
39
|
import { loadChantConfig } from "../../config.js";
|
|
34
40
|
import { ENV_VAR } from "../../env.js";
|
|
35
41
|
import { isEmptyChangeSet } from "../../change-set.js";
|
|
36
|
-
import { PR_ENV_EXIT, PR_ENV_GATE,
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
42
|
+
import { PR_ENV_EXIT, PR_ENV_GATE, PR_ENV_RECORD_FILE, PR_ENV_REPORT_DIR, acceptHandedRecord, handedPrEnvReport, PR_ENV_TEMPLATE_VAR, derivePrEnvironment, prEnvApproveCommand, prEnvStatusState, prEnvironmentName, prEnvironmentSite, renderPrEnvNote, ttlMs, } from "../../components/pr-environment.js";
|
|
43
|
+
import { commandTeardownAdapter, forgePrEnvPublisher, lifecyclePrEnvPorts, prEnvDown as prEnvDownRun, prEnvOp, prEnvSweep as prEnvSweepRun, prEnvUp as prEnvUpRun, } from "../../components/pr-env-run.js";
|
|
44
|
+
import { applyPrSet } from "../../components/pr-run.js";
|
|
39
45
|
import { prOp } from "../../pr-loop.js";
|
|
40
46
|
import { FORGE_KINDS, forgeFromEnv, forgePrincipalOf } from "../../pr-forge.js";
|
|
41
47
|
import { formatError, formatInfo, formatWarning } from "../format.js";
|
|
@@ -77,36 +83,29 @@ function actor() {
|
|
|
77
83
|
function memberOf(ctx) {
|
|
78
84
|
return ctx.args.members?.length === 1 ? ctx.args.members[0] : undefined;
|
|
79
85
|
}
|
|
80
|
-
// ── the
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
await fetchLifecycle().catch(() => false);
|
|
84
|
-
return parsePrEnvRecords(await readBlobFromPath(PR_ENV_LEDGER_DIR, PR_ENV_LEDGER_FILE));
|
|
85
|
-
}
|
|
86
|
+
// ── the ports ──────────────────────────────────────────────────────────────
|
|
87
|
+
const log = (line) => console.error(formatInfo(line));
|
|
88
|
+
const warn = (message) => console.error(formatWarning({ message }));
|
|
86
89
|
/**
|
|
87
|
-
*
|
|
88
|
-
* the
|
|
89
|
-
*
|
|
90
|
-
*
|
|
90
|
+
* The ports `pr-env` runs with (../../components/pr-env-run.ts): the records
|
|
91
|
+
* and the gate ledger on chant/lifecycle here, and the report written under
|
|
92
|
+
* `--output` and posted through `forge`. With `--no-push` (#4295) the record
|
|
93
|
+
* is written to `pr-env-record.json` under `--output` instead, for `pr-env
|
|
94
|
+
* post` to append from a job that runs none of the change's code.
|
|
91
95
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
console.error(formatWarning({ message: pushed.pushWarning }));
|
|
106
|
-
}
|
|
107
|
-
catch (err) {
|
|
108
|
-
console.error(formatWarning({ message: `could not record ${record.env}'s ${record.kind} on chant/lifecycle: ${err instanceof Error ? err.message : String(err)}` }));
|
|
109
|
-
}
|
|
96
|
+
function cliPorts(ctx, forge) {
|
|
97
|
+
const lifecycle = lifecyclePrEnvPorts({ ...(forge ? { forge } : {}), log, warn });
|
|
98
|
+
return {
|
|
99
|
+
...lifecycle,
|
|
100
|
+
async appendRecord(record) {
|
|
101
|
+
if (!ctx.args.noPush)
|
|
102
|
+
return lifecycle.appendRecord(record);
|
|
103
|
+
const dir = resolve(ctx.args.output ?? PR_ENV_REPORT_DIR);
|
|
104
|
+
mkdirSync(dir, { recursive: true });
|
|
105
|
+
writeFileSync(join(dir, PR_ENV_RECORD_FILE), JSON.stringify(record, null, 2) + "\n");
|
|
106
|
+
},
|
|
107
|
+
publish: (report) => finish(ctx, forge, report),
|
|
108
|
+
};
|
|
110
109
|
}
|
|
111
110
|
// ── the report and the note ────────────────────────────────────────────────
|
|
112
111
|
async function finish(ctx, forge, report) {
|
|
@@ -117,27 +116,8 @@ async function finish(ctx, forge, report) {
|
|
|
117
116
|
writeFileSync(join(dir, "pr-env-note.md"), note);
|
|
118
117
|
if (ctx.args.json)
|
|
119
118
|
console.log(JSON.stringify(report, null, 2));
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
if (report.head) {
|
|
123
|
-
try {
|
|
124
|
-
await forge.setStatus(report.head, {
|
|
125
|
-
context: prEnvStatusContext(report.member),
|
|
126
|
-
state: prEnvStatusState(report),
|
|
127
|
-
description: prEnvStatusDescription(report),
|
|
128
|
-
...(forge.runUrl ? { url: forge.runUrl } : {}),
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
catch (err) {
|
|
132
|
-
console.error(formatWarning({ message: `could not set the ${prEnvStatusContext(report.member)} status: ${err instanceof Error ? err.message : String(err)}` }));
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
try {
|
|
136
|
-
await forge.upsertNote(report.pr, prEnvNoteMarker(report.env, report.member), note);
|
|
137
|
-
}
|
|
138
|
-
catch (err) {
|
|
139
|
-
console.error(formatWarning({ message: `could not post the note on #${report.pr}: ${err instanceof Error ? err.message : String(err)}` }));
|
|
140
|
-
}
|
|
119
|
+
if (forge)
|
|
120
|
+
await forgePrEnvPublisher(forge, warn)(report);
|
|
141
121
|
}
|
|
142
122
|
// ── up ─────────────────────────────────────────────────────────────────────
|
|
143
123
|
async function prEnvUp(ctx) {
|
|
@@ -159,7 +139,6 @@ async function prEnvUp(ctx) {
|
|
|
159
139
|
const derived = derivePrEnvironment(config, setting.template, pr);
|
|
160
140
|
if ("refusal" in derived)
|
|
161
141
|
return fail(derived.refusal);
|
|
162
|
-
const ttl = ttlMs(setting.ttl) ?? ttlMs("72h");
|
|
163
142
|
// The build sees pr-<n> as its environment and the template's name beside it.
|
|
164
143
|
process.env[ENV_VAR] = derived.env;
|
|
165
144
|
process.env[PR_ENV_TEMPLATE_VAR] = derived.template;
|
|
@@ -168,108 +147,77 @@ async function prEnvUp(ctx) {
|
|
|
168
147
|
args: { ...args, env: derived.env, param: [...(args.param ?? []).filter((p) => !p.startsWith(`${derived.param}=`)), `${derived.param}=${derived.env}`] },
|
|
169
148
|
};
|
|
170
149
|
console.error(formatInfo(`pr-env up: ${derived.env}, derived from ${derived.template}${derived.endpoint ? ` at ${derived.endpoint}` : ""}, marker ${derived.stack}/${derived.env}`));
|
|
171
|
-
return withComponentEndpoint(envCtx, () => up(envCtx, pr, derived, ttl), { config: { ...config, environments: derived.environments }, environment: derived.env });
|
|
150
|
+
return withComponentEndpoint(envCtx, () => up(envCtx, pr, derived, setting.ttl), { config: { ...config, environments: derived.environments }, environment: derived.env });
|
|
172
151
|
}
|
|
173
152
|
async function up(ctx, pr, derived, ttl) {
|
|
174
153
|
const { prepare, planAll, placeHooks, runStageHook } = await import("./pr.js");
|
|
175
154
|
const p = await prepare(ctx, "plan");
|
|
176
155
|
if (typeof p === "number")
|
|
177
156
|
return p;
|
|
178
|
-
const forge = p.forge;
|
|
179
|
-
const op = prOp(pr, p.member);
|
|
180
157
|
// ci.hooks (#4288), read at base as the other pull-request jobs read them, around the plan and the apply.
|
|
181
|
-
placeHooks(ctx, p, "apply",
|
|
182
|
-
const
|
|
183
|
-
stage: "up",
|
|
158
|
+
placeHooks(ctx, p, "apply", prEnvOp(pr, p.member));
|
|
159
|
+
const result = await prEnvUpRun({
|
|
184
160
|
pr,
|
|
185
|
-
env: derived.env,
|
|
186
|
-
...(p.member ? { member: p.member } : {}),
|
|
187
|
-
template: derived.template,
|
|
188
161
|
head: p.head,
|
|
189
|
-
op,
|
|
190
|
-
gate: PR_ENV_GATE,
|
|
191
|
-
digest: "",
|
|
192
|
-
status: "nothing",
|
|
193
|
-
...(derived.endpoint ? { endpoint: derived.endpoint } : {}),
|
|
194
|
-
components: [],
|
|
195
|
-
};
|
|
196
|
-
if (p.plan.order.length === 0) {
|
|
197
|
-
await finish(ctx, forge, { ...base, ...(p.routedAway ? { message: p.routedAway } : {}) });
|
|
198
|
-
console.error(formatInfo(`pr-env up: nothing this change touches is deployed by a component, so ${derived.env} gets nothing`));
|
|
199
|
-
return PR_ENV_EXIT.done;
|
|
200
|
-
}
|
|
201
|
-
const set = await planAll(p);
|
|
202
|
-
const rows = (status) => p.plan.order.map((component) => {
|
|
203
|
-
const ms = set.members.filter((m) => m.component === component);
|
|
204
|
-
const sum = (k) => ms.reduce((n, m) => n + m.counts[k], 0);
|
|
205
|
-
return { component, status: status(component), create: sum("create"), update: sum("update"), replace: sum("replace"), delete: sum("delete") };
|
|
206
|
-
});
|
|
207
|
-
const digest = set.doc.digest;
|
|
208
|
-
if (set.failed) {
|
|
209
|
-
await finish(ctx, forge, { ...base, digest, status: "plan-failed", ...(p.hookFailed ? { message: p.hookFailed } : {}), components: rows((c) => (set.members.some((m) => m.component === c && m.status === "plan-failed") ? "plan failed" : "planned")) });
|
|
210
|
-
return PR_ENV_EXIT.failed;
|
|
211
|
-
}
|
|
212
|
-
// ws-080, ws-104: a non-empty plan applies only under a person's approval of its digest. An empty one passes.
|
|
213
|
-
let approvedBy;
|
|
214
|
-
if (!isEmptyChangeSet(set.doc)) {
|
|
215
|
-
let approval;
|
|
216
|
-
try {
|
|
217
|
-
approval = approvalOf(await decidePrGate(readOnlyLedger(gitGateLedgerPort()), { op, gate: PR_ENV_GATE, digest, description: `${derived.env}: ${p.plan.order.join(", ")}` }));
|
|
218
|
-
}
|
|
219
|
-
catch (err) {
|
|
220
|
-
return fail(`could not read the gate ledger, so ${derived.env} does not apply: ${err instanceof Error ? err.message : String(err)}`);
|
|
221
|
-
}
|
|
222
|
-
if (approval.status !== "approved") {
|
|
223
|
-
const status = approval.status === "changed" ? "changed" : "waiting";
|
|
224
|
-
await finish(ctx, forge, { ...base, digest, status, components: rows(() => "planned") });
|
|
225
|
-
console.error(formatInfo(`pr-env up: ${derived.env} waits for an approval of ${digest}`));
|
|
226
|
-
console.error(formatInfo(`approve : ${prEnvApproveCommand(op, digest)}`));
|
|
227
|
-
return PR_ENV_EXIT.waiting;
|
|
228
|
-
}
|
|
229
|
-
approvedBy = approval.approvedBy ?? [];
|
|
230
|
-
}
|
|
231
|
-
const hookStop = runStageHook(p, "before-apply", p.plan.order, set);
|
|
232
|
-
if (hookStop) {
|
|
233
|
-
await finish(ctx, forge, { ...base, digest, status: "failed", message: hookStop, components: rows(() => "planned"), ...(approvedBy ? { approvedBy } : {}) });
|
|
234
|
-
return PR_ENV_EXIT.failed;
|
|
235
|
-
}
|
|
236
|
-
const applied = await applyPrSet({ components: p.components, plan: p.plan, registry: p.registry, env: derived.env, set, gate: PR_ENV_GATE });
|
|
237
|
-
const afterHook = runStageHook(p, "after-apply", p.plan.order, set, "the environment stands as applied");
|
|
238
|
-
const status = (component) => applied.members.find((m) => m.component === component)?.status ?? "planned";
|
|
239
|
-
const ok = applied.status === "applied";
|
|
240
|
-
const now = new Date();
|
|
241
|
-
const expiresAt = new Date(now.getTime() + ttl).toISOString();
|
|
242
|
-
// A copy that failed part way is live too: what applied is torn down on close or at expiry like the rest.
|
|
243
|
-
await appendRecord(ctx, {
|
|
244
|
-
version: 1,
|
|
245
|
-
kind: "up",
|
|
246
|
-
pr,
|
|
247
|
-
env: derived.env,
|
|
248
|
-
...(p.member ? { member: p.member } : {}),
|
|
249
162
|
template: derived.template,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
...(approvedBy ? { approvedBy } : {}),
|
|
259
|
-
releaseTarget: false,
|
|
260
|
-
...(forge?.runUrl ? { runUrl: forge.runUrl } : {}),
|
|
163
|
+
ttl,
|
|
164
|
+
stack: derived.stack,
|
|
165
|
+
...(p.member ? { member: p.member } : {}),
|
|
166
|
+
...(derived.endpoint ? { endpoint: derived.endpoint } : {}),
|
|
167
|
+
adapter: componentsPrEnvAdapter(p, { planAll, runStageHook }),
|
|
168
|
+
ports: cliPorts(ctx, p.forge),
|
|
169
|
+
actor: actor(),
|
|
170
|
+
...(p.forge?.runUrl ? { runUrl: p.forge.runUrl } : {}),
|
|
261
171
|
});
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
172
|
+
if (result.report.status === "waiting" || result.report.status === "changed")
|
|
173
|
+
console.error(formatInfo(`approve : ${prEnvApproveCommand(result.report.op, result.report.digest)}`));
|
|
174
|
+
return result.exit;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* The components as a pull request environment's adapter: the plan is
|
|
178
|
+
* `pr-plan`'s, with the plan-side hooks around it, and the apply is the
|
|
179
|
+
* fan-out's, with the apply-side hooks around it. Each row carries the
|
|
180
|
+
* component's site in `pr-<n>`, carried over from the template's (#4330,
|
|
181
|
+
* `prEnvironmentSite`).
|
|
182
|
+
*/
|
|
183
|
+
function componentsPrEnvAdapter(p, run) {
|
|
184
|
+
let set;
|
|
185
|
+
const rows = (target, status) => p.plan.order.map((component) => {
|
|
186
|
+
const ms = (set?.members ?? []).filter((m) => m.component === component);
|
|
187
|
+
const sum = (k) => ms.reduce((n, m) => n + m.counts[k], 0);
|
|
188
|
+
const found = prEnvironmentSite(p.sites?.[component], target.template, target.env);
|
|
189
|
+
const site = found ? { ...(found.runtime ? { runtime: found.runtime } : {}), ...(found.url ? { url: found.url } : {}), ...(found.domain ? { domain: found.domain } : {}) } : undefined;
|
|
190
|
+
return { component, status: status(component), create: sum("create"), update: sum("update"), replace: sum("replace"), delete: sum("delete"), ...(site && Object.keys(site).length > 0 ? { site } : {}) };
|
|
270
191
|
});
|
|
271
|
-
|
|
272
|
-
|
|
192
|
+
return {
|
|
193
|
+
async plan(target) {
|
|
194
|
+
if (p.plan.order.length === 0)
|
|
195
|
+
return { digest: "", empty: true, rows: [], ...(p.routedAway ? { message: p.routedAway } : {}) };
|
|
196
|
+
set = await run.planAll(p);
|
|
197
|
+
const planned = set;
|
|
198
|
+
return {
|
|
199
|
+
digest: planned.doc.digest,
|
|
200
|
+
empty: isEmptyChangeSet(planned.doc),
|
|
201
|
+
...(planned.failed ? { failed: true } : {}),
|
|
202
|
+
rows: rows(target, (c) => (planned.failed && planned.members.some((m) => m.component === c && m.status === "plan-failed") ? "plan failed" : "planned")),
|
|
203
|
+
...(p.hookFailed ? { message: p.hookFailed } : {}),
|
|
204
|
+
};
|
|
205
|
+
},
|
|
206
|
+
async apply(target) {
|
|
207
|
+
const planned = set;
|
|
208
|
+
const hookStop = run.runStageHook(p, "before-apply", p.plan.order, planned);
|
|
209
|
+
if (hookStop)
|
|
210
|
+
return { status: "stopped", rows: rows(target, () => "planned"), message: hookStop };
|
|
211
|
+
const applied = await applyPrSet({ components: p.components, plan: p.plan, registry: p.registry, env: target.env, set: planned, gate: PR_ENV_GATE });
|
|
212
|
+
const afterHook = run.runStageHook(p, "after-apply", p.plan.order, planned, "the environment stands as applied");
|
|
213
|
+
const status = (component) => applied.members.find((m) => m.component === component)?.status ?? "planned";
|
|
214
|
+
return {
|
|
215
|
+
status: applied.status === "applied" ? "applied" : applied.status === "waiting" ? "waiting" : "failed",
|
|
216
|
+
rows: rows(target, status),
|
|
217
|
+
...(afterHook ? { afterFailure: afterHook } : {}),
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
};
|
|
273
221
|
}
|
|
274
222
|
// ── post ───────────────────────────────────────────────────────────────────
|
|
275
223
|
/**
|
|
@@ -319,7 +267,7 @@ async function prEnvPost(ctx) {
|
|
|
319
267
|
code = PR_ENV_EXIT.failed;
|
|
320
268
|
}
|
|
321
269
|
else {
|
|
322
|
-
await
|
|
270
|
+
await lifecyclePrEnvPorts({ warn }).appendRecord(accepted.record);
|
|
323
271
|
if (accepted.record.expiresAt)
|
|
324
272
|
report.expiresAt = accepted.record.expiresAt;
|
|
325
273
|
}
|
|
@@ -329,6 +277,18 @@ async function prEnvPost(ctx) {
|
|
|
329
277
|
return code;
|
|
330
278
|
}
|
|
331
279
|
// ── down ───────────────────────────────────────────────────────────────────
|
|
280
|
+
/**
|
|
281
|
+
* What tears the environment down: the lexicons, and the command
|
|
282
|
+
* `ci.prEnvironment.teardown` names in the declaration at this commit
|
|
283
|
+
* (#4330), which the down and sweep jobs check out from the base branch.
|
|
284
|
+
*/
|
|
285
|
+
async function teardownSources() {
|
|
286
|
+
const projectPath = resolve(".");
|
|
287
|
+
const { config } = await loadChantConfig(projectPath).catch(() => ({ config: {} }));
|
|
288
|
+
const { scopeSource } = await import("../../workspace/write-scope.js");
|
|
289
|
+
const hook = scopeSource(projectPath, "HEAD").declaration?.ci?.prEnvironment?.teardown;
|
|
290
|
+
return { config, adapters: hook ? [commandTeardownAdapter(hook, { cwd: projectPath })] : [] };
|
|
291
|
+
}
|
|
332
292
|
async function prEnvDown(ctx) {
|
|
333
293
|
const { args } = ctx;
|
|
334
294
|
if (args.pr === undefined)
|
|
@@ -339,61 +299,21 @@ async function prEnvDown(ctx) {
|
|
|
339
299
|
const forge = forgeOf(ctx);
|
|
340
300
|
if (typeof forge === "number")
|
|
341
301
|
return forge;
|
|
342
|
-
const live = livePrEnvironments(await readRecords()).get(prEnvironmentName(args.pr));
|
|
343
|
-
return teardown(ctx, forge, args.pr, live, reason);
|
|
344
|
-
}
|
|
345
|
-
async function teardown(ctx, forge, pr, live, reason) {
|
|
346
|
-
const env = prEnvironmentName(pr);
|
|
347
302
|
const member = memberOf(ctx);
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
console.error(formatInfo(`pr-env down: ${env} has no live record, so there is nothing to tear down`));
|
|
351
|
-
if (forge)
|
|
352
|
-
await finish(ctx, forge, report);
|
|
353
|
-
return PR_ENV_EXIT.done;
|
|
354
|
-
}
|
|
355
|
-
const { config } = await loadChantConfig(resolve(".")).catch(() => ({ config: {} }));
|
|
356
|
-
const torn = await tearDownPrEnvironment({ pr, live, config, plugins: ctx.plugins, warn: (message) => console.error(formatWarning({ message })) });
|
|
357
|
-
if ("refusal" in torn) {
|
|
358
|
-
await finish(ctx, forge, { ...report, template: live.template, status: "refused", message: torn.refusal });
|
|
359
|
-
return fail(torn.refusal);
|
|
360
|
-
}
|
|
361
|
-
const { report: result, dropped, marker } = torn;
|
|
362
|
-
const counts = teardownCounts(result);
|
|
363
|
-
const complete = teardownComplete(result);
|
|
364
|
-
const lexicons = [...new Set(result.outcomes.map((o) => o.lexicon))].sort();
|
|
365
|
-
const head = await headCommit();
|
|
366
|
-
await appendRecord(ctx, {
|
|
367
|
-
version: 1,
|
|
368
|
-
kind: "down",
|
|
369
|
-
pr,
|
|
370
|
-
env,
|
|
371
|
-
...(live.member ? { member: live.member } : {}),
|
|
372
|
-
template: live.template,
|
|
373
|
-
marker,
|
|
374
|
-
commit: head,
|
|
375
|
-
components: lexicons,
|
|
376
|
-
planDigest: "",
|
|
377
|
-
result: complete ? "destroyed" : "incomplete",
|
|
378
|
-
by: actor(),
|
|
379
|
-
timestamp: new Date().toISOString(),
|
|
303
|
+
const result = await prEnvDownRun({
|
|
304
|
+
pr: args.pr,
|
|
380
305
|
reason,
|
|
381
|
-
|
|
382
|
-
|
|
306
|
+
...(member ? { member } : {}),
|
|
307
|
+
ports: cliPorts(ctx, forge),
|
|
308
|
+
...(await teardownSources()),
|
|
309
|
+
plugins: ctx.plugins,
|
|
310
|
+
commit: await headCommit(),
|
|
311
|
+
actor: actor(),
|
|
383
312
|
...(forge?.runUrl ? { runUrl: forge.runUrl } : {}),
|
|
384
313
|
});
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
if (result.unimplemented.length > 0)
|
|
389
|
-
why.push(`no teardown execution in ${result.unimplemented.join(", ")}`);
|
|
390
|
-
if (result.plan.holes.length > 0)
|
|
391
|
-
why.push(`${result.plan.holes.length} part${result.plan.holes.length === 1 ? "" : "s"} could not be read`);
|
|
392
|
-
for (const o of result.outcomes.filter((x) => x.outcome === "failed"))
|
|
393
|
-
why.push(`${o.lexicon} ${o.name}: ${o.detail ?? "failed"}`);
|
|
394
|
-
await finish(ctx, forge, { ...report, template: live.template, status: complete ? "destroyed" : "incomplete", outcomes: counts, ...(why.length > 0 ? { message: why.join("; ") } : {}) });
|
|
395
|
-
console.error((complete ? formatInfo : (m) => formatWarning({ message: m }))(`pr-env down: ${env} ${complete ? "torn down" : "not wholly torn down; it stays live and the sweep tries again"} (${counts.deleted} deleted, ${counts.failed} failed, ${counts.skipped} skipped)`));
|
|
396
|
-
return complete ? PR_ENV_EXIT.done : PR_ENV_EXIT.failed;
|
|
314
|
+
if (result.report.status === "refused")
|
|
315
|
+
return fail(result.report.message ?? "refused");
|
|
316
|
+
return result.exit;
|
|
397
317
|
}
|
|
398
318
|
async function headCommit() {
|
|
399
319
|
const { spawnSync } = await import("node:child_process");
|
|
@@ -405,32 +325,13 @@ async function prEnvSweep(ctx) {
|
|
|
405
325
|
const forge = forgeOf(ctx);
|
|
406
326
|
if (typeof forge === "number")
|
|
407
327
|
return forge;
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
if (!reason && forge?.pullRequestState) {
|
|
418
|
-
try {
|
|
419
|
-
const state = await forge.pullRequestState(e.pr);
|
|
420
|
-
if (state !== "open")
|
|
421
|
-
reason = "closed";
|
|
422
|
-
}
|
|
423
|
-
catch (err) {
|
|
424
|
-
console.error(formatWarning({ message: `could not read whether #${e.pr} is open (${err instanceof Error ? err.message : String(err)}); its TTL still holds` }));
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
if (!reason) {
|
|
428
|
-
console.error(formatInfo(`pr-env sweep: ${e.env} stays; it expires ${e.expiresAt}`));
|
|
429
|
-
continue;
|
|
430
|
-
}
|
|
431
|
-
const c = await teardown(ctx, forge, e.pr, e, reason);
|
|
432
|
-
if (c !== PR_ENV_EXIT.done)
|
|
433
|
-
code = PR_ENV_EXIT.failed;
|
|
434
|
-
}
|
|
435
|
-
return code;
|
|
328
|
+
const result = await prEnvSweepRun({
|
|
329
|
+
ports: cliPorts(ctx, forge),
|
|
330
|
+
...(await teardownSources()),
|
|
331
|
+
plugins: ctx.plugins,
|
|
332
|
+
commit: await headCommit(),
|
|
333
|
+
actor: actor(),
|
|
334
|
+
...(forge?.runUrl ? { runUrl: forge.runUrl } : {}),
|
|
335
|
+
});
|
|
336
|
+
return result.exit;
|
|
436
337
|
}
|
|
@@ -72,6 +72,7 @@ import type { CommandContext } from "../registry.js";
|
|
|
72
72
|
import type { ComponentChangeSignal, FanOutPlan } from "../../components/fan-out.js";
|
|
73
73
|
import { type DriverComponent } from "../../components/driver.js";
|
|
74
74
|
import type { CapabilityRegistry } from "../../components/capability.js";
|
|
75
|
+
import type { ComponentEnvironmentDeclaration } from "../../components/component.js";
|
|
75
76
|
import { type PrHookPlace, type PrLoopHooks } from "../../components/pr-hooks.js";
|
|
76
77
|
import { type PrLoopPolicy } from "../../components/pr-policy.js";
|
|
77
78
|
import type { OpWaveHookMoment } from "../../op/op-waves.js";
|
|
@@ -97,6 +98,8 @@ export interface Prepared {
|
|
|
97
98
|
signal: ComponentChangeSignal;
|
|
98
99
|
registry: CapabilityRegistry;
|
|
99
100
|
seededOutputs: Record<string, Record<string, unknown>>;
|
|
101
|
+
/** Component name to the environments it declares (#3153), whose sites `pr-env up` carries over (#4330). */
|
|
102
|
+
sites?: Record<string, ComponentEnvironmentDeclaration[]>;
|
|
100
103
|
/** `ci.hooks` from the declaration at base (#4288). */
|
|
101
104
|
hooks: PrLoopHooks;
|
|
102
105
|
/** Every hook the stage ran so far, for the report's `hooks`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr.ts"],"names":[],"mappings":"AAAA;;;;;;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GxE;AA8FD,yLAAyL;AACzL,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAYzE;AA+XD,uKAAuK;AACvK,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG1E;AAs3BD;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B9E"}
|
package/dist/cli/handlers/pr.js
CHANGED
|
@@ -218,6 +218,7 @@ export async function prepare(ctx, stage) {
|
|
|
218
218
|
components: derived.components,
|
|
219
219
|
plan: routedAway ? { ...derived.plan, order: [], waves: [], seeds: [], indeterminate: [] } : derived.plan,
|
|
220
220
|
signal: derived.signal,
|
|
221
|
+
...(derived.sites ? { sites: derived.sites } : {}),
|
|
221
222
|
registry,
|
|
222
223
|
seededOutputs,
|
|
223
224
|
hooks,
|
|
@@ -327,6 +327,8 @@ export interface ResolvedComponentTargets {
|
|
|
327
327
|
targets: DriverComponent[];
|
|
328
328
|
/** For a list selector (#3950): the dependencies the closure added that the list did not name, in discovery order. */
|
|
329
329
|
added?: string[];
|
|
330
|
+
/** Component name to the environments it declares (#3153), for the components that declare any (#4330). */
|
|
331
|
+
sites?: Record<string, ComponentEnvironmentDeclaration[]>;
|
|
330
332
|
error?: string;
|
|
331
333
|
}
|
|
332
334
|
/** Whether `selector` is a comma-separated component list (#3950), as opposed to `all` or one name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-support.d.ts","sourceRoot":"","sources":["../../src/components/cli-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAiC,KAAK,SAAS,EAAE,KAAK,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAClH,OAAO,EAQL,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map((component) => toDriverComponent(component));
|
|
285
285
|
if (isComponentList(selector))
|
|
286
286
|
return resolveComponentList(selector, discovered, all);
|
|
287
|
-
if (selector === "all")
|
|
288
|
-
|
|
287
|
+
if (selector === "all") {
|
|
288
|
+
const sites = Object.fromEntries(discovered.filter((c) => c.environments && c.environments.length > 0).map((c) => [c.name, c.environments.map((e) => ({ ...e }))]));
|
|
289
|
+
return { success: true, targets: withoutDisabled(discovered, all), ...(Object.keys(sites).length > 0 ? { sites } : {}) };
|
|
290
|
+
}
|
|
289
291
|
const found = all.find((c) => c.name === selector);
|
|
290
292
|
const disabledByName = discovered.find((c) => c.name === selector && c.enabled === false);
|
|
291
293
|
if (disabledByName) {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import { type ChangedUnits, type ComponentChangeSignal, type FanOutPlan } from "./fan-out.js";
|
|
16
16
|
import type { CapabilityRegistry } from "./capability.js";
|
|
17
17
|
import type { DriverComponent } from "./driver.js";
|
|
18
|
+
import type { ComponentEnvironmentDeclaration } from "./component.js";
|
|
18
19
|
import type { BuildParamProvenance } from "../provenance.js";
|
|
19
20
|
import { type ChantConfig } from "../config.js";
|
|
20
21
|
export interface DeriveFanOutOptions {
|
|
@@ -42,6 +43,8 @@ export interface DerivedFanOut {
|
|
|
42
43
|
/** What the stack-level signal meant in component terms, `unclaimed` included. */
|
|
43
44
|
signal: ComponentChangeSignal;
|
|
44
45
|
plan: FanOutPlan;
|
|
46
|
+
/** Component name to the environments it declares, for the components that declare any (#4330). */
|
|
47
|
+
sites?: Record<string, ComponentEnvironmentDeclaration[]>;
|
|
45
48
|
error?: string;
|
|
46
49
|
}
|
|
47
50
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fan-out-support.d.ts","sourceRoot":"","sources":["../../src/components/fan-out-support.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,EAAkC,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,KAAK,UA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
47
47
|
...(signal.indeterminate.length > 0 ? { indeterminate: signal.indeterminate } : {}),
|
|
48
48
|
...(options.canary?.length ? { canary: options.canary } : {}),
|
|
49
49
|
});
|
|
50
|
-
return { success: true, components, signal, plan };
|
|
50
|
+
return { success: true, components, signal, plan, ...(resolved.sites ? { sites: resolved.sites } : {}) };
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
53
|
* The capability registry a fan-out dispatches through — the project's own,
|