@intentius/chant 0.124.77 → 0.124.78
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/__fixtures__/notify-messages/events.d.ts +9 -0
- package/dist/__fixtures__/notify-messages/events.d.ts.map +1 -0
- package/dist/__fixtures__/notify-messages/events.js +21 -0
- package/dist/__fixtures__/product-words.d.ts +14 -0
- package/dist/__fixtures__/product-words.d.ts.map +1 -1
- package/dist/__fixtures__/product-words.js +11 -0
- package/dist/__fixtures__/terragucci-notify.d.ts +66 -0
- package/dist/__fixtures__/terragucci-notify.d.ts.map +1 -0
- package/dist/__fixtures__/terragucci-notify.js +133 -0
- package/dist/action-pins.d.ts +8 -0
- package/dist/action-pins.d.ts.map +1 -1
- package/dist/action-pins.js +9 -0
- package/dist/agent-guard.d.ts.map +1 -1
- package/dist/agent-guard.js +1 -2
- package/dist/ci-commit.d.ts +66 -2
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +148 -19
- package/dist/ci-own-jobs.d.ts.map +1 -1
- package/dist/ci-own-jobs.js +1 -2
- package/dist/ci-product-words.d.ts +18 -4
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +26 -6
- package/dist/ci-product.d.ts +1 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +3 -4
- package/dist/cli/handlers/release.js +4 -4
- package/dist/components/pr-env-components.d.ts.map +1 -1
- package/dist/components/pr-env-components.js +1 -2
- package/dist/config.d.ts +14 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +16 -1
- package/dist/lexicon.d.ts +8 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lexicon.js +9 -0
- package/dist/lifecycle/release-images.d.ts +77 -3
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +132 -6
- package/dist/notify-product.d.ts +11 -2
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +16 -4
- package/dist/notify-relay.d.ts.map +1 -1
- package/dist/notify-relay.js +1 -2
- package/dist/notify.d.ts +36 -4
- package/dist/notify.d.ts.map +1 -1
- package/dist/notify.js +31 -21
- package/dist/notify.schema.json +1 -0
- package/dist/op/activities/review-product.d.ts +111 -0
- package/dist/op/activities/review-product.d.ts.map +1 -0
- package/dist/op/activities/review-product.js +116 -0
- package/dist/policy-engine.d.ts.map +1 -1
- package/dist/policy-engine.js +1 -2
- package/dist/pr-forge-reads.d.ts +124 -0
- package/dist/pr-forge-reads.d.ts.map +1 -0
- package/dist/pr-forge-reads.js +322 -0
- package/dist/pr-forge.d.ts +14 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +21 -13
- package/dist/pr-plan-note.d.ts +293 -0
- package/dist/pr-plan-note.d.ts.map +1 -0
- package/dist/pr-plan-note.js +362 -0
- package/dist/release-floors.d.ts +9 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +9 -1
- package/dist/state-export.d.ts.map +1 -1
- package/dist/state-export.js +1 -2
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +1 -2
- package/dist/state-unlock.d.ts.map +1 -1
- package/dist/state-unlock.js +1 -2
- package/dist/wave-runtime.mjs +271 -271
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +2 -1
- package/package.json +1 -1
- package/src/__fixtures__/notify-messages/events.ts +23 -0
- package/src/__fixtures__/notify-messages/messages.json +50 -0
- package/src/__fixtures__/pr-loop/terragucci-plan.note.golden.md +53 -0
- package/src/__fixtures__/pr-loop/terragucci-plan.note.json +83 -0
- package/src/__fixtures__/product-words.ts +12 -0
- package/src/__fixtures__/review-agent/terragucci-review.json +94 -0
- package/src/__fixtures__/terragucci-notify.ts +170 -0
- package/src/action-pins.test.ts +12 -1
- package/src/action-pins.ts +11 -0
- package/src/agent-guard.test.ts +1 -2
- package/src/agent-guard.ts +1 -2
- package/src/ci-commit.test.ts +163 -0
- package/src/ci-commit.ts +168 -21
- package/src/ci-own-jobs.test.ts +1 -2
- package/src/ci-own-jobs.ts +1 -2
- package/src/ci-product-words.ts +35 -7
- package/src/ci-product.ts +3 -4
- package/src/cli/handlers/build-pr-loop-control.test.ts +1 -2
- package/src/cli/handlers/build-run-group.test.ts +1 -2
- package/src/cli/handlers/release.ts +5 -5
- package/src/components/pr-env-components.test.ts +1 -2
- package/src/components/pr-env-components.ts +1 -2
- package/src/config.ts +23 -3
- package/src/gate-policy-bundle.test.ts +1 -1
- package/src/lexicon.ts +10 -0
- package/src/lifecycle/release-images-dockerfile.test.ts +221 -0
- package/src/lifecycle/release-images.ts +167 -8
- package/src/notify-message-words.test.ts +186 -0
- package/src/notify-product.ts +17 -4
- package/src/notify-relay.ts +1 -2
- package/src/notify.schema.json +1 -0
- package/src/notify.ts +59 -19
- package/src/op/activities/review-product.test.ts +116 -0
- package/src/op/activities/review-product.ts +200 -0
- package/src/op/schedule-overdue.test.ts +26 -0
- package/src/policy-engine.test.ts +1 -2
- package/src/policy-engine.ts +1 -2
- package/src/pr-forge-reads.test.ts +285 -0
- package/src/pr-forge-reads.ts +424 -0
- package/src/pr-forge.ts +30 -16
- package/src/pr-plan-note.test.ts +105 -0
- package/src/pr-plan-note.ts +521 -0
- package/src/release-floors.ts +13 -1
- package/src/state-export.test.ts +1 -2
- package/src/state-export.ts +1 -2
- package/src/state-migration.test.ts +1 -2
- package/src/state-migration.ts +1 -2
- package/src/state-unlock.test.ts +1 -2
- package/src/state-unlock.ts +1 -2
- package/src/workspace/release-workflow.ts +2 -1
package/src/ci-own-jobs.test.ts
CHANGED
|
@@ -9,7 +9,6 @@ import { join } from "node:path";
|
|
|
9
9
|
import { describe, expect, test } from "vitest";
|
|
10
10
|
import { isGeneratedJob, jobNames, keepOwnJobs, mergeOwnJobs, OWN_JOBS_LINE, OwnJobsError, readOwnJobsFile } from "./ci-own-jobs";
|
|
11
11
|
import * as ciProduct from "./ci-product";
|
|
12
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
13
12
|
|
|
14
13
|
const GITHUB = ["name: chant", "on:", " pull_request:", "jobs:", " plan:", " runs-on: ubuntu-latest", " steps:", " - run: chant components pr-plan prod", " plan-note:", " runs-on: ubuntu-latest", " steps:", " - run: chant components pr-post prod", ""].join("\n");
|
|
15
14
|
const GITLAB = ["stages:", " - plan", "variables:", " A: b", "plan:", " stage: plan", " script:", " - chant components pr-plan prod", ""].join("\n");
|
|
@@ -103,7 +102,7 @@ describe("keepOwnJobs", () => {
|
|
|
103
102
|
});
|
|
104
103
|
|
|
105
104
|
test("the ci-product entry carries both, and OWN_JOBS_FLOOR marks them", () => {
|
|
106
|
-
expect(ciProduct.OWN_JOBS_FLOOR).toBe(
|
|
105
|
+
expect(ciProduct.OWN_JOBS_FLOOR).toBe("0.124.77");
|
|
107
106
|
expect(typeof ciProduct.mergeOwnJobs).toBe("function");
|
|
108
107
|
expect(typeof ciProduct.keepOwnJobs).toBe("function");
|
|
109
108
|
});
|
package/src/ci-own-jobs.ts
CHANGED
|
@@ -22,10 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
import { readFileSync } from "node:fs";
|
|
24
24
|
import { emitYAMLEntry, parseYAMLDocument } from "./yaml";
|
|
25
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
26
25
|
|
|
27
26
|
/** The first chant with `mergeOwnJobs`, `keepOwnJobs` and `chant build --own-jobs` / `--keep-own-jobs` (#4769). Products feature-detect on it. */
|
|
28
|
-
export const OWN_JOBS_FLOOR =
|
|
27
|
+
export const OWN_JOBS_FLOOR = "0.124.77";
|
|
29
28
|
|
|
30
29
|
/** The forges whose pipeline files take own jobs. */
|
|
31
30
|
export type OwnJobsForge = "github" | "gitlab" | "forgejo";
|
package/src/ci-product-words.ts
CHANGED
|
@@ -19,10 +19,12 @@
|
|
|
19
19
|
* command's lifetime. Every renderer here reads {@link activeProductWords}
|
|
20
20
|
* when it is given none.
|
|
21
21
|
*
|
|
22
|
-
* This module imports nothing
|
|
23
|
-
* pr-loop-bundle.test.ts) carries it.
|
|
22
|
+
* This module imports nothing at run time (the one import is a type): the
|
|
23
|
+
* pull request loop bundle (pr-loop.ts, pr-loop-bundle.test.ts) carries it.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
+
import type { NotifyMessageWords } from "./notify";
|
|
27
|
+
|
|
26
28
|
/** The stages a product names: the status context after the prefix, and the word in the note. */
|
|
27
29
|
export type CiProductStage = "plan" | "apply" | "record" | "check" | "drift" | "lock" | "approval" | "control";
|
|
28
30
|
|
|
@@ -139,6 +141,8 @@ export interface CiProductNotifyWordsInput {
|
|
|
139
141
|
wave?: string;
|
|
140
142
|
/** The signed webhook's header prefix. Default `x-<product>`, so chant's stays `x-chant`. */
|
|
141
143
|
headers?: string;
|
|
144
|
+
/** The labels, re-run button and other words of chant's Slack and Teams messages (#4818). Default: chant's. */
|
|
145
|
+
message?: NotifyMessageWords;
|
|
142
146
|
}
|
|
143
147
|
|
|
144
148
|
/** The notify slots, filled. */
|
|
@@ -146,6 +150,7 @@ export interface CiProductNotifyWords {
|
|
|
146
150
|
source: string;
|
|
147
151
|
wave: string;
|
|
148
152
|
headers: string;
|
|
153
|
+
message?: NotifyMessageWords;
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
/** chant's own wave label in a notify summary. */
|
|
@@ -220,6 +225,7 @@ export function resolveProductWords(input: CiProductWordsInput | CiProductWords
|
|
|
220
225
|
source: input.notify?.source ?? product,
|
|
221
226
|
wave: input.notify?.wave ?? CHANT_NOTIFY_WAVE_TEMPLATE,
|
|
222
227
|
headers: input.notify?.headers ?? `x-${product}`,
|
|
228
|
+
...(input.notify?.message ? { message: input.notify.message } : {}),
|
|
223
229
|
},
|
|
224
230
|
};
|
|
225
231
|
}
|
|
@@ -465,7 +471,7 @@ export type ParsedProductComment =
|
|
|
465
471
|
*/
|
|
466
472
|
| { kind: "action"; member: string; address: string }
|
|
467
473
|
/** A commit job's command (#4722), by the word typed: `/terragucci fmt`. Several words may each map onto `commit`. */
|
|
468
|
-
| { kind: "commit"; word: string }
|
|
474
|
+
| { kind: "commit"; word: string; arg?: string }
|
|
469
475
|
| { kind: "refused"; reason: string };
|
|
470
476
|
|
|
471
477
|
/** A member as a comment may name it: path segments, no leading dash, no shell or glob syntax. */
|
|
@@ -483,6 +489,12 @@ const TARGET = /^[A-Za-z0-9_][A-Za-z0-9_.:\/\[\]"*@=+$,-]{0,499}$/;
|
|
|
483
489
|
* No leading dash, no spaces, no shell or glob syntax.
|
|
484
490
|
*/
|
|
485
491
|
const ACTION = /^[A-Za-z_][A-Za-z0-9_.\[\]"-]{0,299}$/;
|
|
492
|
+
/**
|
|
493
|
+
* The one argument a commit word may take after it (#4820), on top of the
|
|
494
|
+
* product's own pattern: a plain name, no leading dash, no path or shell
|
|
495
|
+
* syntax, at most 100 characters.
|
|
496
|
+
*/
|
|
497
|
+
export const COMMIT_COMMENT_ARG = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$/;
|
|
486
498
|
/** The longest ask an agent comment may carry. */
|
|
487
499
|
export const PRODUCT_COMMENT_ASK_MAX = 2000;
|
|
488
500
|
/** Commands a comment never runs, named in the reply so nobody waits on them. */
|
|
@@ -496,9 +508,17 @@ const NEVER = new Set(["approve", "override", "force-unlock", "unlock-state", "i
|
|
|
496
508
|
* comment is untrusted input: only a member path checked against a pattern
|
|
497
509
|
* with no shell syntax, and a wave number, leave this function.
|
|
498
510
|
*
|
|
499
|
-
* `env` turns on an alias whose `when` variable is `1` there.
|
|
511
|
+
* `env` turns on an alias whose `when` variable is `1` there. `commitArgs`
|
|
512
|
+
* names the commit words that take one argument after them (#4820), each
|
|
513
|
+
* with the pattern it must match; it must also match
|
|
514
|
+
* {@link COMMIT_COMMENT_ARG}. Any other commit word takes nothing.
|
|
500
515
|
*/
|
|
501
|
-
export function parseProductComment(
|
|
516
|
+
export function parseProductComment(
|
|
517
|
+
words: CiProductWords,
|
|
518
|
+
body: unknown,
|
|
519
|
+
env: Record<string, string | undefined> = {},
|
|
520
|
+
commitArgs: Readonly<Record<string, RegExp>> = {},
|
|
521
|
+
): ParsedProductComment | undefined {
|
|
502
522
|
if (typeof body !== "string") return undefined;
|
|
503
523
|
let text = body.trim();
|
|
504
524
|
const prefix = `/${words.product}`;
|
|
@@ -541,8 +561,16 @@ export function parseProductComment(words: CiProductWords, body: unknown, env: R
|
|
|
541
561
|
case "lock":
|
|
542
562
|
case "unlock":
|
|
543
563
|
return parts.length === 2 ? { kind: command } : { kind: "refused", reason: `${line} takes nothing after it` };
|
|
544
|
-
case "commit":
|
|
545
|
-
|
|
564
|
+
case "commit": {
|
|
565
|
+
if (parts.length === 2) return { kind: "commit", word: typed };
|
|
566
|
+
const pattern = Object.prototype.hasOwnProperty.call(commitArgs, typed) ? commitArgs[typed] : undefined;
|
|
567
|
+
if (pattern === undefined) return { kind: "refused", reason: `${line} takes nothing after it` };
|
|
568
|
+
const arg = parts[2]!;
|
|
569
|
+
if (parts.length !== 3 || !COMMIT_COMMENT_ARG.test(arg) || !pattern.test(arg)) {
|
|
570
|
+
return { kind: "refused", reason: `${line} takes nothing, or one name after it matching \`${pattern.source}\`` };
|
|
571
|
+
}
|
|
572
|
+
return { kind: "commit", word: typed, arg };
|
|
573
|
+
}
|
|
546
574
|
case "agent": {
|
|
547
575
|
const ask = text.slice(`${prefix} ${typed}`.length).trim();
|
|
548
576
|
if (ask === "") return { kind: "refused", reason: `${line} needs an ask after it, on the same line` };
|
package/src/ci-product.ts
CHANGED
|
@@ -13,7 +13,6 @@ import type { CiProductWords, CiProductWordsInput } from "./ci-product-words";
|
|
|
13
13
|
import type { ProductMcpHook } from "./cli/mcp/product-tools";
|
|
14
14
|
import type { ProductWaveHook } from "./op/op-waves-after-plan";
|
|
15
15
|
import { OTLP_EXPORTER_FLOOR } from "./otlp";
|
|
16
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* The first chant with the product pipeline (#4550): the words, the
|
|
@@ -65,7 +64,7 @@ export {
|
|
|
65
64
|
type ParsedProductComment,
|
|
66
65
|
type ProductActionRequest,
|
|
67
66
|
} from "./ci-product-words";
|
|
68
|
-
export { driftNotifyFields, productNotifySource, productNotifyWords, productSendOptions, type DriftNotifyInput } from "./notify-product";
|
|
67
|
+
export { driftNotifyFields, NOTIFY_MESSAGE_WORDS_FLOOR, productNotifySource, productNotifyWords, productSendOptions, type DriftNotifyInput } from "./notify-product";
|
|
69
68
|
|
|
70
69
|
/** The first chant with `chant notify relay` and the notify relay buttons (#4611). */
|
|
71
70
|
export const NOTIFY_RELAY_FLOOR = "0.124.55";
|
|
@@ -209,7 +208,7 @@ export {
|
|
|
209
208
|
* group of its own keeps it, and GitHub and GitLab files are unchanged. A
|
|
210
209
|
* product feature-detects on this floor.
|
|
211
210
|
*/
|
|
212
|
-
export const FORGEJO_RUN_GROUP_FLOOR =
|
|
211
|
+
export const FORGEJO_RUN_GROUP_FLOOR = "0.124.77";
|
|
213
212
|
export { RUN_GROUP_KEYS, type RunGroupKey } from "./lexicon";
|
|
214
213
|
|
|
215
214
|
/**
|
|
@@ -220,7 +219,7 @@ export { RUN_GROUP_KEYS, type RunGroupKey } from "./lexicon";
|
|
|
220
219
|
* the step `productPipelineJobs(...).post.control` returns. A product that
|
|
221
220
|
* writes its pipeline with the build feature-detects on this floor.
|
|
222
221
|
*/
|
|
223
|
-
export const PR_LOOP_CONTROL_FLOOR =
|
|
222
|
+
export const PR_LOOP_CONTROL_FLOOR = "0.124.77";
|
|
224
223
|
export {
|
|
225
224
|
CI_RESPOND_DEFAULTS,
|
|
226
225
|
CI_RESPOND_ENV,
|
|
@@ -83,6 +83,5 @@ describe("build --pr-loop --control", () => {
|
|
|
83
83
|
|
|
84
84
|
test("PR_LOOP_CONTROL_FLOOR marks it in the ci-product entry", async () => {
|
|
85
85
|
const ciProduct = await import("../../ci-product");
|
|
86
|
-
|
|
87
|
-
expect((ciProduct as Record<string, unknown>).PR_LOOP_CONTROL_FLOOR).toBe(NEXT_RELEASE);
|
|
86
|
+
expect((ciProduct as Record<string, unknown>).PR_LOOP_CONTROL_FLOOR).toBe("0.124.77");
|
|
88
87
|
});
|
|
@@ -54,7 +54,6 @@ describe("--run-group", () => {
|
|
|
54
54
|
|
|
55
55
|
test("FORGEJO_RUN_GROUP_FLOOR marks it in the ci-product entry", async () => {
|
|
56
56
|
const ciProduct = await import("../../ci-product");
|
|
57
|
-
|
|
58
|
-
expect(ciProduct.FORGEJO_RUN_GROUP_FLOOR).toBe(NEXT_RELEASE);
|
|
57
|
+
expect(ciProduct.FORGEJO_RUN_GROUP_FLOOR).toBe("0.124.77");
|
|
59
58
|
expect(ciProduct.RUN_GROUP_KEYS).toEqual(["commit", "pull-request"]);
|
|
60
59
|
});
|
|
@@ -114,8 +114,8 @@ async function laneOf(ctx: CommandContext, cwd: string): Promise<string | undefi
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
/** The member's `release.images` (#4657), or none when the config declares none. */
|
|
118
|
-
async function releaseImagesOf(cwd: string): Promise<
|
|
117
|
+
/** The member's `release.images` (#4657), or none when the config declares none. A Dockerfile entry (#4819) keeps its form, so its prepare command runs. */
|
|
118
|
+
async function releaseImagesOf(cwd: string): Promise<import("../../lifecycle/release-images").ReleaseImageDeclaration[]> {
|
|
119
119
|
const { loadChantConfig } = await import("../../config");
|
|
120
120
|
return (await loadChantConfig(cwd)).config.release?.images ?? [];
|
|
121
121
|
}
|
|
@@ -155,7 +155,7 @@ export async function runReleaseImages(ctx: CommandContext): Promise<number> {
|
|
|
155
155
|
if (!ref) return fail("release-not-named", "release images needs a release, by label or digest", USAGE);
|
|
156
156
|
const cwd = resolve(".");
|
|
157
157
|
const { resolveRelease } = await import("../../lifecycle/release-store");
|
|
158
|
-
const { buildReleaseImages, releaseImageDigests, writeReleaseDigests, ReleaseImageError, RELEASE_DIGESTS_ENV } = await import("../../lifecycle/release-images");
|
|
158
|
+
const { buildReleaseImages, releaseImageDigests, resolveReleaseImages, writeReleaseDigests, ReleaseImageError, RELEASE_DIGESTS_ENV } = await import("../../lifecycle/release-images");
|
|
159
159
|
const { ociArchiveDigest } = await import("../../lifecycle/publish-oci");
|
|
160
160
|
const { getHeadCommit } = await import("../../lifecycle/git");
|
|
161
161
|
const found = await resolveRelease(ref, { cwd });
|
|
@@ -171,7 +171,7 @@ export async function runReleaseImages(ctx: CommandContext): Promise<number> {
|
|
|
171
171
|
try {
|
|
172
172
|
// --no-build: the archives the cut built were handed to this job, so they are read as they are.
|
|
173
173
|
built = args.noBuild
|
|
174
|
-
? declared.map((d) => {
|
|
174
|
+
? resolveReleaseImages(declared).map((d) => {
|
|
175
175
|
const abs = resolve(cwd, d.archive);
|
|
176
176
|
if (!existsSync(abs)) throw new ReleaseImageError("release-image-no-archive", `image "${d.name}" has no archive at ${d.archive}`, "Hand this job the archives the cut built, or run without --no-build to build them again.");
|
|
177
177
|
return { component: d.name, kind: "image" as const, path: d.archive, digest: ociArchiveDigest(abs) };
|
|
@@ -473,7 +473,7 @@ export async function runReleaseCut(ctx: CommandContext): Promise<number> {
|
|
|
473
473
|
// #4657: under --at the images were built in the commit's own checkout, which is removed below; the archives the
|
|
474
474
|
// release records are put where release.images names them here, so the job's next step (the hand-off to the
|
|
475
475
|
// publish job) finds them.
|
|
476
|
-
if (checkout && declaredImages.length > 0) copyImageArchives(declaredImages, cutCwd, cwd);
|
|
476
|
+
if (checkout && declaredImages.length > 0) copyImageArchives((await import("../../lifecycle/release-images")).resolveReleaseImages(declaredImages), cutCwd, cwd);
|
|
477
477
|
const push = await pushLifecycleReport({ cwd }).catch(() => ({ pushed: false, pushWarning: undefined }));
|
|
478
478
|
// The tag names the release's label, which a re-cut with no label reads from the earlier cut.
|
|
479
479
|
let tagged: { name: string; created: boolean } | null = null;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* that records what it was asked. No engine, ledger or forge is reached.
|
|
5
5
|
*/
|
|
6
6
|
import { describe, expect, test } from "vitest";
|
|
7
|
-
import { NEXT_RELEASE } from "../release-floors";
|
|
8
7
|
import { componentsPrEnvAdapter, componentsPrEnvTeardown, PR_ENV_COMPONENTS_FLOOR, type PrEnvComponentPlan } from "./pr-env-components";
|
|
9
8
|
import { prEnvDown, prEnvUp, type PrEnvApproval, type PrEnvPorts } from "./pr-env-run";
|
|
10
9
|
import { livePrEnvironments, type PrEnvRecord } from "./pr-environment";
|
|
@@ -133,6 +132,6 @@ describe("componentsPrEnvTeardown", () => {
|
|
|
133
132
|
});
|
|
134
133
|
|
|
135
134
|
test("its floor is the next release", () => {
|
|
136
|
-
expect(PR_ENV_COMPONENTS_FLOOR).toBe(
|
|
135
|
+
expect(PR_ENV_COMPONENTS_FLOOR).toBe("0.124.77");
|
|
137
136
|
});
|
|
138
137
|
});
|
|
@@ -23,12 +23,11 @@
|
|
|
23
23
|
*/
|
|
24
24
|
import { waveSetDigest } from "../gated-waves";
|
|
25
25
|
import type { TeardownOutcome } from "../lexicon";
|
|
26
|
-
import { NEXT_RELEASE } from "../release-floors";
|
|
27
26
|
import type { PrEnvAdapter, PrEnvPlanned, PrEnvTarget } from "./pr-env-run";
|
|
28
27
|
import type { LivePrEnvironment, PrEnvReportRow, PrEnvTeardownAdapter } from "./pr-environment";
|
|
29
28
|
|
|
30
29
|
/** The first chant with the component adapter and teardown, and the terraform lexicon's copies on them (#4762). */
|
|
31
|
-
export const PR_ENV_COMPONENTS_FLOOR =
|
|
30
|
+
export const PR_ENV_COMPONENTS_FLOOR = "0.124.77";
|
|
32
31
|
|
|
33
32
|
/** One component's plan, as an engine answers it. */
|
|
34
33
|
export interface PrEnvComponentPlan {
|
package/src/config.ts
CHANGED
|
@@ -109,7 +109,24 @@ export const ChantConfigSchema = z.object({
|
|
|
109
109
|
release: z.object({
|
|
110
110
|
autoRecord: z.boolean().optional(),
|
|
111
111
|
publish: z.array(PublishDeclarationSchema).optional(),
|
|
112
|
-
images: z
|
|
112
|
+
images: z
|
|
113
|
+
.array(
|
|
114
|
+
z.union([
|
|
115
|
+
z.object({ name: z.string().min(1), build: z.string().min(1), archive: z.string().min(1) }).strict(),
|
|
116
|
+
// #4819: chant builds the Dockerfile as the reproducible OCI archive itself.
|
|
117
|
+
z
|
|
118
|
+
.object({
|
|
119
|
+
name: z.string().min(1),
|
|
120
|
+
dockerfile: z.string().min(1),
|
|
121
|
+
context: z.string().min(1).optional(),
|
|
122
|
+
platforms: z.array(z.string().min(1)).min(1).optional(),
|
|
123
|
+
archive: z.string().min(1).optional(),
|
|
124
|
+
prepare: z.string().min(1).optional(),
|
|
125
|
+
})
|
|
126
|
+
.strict(),
|
|
127
|
+
]),
|
|
128
|
+
)
|
|
129
|
+
.optional(),
|
|
113
130
|
lane: z.string().regex(/^[a-z0-9][a-z0-9-]*$/, "a ci.green lane name: lowercase letters, digits and dashes").optional(),
|
|
114
131
|
workflow: z.object({
|
|
115
132
|
trigger: z.enum(["tag", "dispatch"]).optional(),
|
|
@@ -393,9 +410,12 @@ export interface ChantConfig {
|
|
|
393
410
|
* `build` writes the OCI archive at `archive`, and the cut records its
|
|
394
411
|
* digest and hands every digest to the build through `CHANT_RELEASE_DIGESTS`,
|
|
395
412
|
* so a package can pin the images it ships with. An `oci` target pushes
|
|
396
|
-
* the archive.
|
|
413
|
+
* the archive. An entry may name a `dockerfile` (with `context`,
|
|
414
|
+
* `platforms`, `archive` and `prepare`) in place of `build`, and chant
|
|
415
|
+
* runs the reproducible build itself (#4819). See
|
|
416
|
+
* ./lifecycle/release-images.ts.
|
|
397
417
|
*/
|
|
398
|
-
images?:
|
|
418
|
+
images?: import("./lifecycle/release-images").ReleaseImageDeclaration[];
|
|
399
419
|
/**
|
|
400
420
|
* The green lane `chant release cut` and `chant release candidates` check
|
|
401
421
|
* when `--lane` is not given (#4692): one `ci.green.lanes` declares in
|
|
@@ -37,6 +37,6 @@ describe("the gate-policy bundle", () => {
|
|
|
37
37
|
outdir: "out",
|
|
38
38
|
logLevel: "silent",
|
|
39
39
|
});
|
|
40
|
-
expect(Object.keys(result.metafile.inputs).map((i) => i.replace(/^.*?packages\//, "packages/")).sort()).toEqual(["packages/core/src/policy-engine.ts"
|
|
40
|
+
expect(Object.keys(result.metafile.inputs).map((i) => i.replace(/^.*?packages\//, "packages/")).sort()).toEqual(["packages/core/src/policy-engine.ts"]);
|
|
41
41
|
});
|
|
42
42
|
});
|
package/src/lexicon.ts
CHANGED
|
@@ -47,6 +47,7 @@ import type { DisruptionQuery, DisruptionVerdict } from "./lifecycle/disruption"
|
|
|
47
47
|
import type { OwnerChainVerdict } from "./owner-chain";
|
|
48
48
|
import type { CommandGroup } from "./cli/command-group";
|
|
49
49
|
import type { Archetype } from "./components/component";
|
|
50
|
+
import { NEXT_RELEASE } from "./release-floors";
|
|
50
51
|
|
|
51
52
|
// Re-exported so a lexicon that hosts Op runs (#2121) can type its
|
|
52
53
|
// `opRuntime` from the same entry it imports the plugin contract from.
|
|
@@ -1314,6 +1315,15 @@ export interface CompositeEntry {
|
|
|
1314
1315
|
archetype?: Archetype;
|
|
1315
1316
|
}
|
|
1316
1317
|
|
|
1318
|
+
/**
|
|
1319
|
+
* The first chant whose Pulumi lexicon's ci-setup installs a release without
|
|
1320
|
+
* linking it onto PATH (`link: false`) and exports the fetch-and-check script
|
|
1321
|
+
* for image builds (`ciFetchScript`, #4814). It lives here, beside
|
|
1322
|
+
* {@link LexiconPlugin.ciSetup}, so it freezes with chant's release; the
|
|
1323
|
+
* lexicon re-exports it as `PULUMI_CI_SETUP_FLOOR`.
|
|
1324
|
+
*/
|
|
1325
|
+
export const CI_SETUP_UNLINKED_FLOOR = NEXT_RELEASE;
|
|
1326
|
+
|
|
1317
1327
|
export interface LexiconPlugin {
|
|
1318
1328
|
// ── Required ──────────────────────────────────────────────
|
|
1319
1329
|
/** Human-readable name (e.g. "aws", "gcp") */
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #4819: a `release.images` entry that names a Dockerfile, which chant builds
|
|
3
|
+
* as the reproducible OCI archive itself, and the helpers that turn the cut's
|
|
4
|
+
* digests file and a product's `{ name: reference }` into the table its
|
|
5
|
+
* bundle bakes in and the pins file its npm target reads. terragucci's and
|
|
6
|
+
* plywood's `scripts/release-image.sh` and `releaseDigests` are what these
|
|
7
|
+
* replace; the expectations below are what those wrote.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { spawnSync } from "node:child_process";
|
|
11
|
+
import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { tmpdir } from "node:os";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
import { describe, expect, test } from "vitest";
|
|
15
|
+
import { ChantConfigSchema } from "../config";
|
|
16
|
+
import { NEXT_RELEASE } from "../release-floors";
|
|
17
|
+
import {
|
|
18
|
+
buildReleaseImages,
|
|
19
|
+
checkReleaseImages,
|
|
20
|
+
RELEASE_DIGESTS_ENV,
|
|
21
|
+
RELEASE_IMAGE_BUILDER,
|
|
22
|
+
RELEASE_IMAGE_DOCKERFILE_FLOOR,
|
|
23
|
+
releaseImageBuildCommand,
|
|
24
|
+
releaseImagePins,
|
|
25
|
+
ReleaseImageError,
|
|
26
|
+
resolveReleaseImages,
|
|
27
|
+
writeReleaseImagePins,
|
|
28
|
+
type ReleaseImageDeclaration,
|
|
29
|
+
} from "./release-images";
|
|
30
|
+
|
|
31
|
+
const D = (c: string) => `sha256:${c.repeat(64)}`;
|
|
32
|
+
const scratch = () => mkdtempSync(join(tmpdir(), "chant-release-image-"));
|
|
33
|
+
|
|
34
|
+
describe("a release.images entry that names a Dockerfile (#4819)", () => {
|
|
35
|
+
test("chant builds it the way both products' release-image.sh did", () => {
|
|
36
|
+
expect(releaseImageBuildCommand({ name: "pulumi", dockerfile: "images/plywood-pulumi/Dockerfile" })).toBe(
|
|
37
|
+
[
|
|
38
|
+
`{ docker buildx inspect ${RELEASE_IMAGE_BUILDER} >/dev/null 2>&1 || docker buildx create --name ${RELEASE_IMAGE_BUILDER} --driver docker-container >/dev/null; }`,
|
|
39
|
+
"mkdir -p dist/images",
|
|
40
|
+
'docker buildx build --builder chant-release --no-cache --platform linux/amd64,linux/arm64 --provenance=false --sbom=false --build-arg SOURCE_DATE_EPOCH="$SOURCE_DATE_EPOCH" --output type=oci,dest=dist/images/pulumi.tar,rewrite-timestamp=true -f images/plywood-pulumi/Dockerfile . >&2',
|
|
41
|
+
].join(" && "),
|
|
42
|
+
);
|
|
43
|
+
const own = releaseImageBuildCommand({ name: "tofu", dockerfile: "images/Dockerfile.tofu", context: "images/ctx", platforms: ["linux/amd64"], archive: "out/tofu image.tar" });
|
|
44
|
+
expect(own).toContain("--platform linux/amd64 ");
|
|
45
|
+
expect(own).toContain("--output 'type=oci,dest=out/tofu image.tar,rewrite-timestamp=true' -f images/Dockerfile.tofu images/ctx >&2");
|
|
46
|
+
expect(own).toContain("mkdir -p out && ");
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test("the archive defaults to dist/images/<name>.tar, and a build entry is as it was", () => {
|
|
50
|
+
const images: ReleaseImageDeclaration[] = [
|
|
51
|
+
{ name: "pulumi", dockerfile: "images/plywood-pulumi/Dockerfile" },
|
|
52
|
+
{ name: "old", build: "scripts/release-image.sh old", archive: "dist/images/old.tar" },
|
|
53
|
+
];
|
|
54
|
+
expect(resolveReleaseImages(images).map((i) => [i.name, i.archive])).toEqual([
|
|
55
|
+
["pulumi", "dist/images/pulumi.tar"],
|
|
56
|
+
["old", "dist/images/old.tar"],
|
|
57
|
+
]);
|
|
58
|
+
expect(resolveReleaseImages(images)[1]).toEqual({ name: "old", build: "scripts/release-image.sh old", archive: "dist/images/old.tar" });
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test("the prepare command runs once, before the builds, with no digests file named", () => {
|
|
62
|
+
const cwd = scratch();
|
|
63
|
+
const runs: { command: string; digests: string | undefined; epoch: string | undefined }[] = [];
|
|
64
|
+
const prepare = "npm run build && npm pack -w @intentius/plywood --pack-destination images/pack";
|
|
65
|
+
const built = buildReleaseImages({
|
|
66
|
+
images: [
|
|
67
|
+
{ name: "pulumi", dockerfile: "images/plywood-pulumi/Dockerfile", prepare },
|
|
68
|
+
{ name: "plunge", dockerfile: "images/plywood-plunge/Dockerfile", prepare },
|
|
69
|
+
],
|
|
70
|
+
cwd,
|
|
71
|
+
sourceDateEpoch: 1_700_000_000,
|
|
72
|
+
label: "0.3.0",
|
|
73
|
+
env: { PATH: process.env.PATH, [RELEASE_DIGESTS_ENV]: "/tmp/stale.json" },
|
|
74
|
+
archiveDigest: (abs) => (abs.endsWith("pulumi.tar") ? D("a") : D("b")),
|
|
75
|
+
run: (command, o) => {
|
|
76
|
+
runs.push({ command, digests: o.env[RELEASE_DIGESTS_ENV], epoch: o.env.SOURCE_DATE_EPOCH });
|
|
77
|
+
const m = /dest=([^,]+),/.exec(command);
|
|
78
|
+
if (m) {
|
|
79
|
+
mkdirSync(join(cwd, "dist/images"), { recursive: true });
|
|
80
|
+
writeFileSync(join(cwd, m[1]!), "");
|
|
81
|
+
}
|
|
82
|
+
return 0;
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
expect(runs.map((r) => r.command.slice(0, 20))).toEqual([prepare.slice(0, 20), "{ docker buildx insp", "{ docker buildx insp"]);
|
|
86
|
+
expect(runs[0]!.digests).toBeUndefined();
|
|
87
|
+
expect(runs.every((r) => r.epoch === "1700000000")).toBe(true);
|
|
88
|
+
expect(built).toEqual([
|
|
89
|
+
{ component: "pulumi", kind: "image", path: "dist/images/pulumi.tar", digest: D("a") },
|
|
90
|
+
{ component: "plunge", kind: "image", path: "dist/images/plunge.tar", digest: D("b") },
|
|
91
|
+
]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test("run: the command reaches docker as the argv both scripts passed", () => {
|
|
95
|
+
const cwd = scratch();
|
|
96
|
+
const bin = join(cwd, "bin");
|
|
97
|
+
mkdirSync(bin);
|
|
98
|
+
const log = join(cwd, "docker.log");
|
|
99
|
+
// A docker that records its argv, and writes the archive --output names.
|
|
100
|
+
writeFileSync(
|
|
101
|
+
join(bin, "docker"),
|
|
102
|
+
`#!/bin/sh\nprintf '%s\\n' "$*" >> "${log}"\nfor a in "$@"; do case "$a" in type=oci,dest=*) d="\${a#type=oci,dest=}"; d="\${d%%,*}"; : > "$d" ;; esac; done\nexit 0\n`,
|
|
103
|
+
);
|
|
104
|
+
chmodSync(join(bin, "docker"), 0o755);
|
|
105
|
+
buildReleaseImages({
|
|
106
|
+
images: [{ name: "tofu", dockerfile: "images/Dockerfile.tofu" }],
|
|
107
|
+
cwd,
|
|
108
|
+
sourceDateEpoch: 42,
|
|
109
|
+
label: null,
|
|
110
|
+
env: { ...process.env, PATH: `${bin}:${process.env.PATH}` },
|
|
111
|
+
archiveDigest: () => D("c"),
|
|
112
|
+
});
|
|
113
|
+
const calls = readFileSync(log, "utf-8").trim().split("\n");
|
|
114
|
+
expect(calls).toEqual([
|
|
115
|
+
"buildx inspect chant-release",
|
|
116
|
+
"buildx build --builder chant-release --no-cache --platform linux/amd64,linux/arm64 --provenance=false --sbom=false --build-arg SOURCE_DATE_EPOCH=42 --output type=oci,dest=dist/images/tofu.tar,rewrite-timestamp=true -f images/Dockerfile.tofu .",
|
|
117
|
+
]);
|
|
118
|
+
expect(existsSync(join(cwd, "dist/images/tofu.tar"))).toBe(true);
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
test("an entry with both build and dockerfile, a path outside the member, or a bad platform is refused", () => {
|
|
122
|
+
const refused = (i: unknown) => {
|
|
123
|
+
try {
|
|
124
|
+
checkReleaseImages([i as ReleaseImageDeclaration]);
|
|
125
|
+
return "";
|
|
126
|
+
} catch (e) {
|
|
127
|
+
return (e as ReleaseImageError).code;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
expect(refused({ name: "a", dockerfile: "D", build: "x", archive: "a.tar" })).toBe("release-image-invalid");
|
|
131
|
+
expect(refused({ name: "a", dockerfile: "../D" })).toBe("release-image-archive-outside");
|
|
132
|
+
expect(refused({ name: "a", dockerfile: "D", context: "/abs" })).toBe("release-image-archive-outside");
|
|
133
|
+
expect(refused({ name: "a", dockerfile: "D", platforms: ["linux/amd64; rm"] })).toBe("release-image-invalid");
|
|
134
|
+
expect(refused({ name: "a", dockerfile: "D", platforms: [] })).toBe("release-image-invalid");
|
|
135
|
+
expect(refused({ name: "a", dockerfile: "D", platforms: ["linux/arm64/v8"] })).toBe("");
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
test("chant.config.ts takes either form", () => {
|
|
139
|
+
const ok = (images: unknown) => ChantConfigSchema.safeParse({ release: { images } }).success;
|
|
140
|
+
expect(ok([{ name: "pulumi", dockerfile: "images/plywood-pulumi/Dockerfile", context: ".", platforms: ["linux/amd64"], archive: "dist/images/pulumi.tar", prepare: "npm run build" }])).toBe(true);
|
|
141
|
+
expect(ok([{ name: "old", build: "x", archive: "a.tar" }])).toBe(true);
|
|
142
|
+
expect(ok([{ name: "old", build: "x" }])).toBe(false);
|
|
143
|
+
expect(ok([{ name: "both", build: "x", archive: "a.tar", dockerfile: "D" }])).toBe(false);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
test("the floor names the next release", () => expect(RELEASE_IMAGE_DOCKERFILE_FLOOR).toBe(NEXT_RELEASE));
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
describe("the digest table and the pins file (#4819)", () => {
|
|
150
|
+
const digestsFile = (named: Record<string, string>) => {
|
|
151
|
+
const f = join(scratch(), "digests.json");
|
|
152
|
+
writeFileSync(f, JSON.stringify(named));
|
|
153
|
+
return f;
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
test("outside a release build there is no table, and the pins file is removed", () => {
|
|
157
|
+
const dir = scratch();
|
|
158
|
+
const out = join(dir, "dist/image-digests.json");
|
|
159
|
+
mkdirSync(join(dir, "dist"));
|
|
160
|
+
writeFileSync(out, "{}\n");
|
|
161
|
+
const table = releaseImagePins({ images: { pulumi: "ghcr.io/intentius/plywood-pulumi:0.3.0-pulumi3.272.0" }, version: "0.3.0", env: {} });
|
|
162
|
+
expect(table).toBeUndefined();
|
|
163
|
+
writeReleaseImagePins(table, { out });
|
|
164
|
+
expect(existsSync(out)).toBe(false);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
test("plywood's table: each image's reference at the version, to the digest the cut recorded", () => {
|
|
168
|
+
const file = digestsFile({ plunge: D("b"), pulumi: D("a") });
|
|
169
|
+
const images = { pulumi: "ghcr.io/intentius/plywood-pulumi:0.3.0-pulumi3.272.0", plunge: "ghcr.io/intentius/plywood-plunge:0.3.0-plunge0.2.0" };
|
|
170
|
+
const table = releaseImagePins({ images, version: "0.3.0", env: { [RELEASE_DIGESTS_ENV]: file, CHANT_RELEASE_LABEL: "0.3.0" } });
|
|
171
|
+
expect(table).toEqual({ "ghcr.io/intentius/plywood-pulumi:0.3.0-pulumi3.272.0": D("a"), "ghcr.io/intentius/plywood-plunge:0.3.0-plunge0.2.0": D("b") });
|
|
172
|
+
expect(Object.keys(table!)).toEqual(Object.values(images));
|
|
173
|
+
|
|
174
|
+
const dir = scratch();
|
|
175
|
+
const bundle = join(dir, "plywood.mjs");
|
|
176
|
+
writeFileSync(bundle, `const digests = ${JSON.stringify(table)};\n`);
|
|
177
|
+
const out = join(dir, "dist/image-digests.json");
|
|
178
|
+
writeReleaseImagePins(table, { out, bundles: [bundle] });
|
|
179
|
+
// The bytes both build-cli.mjs scripts wrote.
|
|
180
|
+
expect(readFileSync(out, "utf-8")).toBe(`${JSON.stringify(table, null, 2)}\n`);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test("terragucci's table, for its four images", () => {
|
|
184
|
+
const names = ["tofu", "terraform", "terragrunt", "choudoufu"];
|
|
185
|
+
const file = digestsFile(Object.fromEntries(names.map((n, i) => [n, D(String(i + 1))])));
|
|
186
|
+
const images = Object.fromEntries(names.map((n) => [n, `ghcr.io/intentius/terragucci-${n}:0.4.51-${n}`]));
|
|
187
|
+
const table = releaseImagePins({ images, version: "0.4.51", env: { [RELEASE_DIGESTS_ENV]: file } })!;
|
|
188
|
+
expect(Object.entries(table)).toEqual(names.map((n, i) => [`ghcr.io/intentius/terragucci-${n}:0.4.51-${n}`, D(String(i + 1))]));
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
test("a label that is not the version, a missing digest, and a bundle without the digests are refused", () => {
|
|
192
|
+
const file = digestsFile({ pulumi: D("a"), plunge: "latest" });
|
|
193
|
+
const code = (f: () => unknown) => {
|
|
194
|
+
try {
|
|
195
|
+
f();
|
|
196
|
+
return "";
|
|
197
|
+
} catch (e) {
|
|
198
|
+
return `${(e as ReleaseImageError).code}: ${(e as Error).message}`;
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
expect(code(() => releaseImagePins({ images: { pulumi: "r" }, version: "0.3.0", env: { [RELEASE_DIGESTS_ENV]: file, CHANT_RELEASE_LABEL: "0.3.1" } }))).toBe(
|
|
202
|
+
"release-label-not-version: the release is labelled 0.3.1, and the package is at 0.3.0",
|
|
203
|
+
);
|
|
204
|
+
expect(code(() => releaseImagePins({ images: { plunge: "r" }, version: "0.3.0", env: { [RELEASE_DIGESTS_ENV]: file } }))).toBe(
|
|
205
|
+
`release-image-digest-missing: ${file} has no digest for the plunge image, which the release builds`,
|
|
206
|
+
);
|
|
207
|
+
const dir = scratch();
|
|
208
|
+
const bundle = join(dir, "b.mjs");
|
|
209
|
+
writeFileSync(bundle, "nothing here\n");
|
|
210
|
+
expect(code(() => writeReleaseImagePins({ "ghcr.io/x:1": D("a") }, { out: join(dir, "p.json"), bundles: [bundle] }))).toBe(`release-pin-not-bundled: ${bundle} does not carry ghcr.io/x:1@${D("a")}`);
|
|
211
|
+
expect(existsSync(join(dir, "p.json"))).toBe(false);
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
test("plain Node loads the module a product's build script imports", () => {
|
|
215
|
+
// The products' build-cli.mjs run under node with no TypeScript loader; the module must reach only node: built-ins at run time.
|
|
216
|
+
const src = readFileSync(join(__dirname, "release-images.ts"), "utf-8");
|
|
217
|
+
const runtime = [...src.matchAll(/^import (?!type)[^;]*from "([^"]+)";/gm)].map((m) => m[1]);
|
|
218
|
+
expect(runtime.filter((s) => !s!.startsWith("node:") && s !== "../release-floors")).toEqual([]);
|
|
219
|
+
expect(spawnSync("node", ["--version"]).status).toBe(0);
|
|
220
|
+
});
|
|
221
|
+
});
|