@intentius/chant 0.124.88 → 0.124.89
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/actor.d.ts +36 -1
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +39 -1
- package/dist/chant-install.d.ts.map +1 -1
- package/dist/chant-install.js +1 -2
- package/dist/ci-base.d.ts +30 -0
- package/dist/ci-base.d.ts.map +1 -0
- package/dist/ci-base.js +33 -0
- package/dist/ci-comment-commands.d.ts +177 -0
- package/dist/ci-comment-commands.d.ts.map +1 -0
- package/dist/ci-comment-commands.js +325 -0
- package/dist/ci-comment-replies.d.ts +40 -0
- package/dist/ci-comment-replies.d.ts.map +1 -0
- package/dist/ci-comment-replies.js +59 -0
- package/dist/ci-evidence-from-job.d.ts +25 -0
- package/dist/ci-evidence-from-job.d.ts.map +1 -1
- package/dist/ci-evidence-from-job.js +43 -2
- package/dist/ci-evidence-jobs.d.ts +30 -1
- package/dist/ci-evidence-jobs.d.ts.map +1 -1
- package/dist/ci-evidence-jobs.js +46 -3
- package/dist/ci-image.d.ts +21 -4
- package/dist/ci-image.d.ts.map +1 -1
- package/dist/ci-image.js +62 -10
- package/dist/ci-note-commands.d.ts +63 -3
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +69 -35
- package/dist/ci-product-words.d.ts +42 -0
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +25 -0
- package/dist/ci-product.d.ts +31 -0
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +34 -4
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +29 -2
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +2 -1
- package/dist/cli/handlers/ci-check.d.ts +1 -1
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +17 -7
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -1
- package/dist/cli/handlers/ci-evidence.js +33 -7
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +3 -1
- package/dist/cli/handlers/generated-check.d.ts +8 -0
- package/dist/cli/handlers/generated-check.d.ts.map +1 -1
- package/dist/cli/handlers/generated-check.js +31 -1
- package/dist/cli/handlers/lock.d.ts.map +1 -1
- package/dist/cli/handlers/lock.js +121 -4
- package/dist/cli/handlers/pr-comment.d.ts +21 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
- package/dist/cli/handlers/pr-comment.js +112 -0
- package/dist/cli/handlers/pr-env.d.ts.map +1 -1
- package/dist/cli/handlers/pr-env.js +6 -3
- package/dist/cli/handlers/pr.d.ts +23 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +55 -9
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +2 -1
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +11 -2
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +28 -2
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +2 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +24 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +16 -0
- package/dist/cli/registry.d.ts +11 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +2 -1
- package/dist/components/pr-checks.d.ts +70 -6
- package/dist/components/pr-checks.d.ts.map +1 -1
- package/dist/components/pr-checks.js +74 -13
- package/dist/components/pr-pipeline.d.ts +16 -12
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +3 -11
- package/dist/components/product-pipeline.d.ts +42 -1
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +64 -12
- package/dist/components/product-plan.d.ts +190 -5
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +220 -39
- package/dist/drift-record.d.ts +7 -0
- package/dist/drift-record.d.ts.map +1 -1
- package/dist/drift-record.js +19 -0
- package/dist/floor-table.data.d.ts.map +1 -1
- package/dist/floor-table.data.js +54 -31
- package/dist/forge-check/contract.d.ts +11 -1
- package/dist/forge-check/contract.d.ts.map +1 -1
- package/dist/forge-check/contract.js +4 -1
- package/dist/forge-check/index.d.ts +2 -0
- package/dist/forge-check/index.d.ts.map +1 -1
- package/dist/forge-check/index.js +2 -0
- package/dist/gate-resume-run.d.ts +9 -1
- package/dist/gate-resume-run.d.ts.map +1 -1
- package/dist/gate-resume-run.js +26 -3
- package/dist/generated-check.d.ts +18 -4
- package/dist/generated-check.d.ts.map +1 -1
- package/dist/generated-check.js +37 -5
- package/dist/image-pins.d.ts +26 -0
- package/dist/image-pins.d.ts.map +1 -0
- package/dist/image-pins.js +19 -0
- package/dist/lexicon.d.ts +11 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +11 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +30 -3
- package/dist/lifecycle/publish-npm.d.ts +11 -0
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +27 -1
- package/dist/lifecycle/reach-locks.d.ts +131 -0
- package/dist/lifecycle/reach-locks.d.ts.map +1 -0
- package/dist/lifecycle/reach-locks.js +118 -0
- package/dist/lifecycle/release-cut.d.ts +3 -1
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +15 -0
- package/dist/lifecycle/release-images.d.ts.map +1 -1
- package/dist/lifecycle/release-images.js +1 -2
- package/dist/notify-product.d.ts +12 -3
- package/dist/notify-product.d.ts.map +1 -1
- package/dist/notify-product.js +10 -6
- package/dist/op/activities/source-release.d.ts.map +1 -1
- package/dist/op/activities/source-release.js +2 -1
- package/dist/op/activities/source-rollback.d.ts.map +1 -1
- package/dist/op/activities/source-rollback.js +2 -1
- package/dist/op/index.d.ts +2 -0
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -0
- package/dist/op/op-waves-evidence-jobs.d.ts +6 -1
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.js +9 -3
- package/dist/op/op-waves-render-spec.d.ts +100 -0
- package/dist/op/op-waves-render-spec.d.ts.map +1 -0
- package/dist/op/op-waves-render-spec.js +162 -0
- package/dist/op/op-waves-run.d.ts +2 -0
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +2 -1
- package/dist/op/op-waves.d.ts +4 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +4 -1
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +59 -3
- package/dist/op/wave-stop.d.ts +64 -0
- package/dist/op/wave-stop.d.ts.map +1 -0
- package/dist/op/wave-stop.js +127 -0
- package/dist/planned-files.d.ts +76 -0
- package/dist/planned-files.d.ts.map +1 -0
- package/dist/planned-files.js +108 -0
- package/dist/pr-forge-job.d.ts +22 -0
- package/dist/pr-forge-job.d.ts.map +1 -0
- package/dist/pr-forge-job.js +46 -0
- package/dist/pr-loop.d.ts +3 -6
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -81
- package/dist/pr-plan-note.d.ts +97 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +94 -1
- package/dist/pr-post.d.ts +28 -3
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +145 -13
- package/dist/pr-status.d.ts +16 -0
- package/dist/pr-status.d.ts.map +1 -0
- package/dist/pr-status.js +90 -0
- package/dist/ref-gate-init.d.ts +16 -2
- package/dist/ref-gate-init.d.ts.map +1 -1
- package/dist/ref-gate-init.js +24 -13
- package/dist/release-floors.d.ts +37 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +61 -25
- package/dist/render-module.d.ts +15 -0
- package/dist/render-module.d.ts.map +1 -0
- package/dist/render-module.js +73 -0
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +1 -2
- package/dist/wave-runtime.mjs +304 -301
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +3 -2
- package/dist/workspace/release-train.d.ts.map +1 -1
- package/dist/workspace/release-train.js +2 -1
- package/dist/workspace/release-workflow.d.ts +4 -3
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +10 -7
- package/dist/workspace/trust/check-evidence-report.d.ts +7 -2
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.js +15 -8
- package/dist/workspace/trust/ref-gate-cli.d.ts +10 -1
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -1
- package/dist/workspace/trust/ref-gate-cli.js +30 -10
- package/dist/workspace/workspace-run.d.ts.map +1 -1
- package/dist/workspace/workspace-run.js +2 -1
- package/package.json +1 -1
- package/src/actor.test.ts +68 -2
- package/src/actor.ts +61 -1
- package/src/chant-install.test.ts +2 -3
- package/src/chant-install.ts +1 -2
- package/src/ci-base.test.ts +41 -0
- package/src/ci-base.ts +43 -0
- package/src/ci-comment-commands.test.ts +376 -0
- package/src/ci-comment-commands.ts +389 -0
- package/src/ci-comment-replies.ts +78 -0
- package/src/ci-commit.test.ts +2 -3
- package/src/ci-evidence-from-job.test.ts +18 -0
- package/src/ci-evidence-from-job.ts +58 -2
- package/src/ci-evidence-jobs.ts +50 -5
- package/src/ci-image.test.ts +130 -9
- package/src/ci-image.ts +85 -12
- package/src/ci-note-commands.ts +104 -41
- package/src/ci-product-words.ts +59 -0
- package/src/ci-product.ts +40 -4
- package/src/cli/commands/build.test.ts +41 -0
- package/src/cli/commands/build.ts +27 -2
- package/src/cli/handlers/approve.ts +2 -1
- package/src/cli/handlers/ci-check.ts +19 -7
- package/src/cli/handlers/ci-evidence.ts +29 -8
- package/src/cli/handlers/components.ts +3 -1
- package/src/cli/handlers/generated-check.ts +31 -1
- package/src/cli/handlers/lock-reach.test.ts +103 -0
- package/src/cli/handlers/lock.ts +100 -4
- package/src/cli/handlers/pr-comment.ts +104 -0
- package/src/cli/handlers/pr-env.ts +6 -3
- package/src/cli/handlers/pr-record.test.ts +1 -1
- package/src/cli/handlers/pr.ts +50 -10
- package/src/cli/handlers/promote.ts +2 -1
- package/src/cli/handlers/release.e2e.test.ts +35 -0
- package/src/cli/handlers/release.ts +14 -2
- package/src/cli/handlers/run-wave.ts +28 -2
- package/src/cli/handlers/run.ts +2 -1
- package/src/cli/main.ts +24 -2
- package/src/cli/parse-args.ts +12 -0
- package/src/cli/registry.ts +11 -0
- package/src/components/auto-release.ts +2 -1
- package/src/components/pr-checks.ts +112 -17
- package/src/components/pr-pipeline.ts +17 -15
- package/src/components/product-pipeline.ts +93 -11
- package/src/components/product-plan.test.ts +40 -2
- package/src/components/product-plan.ts +331 -45
- package/src/drift-record.test.ts +20 -0
- package/src/drift-record.ts +16 -0
- package/src/floor-table.data.ts +54 -31
- package/src/forge-check/contract.ts +12 -1
- package/src/forge-check/forge-check.test.ts +17 -0
- package/src/forge-check/index.ts +2 -0
- package/src/gate-resume-run.ts +27 -3
- package/src/generated-check.e2e.test.ts +21 -1
- package/src/generated-check.test.ts +66 -0
- package/src/generated-check.ts +51 -10
- package/src/image-pins.ts +31 -0
- package/src/lexicon.ts +11 -0
- package/src/lifecycle/git.test.ts +48 -0
- package/src/lifecycle/git.ts +27 -4
- package/src/lifecycle/publish-npm.ts +31 -1
- package/src/lifecycle/reach-locks.test.ts +87 -0
- package/src/lifecycle/reach-locks.ts +169 -0
- package/src/lifecycle/release-cut.ts +17 -1
- package/src/lifecycle/release-images.test.ts +56 -0
- package/src/lifecycle/release-images.ts +1 -2
- package/src/notify-product.ts +19 -8
- package/src/op/activities/source-release.ts +2 -1
- package/src/op/activities/source-rollback.ts +2 -1
- package/src/op/gate-resume.test.ts +27 -0
- package/src/op/index.ts +10 -0
- package/src/op/op-waves-evidence-jobs.ts +10 -4
- package/src/op/op-waves-notify-words.test.ts +18 -0
- package/src/op/op-waves-render-spec.test.ts +160 -0
- package/src/op/op-waves-render-spec.ts +171 -0
- package/src/op/op-waves-run.ts +2 -1
- package/src/op/op-waves.ts +5 -2
- package/src/op/schedule-overdue.test.ts +43 -0
- package/src/op/schedule-overdue.ts +57 -3
- package/src/op/wave-stop.test.ts +72 -0
- package/src/op/wave-stop.ts +137 -0
- package/src/planned-files.test.ts +80 -0
- package/src/planned-files.ts +134 -0
- package/src/pr-forge-job.test.ts +53 -0
- package/src/pr-forge-job.ts +46 -0
- package/src/pr-loop-narrowed.test.ts +2 -1
- package/src/pr-loop-words.test.ts +2 -1
- package/src/pr-loop.test.ts +1 -2
- package/src/pr-loop.ts +4 -80
- package/src/pr-plan-note.ts +155 -3
- package/src/pr-post-replan.test.ts +144 -0
- package/src/pr-post-subject.test.ts +230 -0
- package/src/pr-post.test.ts +2 -1
- package/src/pr-post.ts +150 -15
- package/src/pr-status.ts +91 -0
- package/src/ref-gate-init.ts +30 -11
- package/src/release-floors.ts +78 -25
- package/src/render-module.ts +73 -0
- package/src/state-migration-record.test.ts +2 -3
- package/src/state-migration.ts +1 -2
- package/src/workspace/ci-green-cli.ts +3 -2
- package/src/workspace/ci-green-workflow.test.ts +32 -1
- package/src/workspace/release-train.ts +2 -1
- package/src/workspace/release-workflow.test.ts +36 -5
- package/src/workspace/release-workflow.ts +10 -7
- package/src/workspace/trust/check-evidence-report.ts +15 -8
- package/src/workspace/trust/check-evidence.test.ts +5 -0
- package/src/workspace/trust/ref-gate-cli.ts +30 -8
- package/src/workspace/trust/ref-gate-pieces.test.ts +46 -1
- package/src/workspace/trust/ref-gate.test.ts +10 -0
- package/src/workspace/workspace-run.ts +2 -1
package/src/release-floors.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* this constant to the next patch (#4501). The check fails while a floor
|
|
20
20
|
* still names this constant after its version shipped.
|
|
21
21
|
*/
|
|
22
|
-
export const NEXT_RELEASE = "0.124.
|
|
22
|
+
export const NEXT_RELEASE = "0.124.89";
|
|
23
23
|
|
|
24
24
|
/** The first chant with `chant dev local` and `chant dev bundle-check`, `@intentius/chant/local-chant` and `@intentius/chant/bundle-check` (`chantRuntimeTarget`, `chantExternalPlugin`, `checkBundle`): a product built against a chant checkout, and its bundle checked, without its own scripts (#4787). */
|
|
25
25
|
export const LOCAL_CHANT_FLOOR = "0.124.86";
|
|
@@ -34,10 +34,13 @@ export const OVERDUE_PIPELINE_FILES_FLOOR = "0.124.86";
|
|
|
34
34
|
export const TERRAFORM_APPLY_COMMAND_HOOK_FLOOR = "0.124.86";
|
|
35
35
|
|
|
36
36
|
/** The first chant whose terraform lexicon times each root's engine commands and reads its spans and lock waits (`@intentius/chant-lexicon-terraform/engine-timings`, `engineTimings()` as `terraformApplyCapabilityWith`'s `onCommand`), and runs a composed group's commands through that hook (#4887). */
|
|
37
|
-
export const TERRAFORM_ENGINE_TIMINGS_FLOOR =
|
|
37
|
+
export const TERRAFORM_ENGINE_TIMINGS_FLOOR = "0.124.88";
|
|
38
38
|
|
|
39
39
|
/** The first chant whose terraform lexicon finds live roots and estates (`live-roots`), places a Terragrunt unit (`terragruntUnitPlace`), reads a state migration's history and revert from its finished lines (`migration-history`), and runs the binary without the forge's tokens (`tokenlessBinaryExec`, `engineEnv`) (#4910). */
|
|
40
|
-
export const TERRAFORM_ROOT_HELPERS_FLOOR =
|
|
40
|
+
export const TERRAFORM_ROOT_HELPERS_FLOOR = "0.124.88";
|
|
41
|
+
|
|
42
|
+
/** The first chant whose terraform lexicon has one runner of the engine for a product (`engineRunner` in `engine-runner`: a hooked `exec`, `execSync`, `terragrunt` and the tokenless `script`), traces each engine command (`commandTrace`, `commandTraceEnv`), sends each Terragrunt unit's plan through `planTerragruntWave({ onCommand })`, and resolves a live root's record store (`liveRecordStore`, `writtenRecordStore`, `rootBackendAttrs` in `live-roots`) (#4954). */
|
|
43
|
+
export const TERRAFORM_ENGINE_RUNNER_FLOOR = NEXT_RELEASE;
|
|
41
44
|
|
|
42
45
|
/** The first chant with `@intentius/chant/forge-flags` (`forgeTargetWith`, `forgeTargetFromFlags`, `apiBaseOf`), `@intentius/chant/chant-install` (`bundledChant`, `chantArgv`, `installChantResolveFallback`) and `noteLimit` and `fitNote` in `@intentius/chant/plan-summary` (#4800). */
|
|
43
46
|
export const PRODUCT_HELPERS_FLOOR = "0.124.86";
|
|
@@ -113,64 +116,114 @@ export const LOCAL_EVIDENCE_FLOOR = "0.124.86";
|
|
|
113
116
|
export const KEYLESS_EVIDENCE_FLOOR = "0.124.87";
|
|
114
117
|
|
|
115
118
|
/** The first chant whose waves generators run each wave's policy as a step of its own (`chant run wave --policy-only`; on GitLab a `<wave job>-policy` job) and sign its checks in a `<wave job>-evidence` job with `chant ci evidence sign --from-job`, from the forge's record of the wave job's steps, so a wave that trades cloud credentials signs keyless with `evidence.identity: "oidc"` instead of being refused (#4926). */
|
|
116
|
-
export const WAVE_EVIDENCE_JOB_FLOOR =
|
|
119
|
+
export const WAVE_EVIDENCE_JOB_FLOOR = "0.124.88";
|
|
117
120
|
|
|
118
121
|
/** The first chant whose cloud login leaves the region to the job unless the spec names one, takes `sameStep` to export into the step that runs it, accepts an AWS spec with no role (the token file alone), and whose trade sets `CHANT_CLOUD_TRADED` so a login's targets file is told from a trade's (#4930). */
|
|
119
|
-
export const CLOUD_LOGIN_SAME_STEP_FLOOR =
|
|
122
|
+
export const CLOUD_LOGIN_SAME_STEP_FLOOR = "0.124.88";
|
|
120
123
|
|
|
121
124
|
/** The first chant whose `chant release workflow` sets up QEMU in the cut and publish jobs for the platforms `release.images` builds that the runner can't (`docker/setup-qemu-action` at its pin on GitHub and Forgejo, a `tonistiigi/binfmt` run line on GitLab), and whose `release.images` command entries take `platforms` (#4876). */
|
|
122
|
-
export const RELEASE_WORKFLOW_QEMU_FLOOR =
|
|
125
|
+
export const RELEASE_WORKFLOW_QEMU_FLOOR = "0.124.88";
|
|
123
126
|
|
|
124
127
|
/** The first chant whose npm publish target refuses at plan time a package that would carry an image archive the release records (`publish-npm-carries-image`), naming the file and the `files` entry that leaves it out (#4934). */
|
|
125
|
-
export const NPM_CARRIES_IMAGE_FLOOR =
|
|
128
|
+
export const NPM_CARRIES_IMAGE_FLOOR = "0.124.88";
|
|
126
129
|
/** The first chant with `driftRunFingerprint` in `@intentius/chant/drift-issue` and `lexiconDriftRecords` in `@intentius/chant/drift-record`, whose `chant lifecycle diff --live --json` writes a lexicon's `absent`, and whose sql lexicon reports a declared object the server lacks as `missing` instead of `pending` (#4896). */
|
|
127
|
-
export const LIVE_DRIFT_RECORDS_FLOOR =
|
|
130
|
+
export const LIVE_DRIFT_RECORDS_FLOOR = "0.124.88";
|
|
128
131
|
|
|
129
132
|
/** The first chant whose `chant sql types --path` prints where `sql-types.d.ts` is by the source-dir rule, the path `sqlTypesPath` answers (#4897). */
|
|
130
|
-
export const SQL_TYPES_PATH_FLOOR =
|
|
133
|
+
export const SQL_TYPES_PATH_FLOOR = "0.124.88";
|
|
131
134
|
/** The first chant whose forge target carries its web `origin` (`forgeTargetWith`) and whose `@intentius/chant/forge-flags` has `jobForgeTarget`, a job's target or undefined where the job cannot reach the forge, so a product keeps no target type of its own (#4888). */
|
|
132
|
-
export const FORGE_TARGET_ORIGIN_FLOOR =
|
|
135
|
+
export const FORGE_TARGET_ORIGIN_FLOOR = "0.124.88";
|
|
133
136
|
|
|
134
137
|
/** The first chant with `actorFromEnv` (`@intentius/chant/actor`), `forgeTargetLiveRuns` and `forgeLiveRunsOf` in `@intentius/chant/state-unlock`, and a pulumi lexicon whose stack ops take the product's `approveCommand`, with `pulumiStackLockToCancel` and `pulumiMoveDestStack`, a move naming its own `--dest` from both sides' `project` (#4911). */
|
|
135
|
-
export const STACK_OPS_PRODUCT_HELPERS_FLOOR =
|
|
138
|
+
export const STACK_OPS_PRODUCT_HELPERS_FLOOR = "0.124.88";
|
|
136
139
|
|
|
137
140
|
/** The first chant with `@intentius/chant/forge-remote` (`forgeOfRemote`, `forgeOfCheckout`, `forgeKindOfHost`), the forge and repository a checkout's origin remote names, and a pulumi `gatedStackCancel` that reads the forge's runs from it on a laptop (#4920). */
|
|
138
|
-
export const FORGE_REMOTE_FLOOR =
|
|
141
|
+
export const FORGE_REMOTE_FLOOR = "0.124.88";
|
|
139
142
|
/** The first chant with `chant dev generated-check` (`chantGenerated` in a product's root package.json, `@intentius/chant/generated-check`) and `chant dev local-image` (`localChantImage` in `@intentius/chant/local-chant`): a drift check of a product's committed generated files, and an image build with the product's chant, local or pinned, without the product's own scripts (#4909). */
|
|
140
|
-
export const GENERATED_CHECK_FLOOR =
|
|
143
|
+
export const GENERATED_CHECK_FLOOR = "0.124.88";
|
|
141
144
|
|
|
142
145
|
/** The first chant whose `chant dev local` keeps the product's peer dependencies installed and packs the checkout at its `NEXT_RELEASE`, and whose root build of a project with no `sourceDir` leaves its top-level `migrations/` out, with the sql lexicon opening no `.sql` file under a `migrations` directory (#4921). */
|
|
143
|
-
export const LOCAL_CHANT_NEXT_RELEASE_FLOOR =
|
|
146
|
+
export const LOCAL_CHANT_NEXT_RELEASE_FLOOR = "0.124.88";
|
|
144
147
|
|
|
145
148
|
/** The first chant whose `chantExternalPlugin` keeps external only the chant packages it is given, by default the ones in the package's `dependencies`, so a product that bundles its lexicons uses it as is (#4922). */
|
|
146
|
-
export const CHANT_EXTERNAL_PACKAGES_FLOOR =
|
|
149
|
+
export const CHANT_EXTERNAL_PACKAGES_FLOOR = "0.124.88";
|
|
147
150
|
|
|
148
151
|
/** The first chant whose `ciToolInstallLine` takes `sudo` and `binDir` and a root under a shell variable, for a job that is not root, whose `CI_TOOL_SHA256` records terraform 1.14.9, terragrunt 1.2.0 and the AWS CLI 2.37.9, and whose Pulumi lexicon's `ciFetchScript` and `PINNED_SHA256` are ci-image's (#4908). */
|
|
149
|
-
export const CI_IMAGE_NON_ROOT_FLOOR =
|
|
152
|
+
export const CI_IMAGE_NON_ROOT_FLOOR = "0.124.88";
|
|
150
153
|
|
|
151
154
|
/** The first chant whose `productImageStages` stages type as the docker lexicon's `DockerfileStage[]` under `exactOptionalPropertyTypes`, so `new Dockerfile({ stages: productImageStages(spec) })` compiles (#4932). */
|
|
152
|
-
export const CI_IMAGE_DOCKER_STAGES_FLOOR =
|
|
155
|
+
export const CI_IMAGE_DOCKER_STAGES_FLOOR = "0.124.88";
|
|
153
156
|
|
|
154
157
|
/** The first chant whose setup steps (`OpSetupStep`: an Op waves spec's wave and job group `setup`, a scheduled Op's `setup`, `release.workflow.setup`) take a `name`, rendered as the step's name on GitHub and Forgejo (#4932). */
|
|
155
|
-
export const OP_SETUP_STEP_NAME_FLOOR =
|
|
158
|
+
export const OP_SETUP_STEP_NAME_FLOOR = "0.124.88";
|
|
156
159
|
|
|
157
160
|
/** The first chant whose cloud login takes `restart` (log in, then start the step's script again without the token request variables, and empty the token files when the step exits), sets `CHANT_CLOUD_TOKEN_FILES` for `LOGIN_CLEAR_TOKENS`, takes a full token URL as GCP's `stsEndpoint`, and whose GitLab trade evaluates its exports without writing a file (#4912). */
|
|
158
|
-
export const CLOUD_LOGIN_RESTART_FLOOR =
|
|
161
|
+
export const CLOUD_LOGIN_RESTART_FLOOR = "0.124.88";
|
|
159
162
|
|
|
160
163
|
/** The first chant whose `chant build --pr-loop` takes `evidence` (`--evidence-runner-key-secret`, `--evidence-identity oidc`, `--evidence-audience`) and signs the plan job's `plan` and `policy` checks in its note job on GitHub, GitLab and Forgejo (#4935). */
|
|
161
|
-
export const PR_LOOP_EVIDENCE_FLOOR =
|
|
164
|
+
export const PR_LOOP_EVIDENCE_FLOOR = "0.124.88";
|
|
162
165
|
|
|
163
166
|
/** The first chant whose pull request pipelines take `checkJob` (`--check-job`): a check job that runs `chant ci check` on the pull request's commit with no token or runner identity, and with `evidence` a `check-evidence` job that signs each passed hook from its report with `chant ci evidence sign --from-report .chant/check` (#4935). */
|
|
164
|
-
export const CHECK_JOB_FLOOR =
|
|
167
|
+
export const CHECK_JOB_FLOOR = "0.124.88";
|
|
165
168
|
|
|
166
169
|
/** The first chant whose GitLab pipelines sign evidence in the target branch's plan notes pipeline, in jobs that name the `chant-evidence` environment, with `chant ci evidence sign --open`, and whose `pr-post --open --evidence-dir` ends each merge request's note with the checks line; no job of a merge request pipeline holds the runner key (#4914). */
|
|
167
|
-
export const GITLAB_OPEN_EVIDENCE_FLOOR =
|
|
170
|
+
export const GITLAB_OPEN_EVIDENCE_FLOOR = "0.124.88";
|
|
168
171
|
|
|
169
172
|
/** The first chant whose `chant ci check` takes `--summary <file>` and whose `checkReportSummary` renders the check report's markdown section, so a product's check step runs chant's check stage and keeps the section in its own report (#4914). */
|
|
170
|
-
export const CHECK_SUMMARY_FLOOR =
|
|
173
|
+
export const CHECK_SUMMARY_FLOOR = "0.124.88";
|
|
171
174
|
|
|
172
175
|
/** The first chant whose pull request pipelines take `refGateStatus` (`--ref-gate-status`): a `ref-gate` job that runs `chant workspace ref-gate status` for the pull request's commit, and on GitLab `ref-gate status --open` for every open merge request (#4935). */
|
|
173
|
-
export const REF_GATE_STATUS_JOB_FLOOR =
|
|
176
|
+
export const REF_GATE_STATUS_JOB_FLOOR = "0.124.88";
|
|
174
177
|
|
|
175
178
|
/** The first chant with `@intentius/chant/ref-gate-rules` (`refGateRulesAt`), `require` in `checkPrRequires`, `refGateStatus` in `pipelineContract` and `ci forge-check --ref-gate-status`, `@intentius/chant/ref-gate-init` (`refGateInitPlan`, `writeRefGateInit`), and a pre-receive refusal that prints the command recording the override request (#4913). */
|
|
176
|
-
export const REF_GATE_PIECES_FLOOR =
|
|
179
|
+
export const REF_GATE_PIECES_FLOOR = "0.124.88";
|
|
180
|
+
|
|
181
|
+
/** The first chant whose `chant release cut --yes` pushes `chant/lifecycle` again when the remote refuses it, and exits non-zero untagged (`release-record-not-pushed`) when the release record never lands, so the release workflow does not push the tag (#4965). */
|
|
182
|
+
export const RELEASE_CUT_RECORD_FLOOR = NEXT_RELEASE;
|
|
183
|
+
|
|
184
|
+
/** The first chant whose release cut refuses, before it records or tags, a release whose npm publish target would carry an image archive (`publish-npm-carries-image`), and whose GitLab release workflow runs the binfmt image by digest from `IMAGE_PINS` (#4941). */
|
|
185
|
+
export const RELEASE_CUT_CARRIES_IMAGE_FLOOR = NEXT_RELEASE;
|
|
186
|
+
/** The first chant whose `ciToolFetchScript` and `ciToolInstallLine` take `download: "node"`, a fetch and unzip with node for an image with no curl or unzip, whose `CI_TOOL_SHA256` records just 1.36.0 and act 0.2.89 and checks them against their releases' checksums files, and whose overdue check deepens a shallow checkout before it dates a pipeline file (#4952). */
|
|
187
|
+
export const CI_TOOL_NODE_DOWNLOAD_FLOOR = NEXT_RELEASE;
|
|
188
|
+
|
|
189
|
+
/** The first chant whose `chant build -o <dir>/` writes a build's additional files (a docker project's Dockerfiles) into the directory with no primary file, whose `chantGenerated` renders take a `module` and its `export` (a `{ path: text }` object or a function returning one) and `chant dev render <module> <export>` writes them in place, and whose `chant ci workflow` and `chant release workflow` write into `chant dev generated-check`'s render tree with no `--output` (#4950). */
|
|
190
|
+
export const RENDER_KINDS_FLOOR = NEXT_RELEASE;
|
|
191
|
+
|
|
192
|
+
/** The first chant whose sql lexicon's `chant lifecycle diff --live` addresses a table's columns by name (`columns[#country].default.expr`), compares a ClickHouse table's column order as `columnOrder`, and reports a column the server has and the declaration does not as pending, and whose `lexiconDriftRecords` counts a deep read's pending changes (that column, a ClickHouse or Postgres privilege granted by hand) as drift (#4944). */
|
|
193
|
+
export const SQL_LIVE_COLUMNS_FLOOR = NEXT_RELEASE;
|
|
194
|
+
|
|
195
|
+
/** The first chant whose `driftNotifyFields` takes `stacks`, each member's drift records, and from them names the drifted members and computes the run's fingerprint (#4944). */
|
|
196
|
+
export const DRIFT_NOTIFY_STACKS_FLOOR = NEXT_RELEASE;
|
|
197
|
+
|
|
198
|
+
/** The first chant whose workspace member's pull request pipeline takes `evidence`, `checkJob` and `refGateStatus` (`chant build --pr-loop` in a member), signing the member's plan job as `plan:<member>` and `policy:<member>` (`ci evidence sign --member`, `memberEvidenceCheck`) and running the check job in the member's directory (#4964). */
|
|
199
|
+
export const MEMBER_SIGNED_CHECKS_FLOOR = NEXT_RELEASE;
|
|
200
|
+
|
|
201
|
+
/** The first chant whose `checkJob` takes `{ services, env, before, dir, args }` (`PrCheckJobOptions`: service containers, the check step's variables and lines, the report directory, the arguments after `--base`) and whose github, forgejo and gitlab lexicons render the check, check evidence and ref gate jobs for a product's own workflow (`productCheckJobs`, `forgejoProductCheckJobs`, `gitlabProductCheckJobs`) (#4964). */
|
|
202
|
+
export const PRODUCT_CHECK_JOBS_FLOOR = NEXT_RELEASE;
|
|
203
|
+
|
|
204
|
+
/** The first chant whose GitLab Op waves pipeline with a runner key hands it to no wave job: each deciding wave's `<wave job>-evidence` job names the `chant-evidence` environment and signs `plan:<wave>` from the wave job (#4964). */
|
|
205
|
+
export const GITLAB_WAVE_KEY_SCOPE_FLOOR = NEXT_RELEASE;
|
|
206
|
+
|
|
207
|
+
/** The first chant with `actorOf` and `actorOrder` in `@intentius/chant/actor`: the actor fallback with `GITHUB_TRIGGERING_ACTOR` ahead of the forge's actor and git's `user.name` before the login, each place switched on or off by the caller (#4966). */
|
|
208
|
+
export const ACTOR_ORDER_FLOOR = NEXT_RELEASE;
|
|
209
|
+
|
|
210
|
+
/** The first chant with `@intentius/chant/ci-base` (`ciBaseRef`), the base a CI job measures a change from (the pull request's target branch, else the default branch for a push to another branch), and whose `chant ci check` defaults `--base` to it (#4966). */
|
|
211
|
+
export const CI_BASE_REF_FLOOR = NEXT_RELEASE;
|
|
212
|
+
|
|
213
|
+
/** The first chant with `@intentius/chant/planned-files` (`planFile`, `planRemoval`, `writePlannedFiles`, `staleGeneratedFiles`): an init's planned files with their modes, written or removed in one call, and the generated files a product no longer renders, found by their header (#4966). */
|
|
214
|
+
export const PLANNED_FILES_FLOOR = NEXT_RELEASE;
|
|
215
|
+
|
|
216
|
+
/** The first chant whose `pipelineContract` takes `jobs`, the jobs a product builds from its own config, beside or in place of `pipelines`, so a product's forge check gets the required statuses and `refGateStatus` from chant (#4966). */
|
|
217
|
+
export const FORGE_CHECK_OWN_JOBS_FLOOR = NEXT_RELEASE;
|
|
218
|
+
|
|
219
|
+
/** The first chant whose `chant components pr-apply --before-merge` waits for the ref gate's status: the status the policy at base sets for the target branch is passed as `require` to the `checks` require (#4966). */
|
|
220
|
+
export const BEFORE_MERGE_REF_GATE_FLOOR = NEXT_RELEASE;
|
|
221
|
+
|
|
222
|
+
/** The first chant whose product plan with `targets` and `evidence` signs each target's plan job as `plan:<target>` and `policy:<target>` (`ci evidence sign --member <target>`, `targetEvidenceCheck`, `productPlanEvidenceChecks`), and whose `refGateInitPlan` takes `targets` and names those checks in the `refs` rule (#4978). */
|
|
223
|
+
export const TARGET_SIGNED_CHECKS_FLOOR = NEXT_RELEASE;
|
|
224
|
+
|
|
225
|
+
/** The first chant whose Op waves generators take `renderSpec` (the wave jobs run `chant run wave --render-spec`, and `CHANT_WAVES_SPEC_COMMAND` names the product command that prints the spec at the commit in `CHANT_WAVES_SPEC_AT`), so a product whose spec is built from its config at base renders its wave jobs, policy step, evidence job and cloud trade through chant (#4982). */
|
|
226
|
+
export const RUNTIME_WAVES_SPEC_FLOOR = NEXT_RELEASE;
|
|
227
|
+
|
|
228
|
+
/** The first chant whose `chant run resume` (`resumeGateRun`) on GitLab retries a wave job's `<wave job>-evidence` with the wave job when the evidence job already ran, and whose `ci evidence sign --from-job` waits for a job it reads to finish, so a resumed wave's evidence job signs from the new try (#4978). */
|
|
229
|
+
export const GITLAB_WAVE_EVIDENCE_RETRY_FLOOR = NEXT_RELEASE;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #4950: render a module's file-text export.
|
|
3
|
+
*
|
|
4
|
+
* A product keeps some generated files as the text a TypeScript function
|
|
5
|
+
* returns: plywood's `dockerfiles()` in `src/images.ts` gives each image's
|
|
6
|
+
* Dockerfile by its path from the repository root, and a schema or a set of
|
|
7
|
+
* dashboards can be the same. plywood bundled each such module with esbuild
|
|
8
|
+
* (`build-images.mjs`, `build-schema.mjs`) only to call that export and write
|
|
9
|
+
* the files. Here chant imports the module itself, with the TypeScript loader
|
|
10
|
+
* and chant's own modules served as the running CLI, calls the export, and
|
|
11
|
+
* writes each file below an output root:
|
|
12
|
+
*
|
|
13
|
+
* - `chant dev render <module> <export> [--output <root>]` writes them in
|
|
14
|
+
* place (the root is the working directory unless `--output` names one);
|
|
15
|
+
* under `chant dev generated-check` they go to the render tree.
|
|
16
|
+
* - a `chantGenerated` render of the module kind (`{ "module", "export" }`)
|
|
17
|
+
* renders them into the check's render tree and compares them.
|
|
18
|
+
*
|
|
19
|
+
* The export is a `{ path: text }` object, or a function, async or not, that
|
|
20
|
+
* returns one when called with no arguments. Each path is relative, with `/`
|
|
21
|
+
* between segments and no `..`.
|
|
22
|
+
*/
|
|
23
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
24
|
+
import { dirname, join, resolve } from "node:path";
|
|
25
|
+
import { importModule } from "./discovery/import";
|
|
26
|
+
|
|
27
|
+
/** Files by their path below the output root. */
|
|
28
|
+
export type RenderedFiles = Record<string, string>;
|
|
29
|
+
|
|
30
|
+
/** Whether `path` is one an export may name: relative, `/`-separated, with no `.` or `..` segment. */
|
|
31
|
+
function isRenderedPath(path: string): boolean {
|
|
32
|
+
if (!path || path.startsWith("/") || path.includes("\\") || /^[A-Za-z]:/.test(path)) return false;
|
|
33
|
+
return path.split("/").every((s) => s !== "" && s !== "." && s !== "..");
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Import `modulePath` (resolved from `cwd`) and return the files its export
|
|
38
|
+
* `exportName` renders. Throws, naming the module and export, when the export
|
|
39
|
+
* is missing, is not files, or names a path outside the root.
|
|
40
|
+
*/
|
|
41
|
+
export async function renderModuleFiles(modulePath: string, exportName: string, cwd = process.cwd()): Promise<RenderedFiles> {
|
|
42
|
+
const at = resolve(cwd, modulePath);
|
|
43
|
+
const where = `${modulePath} export ${exportName}`;
|
|
44
|
+
const mod = await importModule(at);
|
|
45
|
+
if (!(exportName in mod)) throw new Error(`${modulePath} has no export named ${exportName}`);
|
|
46
|
+
const exported = mod[exportName];
|
|
47
|
+
const value = typeof exported === "function" ? await (exported as () => unknown)() : exported;
|
|
48
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(`${where} must be, or return, an object of file paths to their text`);
|
|
49
|
+
const files: RenderedFiles = {};
|
|
50
|
+
for (const [path, text] of Object.entries(value as Record<string, unknown>)) {
|
|
51
|
+
if (!isRenderedPath(path)) throw new Error(`${where} names ${JSON.stringify(path)}, which is not a relative path inside the output root`);
|
|
52
|
+
if (typeof text !== "string") throw new Error(`${where} gives ${path} a ${text === null ? "null" : typeof text}, not its text`);
|
|
53
|
+
files[path] = text;
|
|
54
|
+
}
|
|
55
|
+
if (Object.keys(files).length === 0) throw new Error(`${where} renders no files`);
|
|
56
|
+
return files;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Write each file below `root`, creating its directories. `place` maps the
|
|
61
|
+
* absolute path before the write (`renderPathOf`, under a check). Returns
|
|
62
|
+
* the paths written, in the export's order.
|
|
63
|
+
*/
|
|
64
|
+
export function writeRenderedFiles(root: string, files: RenderedFiles, place: (path: string) => string = (p) => p): string[] {
|
|
65
|
+
const written: string[] = [];
|
|
66
|
+
for (const [path, text] of Object.entries(files)) {
|
|
67
|
+
const target = place(join(root, path));
|
|
68
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
69
|
+
writeFileSync(target, text);
|
|
70
|
+
written.push(target);
|
|
71
|
+
}
|
|
72
|
+
return written;
|
|
73
|
+
}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
import { describe, expect, test } from "vitest";
|
|
8
8
|
import { fakeLedger } from "./__fixtures__/gated-ledger";
|
|
9
9
|
import type { RequestGateInput } from "./lifecycle/gated-request";
|
|
10
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
11
10
|
import {
|
|
12
11
|
runStateMigration,
|
|
13
12
|
STATE_MIGRATION_RECORD_FLOOR,
|
|
@@ -84,7 +83,7 @@ describe("runStateMigration's record (#4928)", () => {
|
|
|
84
83
|
expect(l.attachments).toEqual([]);
|
|
85
84
|
});
|
|
86
85
|
|
|
87
|
-
test("the floor is the
|
|
88
|
-
expect(STATE_MIGRATION_RECORD_FLOOR).toBe(
|
|
86
|
+
test("the floor is the release that shipped it", () => {
|
|
87
|
+
expect(STATE_MIGRATION_RECORD_FLOOR).toBe("0.124.88");
|
|
89
88
|
});
|
|
90
89
|
});
|
package/src/state-migration.ts
CHANGED
|
@@ -48,7 +48,6 @@ import { chantGatedLedger, gatedOp, type GatedRequestLedger } from "./lifecycle/
|
|
|
48
48
|
import type { GatedRequestRules } from "./lifecycle/gated-request";
|
|
49
49
|
import { gatedRequestAttachmentPath } from "./lifecycle/gated-request-digest";
|
|
50
50
|
import { samePlanDigest } from "./lifecycle/plan-digest";
|
|
51
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
52
51
|
|
|
53
52
|
/** The first chant with the engine-neutral state migration (#4762). */
|
|
54
53
|
export const STATE_MIGRATION_FLOOR = "0.124.77";
|
|
@@ -57,7 +56,7 @@ export const STATE_MIGRATION_FLOOR = "0.124.77";
|
|
|
57
56
|
export const STATE_MIGRATION_SOURCE_FLOOR = "0.124.86";
|
|
58
57
|
|
|
59
58
|
/** The first chant whose `runStateMigration` takes a product's `record`, which the request's attachment binds beside the roots and `chant approve` shows (#4928). */
|
|
60
|
-
export const STATE_MIGRATION_RECORD_FLOOR =
|
|
59
|
+
export const STATE_MIGRATION_RECORD_FLOOR = "0.124.88";
|
|
61
60
|
|
|
62
61
|
/** The most a product's migration `record` may take, as canonical JSON in UTF-8 (#4928): a record names moves, retags and stamps, never a state's contents. */
|
|
63
62
|
export const STATE_MIGRATION_RECORD_MAX_BYTES = 64 * 1024;
|
|
@@ -232,10 +232,11 @@ export async function runCiWorkflow(ctx: CommandContext): Promise<number> {
|
|
|
232
232
|
const root = realpathSync(found.dir);
|
|
233
233
|
const repoRoot = gitTop(root) ?? root;
|
|
234
234
|
const member = resolveMemberContext(cwd, found);
|
|
235
|
-
const target = ctx.args.output ? resolve(realpathSync(cwd), ctx.args.output) : join(repoRoot, CI_GREEN_WORKFLOW_FILE);
|
|
236
235
|
// #4909: under `chant dev generated-check` the file goes to the render
|
|
237
|
-
// tree; it is read and named as the committed file it stands for.
|
|
236
|
+
// tree; it is read and named as the committed file it stands for. #4950:
|
|
237
|
+
// with no --output too, so a render needs no `--output {out}/...`.
|
|
238
238
|
const { committedPathOf, isRenderPath, renderPathOf } = await import("../generated-check");
|
|
239
|
+
const target = ctx.args.output ? resolve(realpathSync(cwd), ctx.args.output) : renderPathOf(join(repoRoot, CI_GREEN_WORKFLOW_FILE));
|
|
239
240
|
const rendering = isRenderPath(target);
|
|
240
241
|
const asCommitted = committedPathOf(target);
|
|
241
242
|
const fromRepo = relative(repoRoot, asCommitted).split(sep).join("/");
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* the generated-file rules (ws-042, #2524 D14).
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { afterAll, describe, expect, test, vi } from "vitest";
|
|
10
10
|
import { GENERATED_MARKER } from "../discovery/files";
|
|
11
|
+
import { GENERATED_OUT_ENV, GENERATED_ROOT_ENV } from "../generated-check";
|
|
11
12
|
import type { CommandContext } from "../cli/registry";
|
|
12
13
|
import { parseYAMLDocument } from "../yaml";
|
|
13
14
|
import { runCiWorkflow } from "./ci-green-cli";
|
|
@@ -187,6 +188,36 @@ describe("chant ci workflow (#3573)", () => {
|
|
|
187
188
|
}
|
|
188
189
|
});
|
|
189
190
|
|
|
191
|
+
test("under chant dev generated-check, writes into the render tree with no --output and leaves the committed file (#4950)", async () => {
|
|
192
|
+
const root = realpathSync(scratchDir("chant-ci-workflow-"));
|
|
193
|
+
const out = realpathSync(scratchDir("chant-ci-workflow-out-"));
|
|
194
|
+
git(root, "init", "-q");
|
|
195
|
+
writeFiles(root, {
|
|
196
|
+
"chant.workspace.json": declaration([], { ci: { green: GREEN } }),
|
|
197
|
+
".github/workflows/ci.yml": CI,
|
|
198
|
+
".github/workflows/macos.yml": MACOS,
|
|
199
|
+
[CI_GREEN_WORKFLOW_FILE]: "committed\n",
|
|
200
|
+
});
|
|
201
|
+
const cwd = vi.spyOn(process, "cwd").mockReturnValue(root);
|
|
202
|
+
const log = vi.spyOn(console, "log").mockImplementation(() => {});
|
|
203
|
+
const error = vi.spyOn(console, "error").mockImplementation(() => {});
|
|
204
|
+
process.env[GENERATED_OUT_ENV] = out;
|
|
205
|
+
process.env[GENERATED_ROOT_ENV] = root;
|
|
206
|
+
try {
|
|
207
|
+
expect(await runCiWorkflow({ args: {} } as unknown as CommandContext)).toBe(0);
|
|
208
|
+
expect(readFileSync(join(root, CI_GREEN_WORKFLOW_FILE), "utf-8")).toBe("committed\n");
|
|
209
|
+
const rendered = readFileSync(join(out, CI_GREEN_WORKFLOW_FILE), "utf-8");
|
|
210
|
+
expect(rendered.split("\n")[0]).toBe(`# ${GENERATED_MARKER}. Regenerate with: chant ci workflow (in the workspace root)`);
|
|
211
|
+
expect(existsSync(join(root, ".chant", "generated.json"))).toBe(false);
|
|
212
|
+
} finally {
|
|
213
|
+
delete process.env[GENERATED_OUT_ENV];
|
|
214
|
+
delete process.env[GENERATED_ROOT_ENV];
|
|
215
|
+
cwd.mockRestore();
|
|
216
|
+
log.mockRestore();
|
|
217
|
+
error.mockRestore();
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
190
221
|
test("--chant and --install go into the file and its header, and regenerate byte-identically", async () => {
|
|
191
222
|
const root = scratchDir("chant-ci-workflow-");
|
|
192
223
|
git(root, "init", "-q");
|
|
@@ -18,6 +18,7 @@ import { readAllReleases, readCuts } from "../lifecycle/release-store";
|
|
|
18
18
|
import { readDeclaration, WorkspaceReadError } from "./declaration";
|
|
19
19
|
import { locateWorkspace } from "./which-chant";
|
|
20
20
|
import { appendWorkspaceLine, readWorkspaceLines } from "./workspace-ledger";
|
|
21
|
+
import { actorFromEnv } from "../actor";
|
|
21
22
|
|
|
22
23
|
export interface TrainMember {
|
|
23
24
|
member: string;
|
|
@@ -140,7 +141,7 @@ export async function runWorkspaceTrain(ctx: CommandContext): Promise<number> {
|
|
|
140
141
|
for (const p of picked.problems) console.error(` ${p}`);
|
|
141
142
|
return 1;
|
|
142
143
|
}
|
|
143
|
-
const actor = ctx.args.actor ??
|
|
144
|
+
const actor = ctx.args.actor ?? actorFromEnv();
|
|
144
145
|
const record: ReleaseTrainRecord = { version: 1, id: `train-${randomUUID()}`, env, timestamp: new Date().toISOString(), actor, members: picked.members };
|
|
145
146
|
if (!ctx.args.dryRun) await appendReleaseTrain(root, record);
|
|
146
147
|
if (ctx.args.json) console.log(JSON.stringify({ ...record, written: !ctx.args.dryRun }, null, 2));
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/** #4656: `chant release workflow` renders the release pipeline from the `release` block. */
|
|
2
|
-
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { describe, expect, test, vi } from "vitest";
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
|
-
import { mkdtempSync, readFileSync } from "node:fs";
|
|
4
|
+
import { mkdirSync, mkdtempSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { parseYAML } from "../yaml";
|
|
8
8
|
import { ACTION_PINS } from "../action-pins";
|
|
9
|
-
import {
|
|
9
|
+
import { IMAGE_PINS } from "../image-pins";
|
|
10
|
+
import type { CommandContext } from "../cli/registry";
|
|
11
|
+
import { GENERATED_OUT_ENV, GENERATED_ROOT_ENV } from "../generated-check";
|
|
12
|
+
import { NPM_TRUSTED_PUBLISHING_SETUP, releaseWorkflowHeader, renderReleaseWorkflow, runReleaseWorkflow, RELEASE_DIGESTS_PATHS, RELEASE_WORKFLOW_FILES, type ReleaseWorkflowInput, type ReleaseWorkflowTarget } from "./release-workflow";
|
|
10
13
|
import type { SecurityGroup } from "./security";
|
|
11
14
|
|
|
12
15
|
const FIXTURES = join(__dirname, "__fixtures__", "release-workflow");
|
|
@@ -500,11 +503,12 @@ describe("QEMU for the platforms release.images builds (#4876)", () => {
|
|
|
500
503
|
}
|
|
501
504
|
});
|
|
502
505
|
|
|
503
|
-
test("on GitLab, a binfmt run line in the cut and the publish", () => {
|
|
506
|
+
test("on GitLab, a binfmt run line in the cut and the publish, the image pinned by digest (#4941)", () => {
|
|
504
507
|
const doc = parseYAML(render("gitlab", TWO)) as Record<string, { script: string[] }>;
|
|
505
508
|
for (const job of ["chant-release-cut", "chant-release-publish"]) {
|
|
506
509
|
const script = doc[job]!.script;
|
|
507
|
-
expect(script[script.indexOf("npm ci") + 1], job).toBe(
|
|
510
|
+
expect(script[script.indexOf("npm ci") + 1], job).toBe(`docker run --privileged --rm tonistiigi/binfmt:${IMAGE_PINS.binfmt.tag}@${IMAGE_PINS.binfmt.digest} --install arm64`);
|
|
511
|
+
expect(IMAGE_PINS.binfmt.digest).toMatch(/^sha256:[0-9a-f]{64}$/);
|
|
508
512
|
}
|
|
509
513
|
});
|
|
510
514
|
|
|
@@ -535,3 +539,30 @@ describe("QEMU for the platforms release.images builds (#4876)", () => {
|
|
|
535
539
|
expect(steps.find((s) => s.uses?.startsWith("docker/setup-qemu-action@"))!.with).toEqual({ platforms: "arm,arm64,riscv64" });
|
|
536
540
|
});
|
|
537
541
|
});
|
|
542
|
+
|
|
543
|
+
describe("chant release workflow under chant dev generated-check (#4950)", () => {
|
|
544
|
+
test("writes into the render tree with no --output, names no --output in the header, and leaves the committed file", async () => {
|
|
545
|
+
const root = realpathSync(mkdtempSync(join(tmpdir(), "chant-4950-release-")));
|
|
546
|
+
const out = realpathSync(mkdtempSync(join(tmpdir(), "chant-4950-release-out-")));
|
|
547
|
+
writeFileSync(join(root, "chant.workspace.json"), JSON.stringify({ name: "product", schema: 1, members: [] }));
|
|
548
|
+
writeFileSync(join(root, "chant.config.json"), JSON.stringify({ lexicons: [] }));
|
|
549
|
+
mkdirSync(join(root, ".github/workflows"), { recursive: true });
|
|
550
|
+
writeFileSync(join(root, RELEASE_WORKFLOW_FILES.github), "committed\n");
|
|
551
|
+
expect(spawnSync("git", ["init", "-q"], { cwd: root }).status).toBe(0);
|
|
552
|
+
const cwd = vi.spyOn(process, "cwd").mockReturnValue(root);
|
|
553
|
+
const log = vi.spyOn(console, "log").mockImplementation(() => {});
|
|
554
|
+
process.env[GENERATED_OUT_ENV] = out;
|
|
555
|
+
process.env[GENERATED_ROOT_ENV] = root;
|
|
556
|
+
try {
|
|
557
|
+
expect(await runReleaseWorkflow({ args: { forge: "github" } } as unknown as CommandContext)).toBe(0);
|
|
558
|
+
expect(readFileSync(join(root, RELEASE_WORKFLOW_FILES.github), "utf-8")).toBe("committed\n");
|
|
559
|
+
const rendered = readFileSync(join(out, RELEASE_WORKFLOW_FILES.github), "utf-8");
|
|
560
|
+
expect(rendered.split("\n")[0]).toBe(releaseWorkflowHeader("chant release workflow --forge github").trimEnd());
|
|
561
|
+
} finally {
|
|
562
|
+
delete process.env[GENERATED_OUT_ENV];
|
|
563
|
+
delete process.env[GENERATED_ROOT_ENV];
|
|
564
|
+
cwd.mockRestore();
|
|
565
|
+
log.mockRestore();
|
|
566
|
+
}
|
|
567
|
+
});
|
|
568
|
+
});
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
* renders the tag-triggered file it always did.
|
|
29
29
|
*/
|
|
30
30
|
import { ACTION_PINS, tagComments, usesRef } from "../action-pins";
|
|
31
|
+
import { IMAGE_PINS, imageRef } from "../image-pins";
|
|
31
32
|
import { releaseImagePlatforms, resolveReleaseImages } from "../lifecycle/release-images";
|
|
32
33
|
import { GENERATED_MARKER } from "../discovery/files";
|
|
33
34
|
import type { SecurityGroup } from "./security";
|
|
@@ -183,8 +184,8 @@ export function targetExtras(forge: ReleaseWorkflowForge, targets: ReadonlyArray
|
|
|
183
184
|
/** The platform the jobs `chant release workflow` writes run on: GitHub's and Forgejo's `ubuntu-latest`, and a GitLab runner's default (#4876). */
|
|
184
185
|
export const RELEASE_RUNNER_PLATFORM = "linux/amd64";
|
|
185
186
|
|
|
186
|
-
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876). */
|
|
187
|
-
export const RELEASE_BINFMT_IMAGE =
|
|
187
|
+
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876): the repository, which a config's own setup line is recognised by. */
|
|
188
|
+
export const RELEASE_BINFMT_IMAGE = IMAGE_PINS.binfmt.repository;
|
|
188
189
|
|
|
189
190
|
/** The architectures among `platforms` the runner can't run, as QEMU names them (`linux/arm/v7` is `arm`), each once. */
|
|
190
191
|
export function qemuArchitectures(platforms: readonly string[]): string[] {
|
|
@@ -196,7 +197,8 @@ export function qemuArchitectures(platforms: readonly string[]): string[] {
|
|
|
196
197
|
* runner can't, such as `linux/arm64` on an amd64 runner (#4876), so no
|
|
197
198
|
* product names it in `release.workflow.setup`. GitHub and Forgejo get
|
|
198
199
|
* `docker/setup-qemu-action` at its pin; GitLab a `docker run --privileged`
|
|
199
|
-
* of {@link RELEASE_BINFMT_IMAGE}
|
|
200
|
+
* of {@link RELEASE_BINFMT_IMAGE} by the digest `IMAGE_PINS.binfmt` records
|
|
201
|
+
* (#4941, ../image-pins.ts), which `chant release workflow` notes needs
|
|
200
202
|
* an executor that runs privileged containers. A config whose `setup` names
|
|
201
203
|
* the action or the binfmt image already gets nothing more, so its file
|
|
202
204
|
* renders as it did.
|
|
@@ -206,7 +208,7 @@ export function qemuSetup(forge: ReleaseWorkflowForge, platforms: readonly strin
|
|
|
206
208
|
if (archs.length === 0) return [];
|
|
207
209
|
const named = (p.setup ?? []).some((s) => ("uses" in s ? /^docker\/setup-qemu-action@/.test(s.uses) : s.run.includes(RELEASE_BINFMT_IMAGE)));
|
|
208
210
|
if (named) return [];
|
|
209
|
-
return forge === "gitlab" ? [{ run: `docker run --privileged --rm ${
|
|
211
|
+
return forge === "gitlab" ? [{ run: `docker run --privileged --rm ${imageRef(IMAGE_PINS.binfmt)} --install ${archs.join(",")}` }] : [{ uses: usesRef(ACTION_PINS.dockerSetupQemu4), with: { platforms: archs.join(",") } }];
|
|
210
212
|
}
|
|
211
213
|
|
|
212
214
|
/** The flags `chant release publish` gets under the groups. */
|
|
@@ -712,11 +714,12 @@ export async function runReleaseWorkflow(ctx: import("../cli/registry").CommandC
|
|
|
712
714
|
...(args.buildCommand ? { build: args.buildCommand } : {}),
|
|
713
715
|
...(args.ciChant ? { chant: args.ciChant } : {}),
|
|
714
716
|
});
|
|
715
|
-
const target = args.output ? resolve(process.cwd(), args.output) : join(repoRoot, release?.workflow?.file ?? RELEASE_WORKFLOW_FILES[forge]);
|
|
716
717
|
// #4909: under `chant dev generated-check` the header names the committed file the render stands for.
|
|
717
|
-
|
|
718
|
-
const
|
|
718
|
+
// #4950: with no --output the file goes to the render tree too, so a render needs no `--output {out}/...`.
|
|
719
|
+
const { committedPathOf, isRenderPath, renderPathOf } = await import("../generated-check");
|
|
719
720
|
const defaultTarget = join(repoRoot, release?.workflow?.file ?? RELEASE_WORKFLOW_FILES[forge]);
|
|
721
|
+
const target = args.output ? resolve(process.cwd(), args.output) : renderPathOf(defaultTarget);
|
|
722
|
+
const asCommitted = committedPathOf(target);
|
|
720
723
|
const parts = ["chant", "release", "workflow", "--forge", forge];
|
|
721
724
|
if (args.ciInstall) parts.push("--install", args.ciInstall);
|
|
722
725
|
if (args.buildCommand) parts.push("--build", args.buildCommand);
|
|
@@ -76,24 +76,31 @@ function policyOf(dir: string): { passed: boolean; reason: string } | null {
|
|
|
76
76
|
return standing === 0 ? { passed: true, reason: "the policy denied nothing that stands" } : { passed: false, reason: `the policy denied ${standing} unit${standing === 1 ? "" : "s"} with no override` };
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
/**
|
|
80
|
-
|
|
79
|
+
/**
|
|
80
|
+
* The checks to sign from the plan job's hand-off directory and result, and
|
|
81
|
+
* those left unsigned with why. #4964: a workspace member's plan job plans
|
|
82
|
+
* that member alone, so with `member` the two are `plan:<member>` and
|
|
83
|
+
* `policy:<member>`.
|
|
84
|
+
*/
|
|
85
|
+
export function planReportChecks(dir: string, result: string | undefined, member?: string): { sign: Array<{ check: string; claim?: Buffer }>; skipped: CheckEvidenceNote["skipped"] } {
|
|
86
|
+
const planCheck = member ? `plan:${member}` : "plan";
|
|
87
|
+
const policyCheck = member ? `policy:${member}` : "policy";
|
|
81
88
|
const file = [REPORT_FILE, HANDOFF_FILE].map((f) => join(dir, f)).find((f) => existsSync(f));
|
|
82
89
|
if (result !== "success") {
|
|
83
90
|
const why = `the plan job's result is ${result ?? "not given"}`;
|
|
84
|
-
return { sign: [], skipped: [{ check:
|
|
91
|
+
return { sign: [], skipped: [{ check: planCheck, reason: why }, { check: policyCheck, reason: why }] };
|
|
85
92
|
}
|
|
86
93
|
if (!file) {
|
|
87
94
|
const why = `the plan job left no ${REPORT_FILE} or ${HANDOFF_FILE}`;
|
|
88
|
-
return { sign: [], skipped: [{ check:
|
|
95
|
+
return { sign: [], skipped: [{ check: planCheck, reason: why }, { check: policyCheck, reason: why }] };
|
|
89
96
|
}
|
|
90
97
|
const claim = readFileSync(file);
|
|
91
|
-
const sign: Array<{ check: string; claim?: Buffer }> = [{ check:
|
|
98
|
+
const sign: Array<{ check: string; claim?: Buffer }> = [{ check: planCheck, claim }];
|
|
92
99
|
const skipped: CheckEvidenceNote["skipped"] = [];
|
|
93
100
|
const policy = policyOf(dir);
|
|
94
|
-
if (policy === null) skipped.push({ check:
|
|
95
|
-
else if (policy.passed) sign.push({ check:
|
|
96
|
-
else skipped.push({ check:
|
|
101
|
+
if (policy === null) skipped.push({ check: policyCheck, reason: "the plan ran no policy" });
|
|
102
|
+
else if (policy.passed) sign.push({ check: policyCheck, claim });
|
|
103
|
+
else skipped.push({ check: policyCheck, reason: policy.reason });
|
|
97
104
|
return { sign, skipped };
|
|
98
105
|
}
|
|
99
106
|
|
|
@@ -120,6 +120,11 @@ describe("the plan job's two checks (#4870)", () => {
|
|
|
120
120
|
expect(planReportChecks(dir(handoff([{ member: "a", rules: ["r"], overriders: [] }])), "success").sign.map((c) => c.check)).toEqual(["plan"]);
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
+
test("a workspace member's plan job signs its checks under the member's name (#4964)", () => {
|
|
124
|
+
expect(planReportChecks(dir({ "pr-plan.json": { policy: { result: "passed" } } }), "success", "app").sign.map((c) => c.check)).toEqual(["plan:app", "policy:app"]);
|
|
125
|
+
expect(planReportChecks(dir({ "pr-plan.json": {} }), "failure", "app").skipped.map((s) => s.check)).toEqual(["plan:app", "policy:app"]);
|
|
126
|
+
});
|
|
127
|
+
|
|
123
128
|
test("a failed plan job signs neither, and the note line says which were signed", () => {
|
|
124
129
|
const failed = planReportChecks(dir({ "pr-plan.json": { policy: { result: "passed" } } }), "failure");
|
|
125
130
|
expect(failed.sign).toEqual([]);
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
describeDecision,
|
|
28
28
|
readRefGateLedger,
|
|
29
29
|
refGateLedgerPath,
|
|
30
|
+
REF_GATE_STATUS,
|
|
30
31
|
RefUpdateInputError,
|
|
31
32
|
runPrePush,
|
|
32
33
|
runPreReceive,
|
|
@@ -192,17 +193,20 @@ export async function runWorkspaceRefGate(ctx: CommandContext): Promise<number>
|
|
|
192
193
|
if (!args.dryRun) appendRefGateLedger(ledger, [{ ...d, version: 1, kind: "ref-update", site, timestamp: now }]);
|
|
193
194
|
print(args.json, [d], args.dryRun ? undefined : ledger, "out");
|
|
194
195
|
if (site === "check" && d.decision === "refuse" && !args.dryRun && !here.bare) await recordRequests(here.repo, [d], now);
|
|
195
|
-
|
|
196
|
+
const context = refGateStatusContext(d);
|
|
197
|
+
if (site === "status" && context !== null) {
|
|
196
198
|
if (args.dryRun) {
|
|
197
|
-
console.error(`chant ref gate: would set ${
|
|
199
|
+
console.error(`chant ref gate: would set ${context} to ${d.decision === "admit" ? "success" : "failure"} on ${at.slice(0, 8)}`);
|
|
198
200
|
} else {
|
|
199
|
-
const { detectForge
|
|
201
|
+
const { detectForge } = await import("../../pr-forge");
|
|
200
202
|
const kind = detectForge();
|
|
201
203
|
if (!kind) {
|
|
202
|
-
console.error(formatError({ message: `no forge detected, so ${
|
|
204
|
+
console.error(formatError({ message: `no forge detected, so ${context} was not set`, hint: "run it in a GitHub, GitLab or Forgejo job, or pass --dry-run" }));
|
|
203
205
|
return 1;
|
|
204
206
|
}
|
|
205
|
-
|
|
207
|
+
// #4964: `--at` is a pull_request run's merge preview; the status goes on the pull request's head.
|
|
208
|
+
const { forgeFromJobEnv } = await import("../../pr-forge-job");
|
|
209
|
+
await postRefGateStatus(forgeFromJobEnv(kind), d);
|
|
206
210
|
}
|
|
207
211
|
}
|
|
208
212
|
return d.decision === "admit" ? 0 : 1;
|
|
@@ -244,7 +248,8 @@ async function statusOpen(repo: string, ref: string, baseRev: string | undefined
|
|
|
244
248
|
const d = decideRefUpdate({ repo, update: { ref, old: base, new: pr.headSha }, base, spent, now });
|
|
245
249
|
decisions.push(d);
|
|
246
250
|
if (dryRun) {
|
|
247
|
-
|
|
251
|
+
const context = refGateStatusContext(d);
|
|
252
|
+
if (context !== null) console.error(`chant ref gate: would set ${context} to ${d.decision === "admit" ? "success" : "failure"} on #${pr.number} at ${pr.headSha.slice(0, 8)}`);
|
|
248
253
|
continue;
|
|
249
254
|
}
|
|
250
255
|
appendRefGateLedger(ledger, [{ ...d, version: 1, kind: "ref-update", site: "status", timestamp: now }]);
|
|
@@ -259,9 +264,26 @@ async function statusOpen(repo: string, ref: string, baseRev: string | undefined
|
|
|
259
264
|
return 0;
|
|
260
265
|
}
|
|
261
266
|
|
|
262
|
-
/** The
|
|
267
|
+
/** The status `d` sets: its rule's, or `chant/ref-gate` when the gate could not decide (#4964); null when no rule matched. */
|
|
268
|
+
export function refGateStatusContext(d: Pick<RefDecision, "status" | "error">): string | null {
|
|
269
|
+
return d.status ?? (d.error ? REF_GATE_STATUS : null);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* The commit status a forge requires for `d`'s ref: `success` when it is
|
|
274
|
+
* admitted, `failure` naming the missing checks when not. A gate that could
|
|
275
|
+
* not decide (#4964: the policy at base does not read, or the commit is not
|
|
276
|
+
* there) fails `chant/ref-gate` closed: the policy that would name another
|
|
277
|
+
* status is the one that did not read, and a forge that requires the status
|
|
278
|
+
* then refuses the merge rather than waiting for a status that never comes.
|
|
279
|
+
*/
|
|
263
280
|
export async function postRefGateStatus(forge: { setStatus(sha: string, status: { context: string; state: "success" | "failure"; description: string }): Promise<void> }, d: RefDecision): Promise<void> {
|
|
264
|
-
|
|
281
|
+
const context = refGateStatusContext(d);
|
|
282
|
+
if (context === null || d.new === null) return;
|
|
283
|
+
if (d.status === null) {
|
|
284
|
+
await forge.setStatus(d.new, { context, state: "failure", description: `refused: ${d.error!.code}` });
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
265
287
|
const missing = d.checks.filter((c) => c.action === "block" && (c.status === "missing" || c.status === "stale"));
|
|
266
288
|
const overridden = d.checks.filter((c) => c.status === "overridden").map((c) => c.check);
|
|
267
289
|
const description = d.error
|