@intentius/chant 0.124.88 → 0.124.90
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 +193 -0
- package/dist/ci-comment-commands.d.ts.map +1 -0
- package/dist/ci-comment-commands.js +353 -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-job-guard.d.ts +42 -45
- package/dist/ci-job-guard.d.ts.map +1 -1
- package/dist/ci-job-guard.js +206 -3
- package/dist/ci-note-commands.d.ts +104 -4
- package/dist/ci-note-commands.d.ts.map +1 -1
- package/dist/ci-note-commands.js +131 -38
- 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 +72 -1
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +73 -6
- 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 +33 -0
- package/dist/cli/handlers/pr-comment.d.ts.map +1 -0
- package/dist/cli/handlers/pr-comment.js +201 -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-notes.d.ts.map +1 -1
- package/dist/cli/handlers/pr-notes.js +23 -1
- 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 +71 -23
- 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 +180 -4
- 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 +41 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +31 -0
- package/dist/cli/registry.d.ts +19 -1
- 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 +97 -6
- package/dist/components/pr-checks.d.ts.map +1 -1
- package/dist/components/pr-checks.js +107 -13
- package/dist/components/pr-pipeline.d.ts +19 -14
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +7 -13
- package/dist/components/product-pipeline.d.ts +96 -3
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +120 -14
- package/dist/components/product-plan.d.ts +203 -6
- package/dist/components/product-plan.d.ts.map +1 -1
- package/dist/components/product-plan.js +250 -43
- 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 +63 -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 +93 -4
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-applied.d.ts +9 -0
- package/dist/lifecycle/gate-applied.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/apply-status.d.ts +84 -0
- package/dist/op/apply-status.d.ts.map +1 -0
- package/dist/op/apply-status.js +106 -0
- package/dist/op/before-merge-decide.d.ts +102 -0
- package/dist/op/before-merge-decide.d.ts.map +1 -0
- package/dist/op/before-merge-decide.js +142 -0
- package/dist/op/before-merge-done.d.ts +56 -0
- package/dist/op/before-merge-done.d.ts.map +1 -0
- package/dist/op/before-merge-done.js +69 -0
- package/dist/op/before-merge-store.d.ts +20 -0
- package/dist/op/before-merge-store.d.ts.map +1 -0
- package/dist/op/before-merge-store.js +48 -0
- package/dist/op/before-merge.d.ts +150 -0
- package/dist/op/before-merge.d.ts.map +1 -0
- package/dist/op/before-merge.js +207 -0
- package/dist/op/follow-on-run.d.ts +117 -0
- package/dist/op/follow-on-run.d.ts.map +1 -0
- package/dist/op/follow-on-run.js +154 -0
- package/dist/op/follow-on-store.d.ts +17 -0
- package/dist/op/follow-on-store.d.ts.map +1 -0
- package/dist/op/follow-on-store.js +54 -0
- package/dist/op/gate.d.ts +6 -0
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +10 -1
- package/dist/op/index.d.ts +5 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +2 -0
- package/dist/op/op-waves-after-plan.d.ts +13 -0
- package/dist/op/op-waves-after-plan.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.d.ts +10 -2
- package/dist/op/op-waves-evidence-jobs.d.ts.map +1 -1
- package/dist/op/op-waves-evidence-jobs.js +19 -5
- package/dist/op/op-waves-follow-on.d.ts +162 -0
- package/dist/op/op-waves-follow-on.d.ts.map +1 -0
- package/dist/op/op-waves-follow-on.js +355 -0
- 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 +148 -6
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +873 -100
- package/dist/op/op-waves-split.d.ts +122 -0
- package/dist/op/op-waves-split.d.ts.map +1 -0
- package/dist/op/op-waves-split.js +166 -0
- package/dist/op/op-waves.d.ts +24 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +18 -1
- package/dist/op/schedule-overdue.d.ts +15 -1
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +77 -5
- package/dist/op/stage-hooks.d.ts +36 -1
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +17 -3
- package/dist/op/wave-stop.d.ts +67 -0
- package/dist/op/wave-stop.d.ts.map +1 -0
- package/dist/op/wave-stop.js +129 -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 +146 -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 +39 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +63 -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-blocked.d.ts +7 -1
- package/dist/wave-blocked.d.ts.map +1 -1
- package/dist/wave-blocked.js +7 -2
- package/dist/wave-runtime.mjs +366 -350
- 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 +439 -0
- package/src/ci-comment-commands.ts +428 -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 -10
- package/src/ci-image.ts +85 -12
- package/src/ci-job-guard.before-merge.test.ts +148 -0
- package/src/ci-job-guard.follow-on-record.test.ts +137 -0
- package/src/ci-job-guard.follow-on.test.ts +144 -0
- package/src/ci-job-guard.ts +221 -3
- package/src/ci-note-commands.test.ts +76 -1
- package/src/ci-note-commands.ts +198 -46
- package/src/ci-product-words.ts +59 -0
- package/src/ci-product.ts +90 -6
- 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 +187 -0
- package/src/cli/handlers/pr-env.ts +6 -3
- package/src/cli/handlers/pr-notes.ts +30 -6
- package/src/cli/handlers/pr-record.test.ts +1 -1
- package/src/cli/handlers/pr.ts +64 -21
- 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 +170 -4
- package/src/cli/handlers/run.ts +2 -1
- package/src/cli/main.ts +41 -2
- package/src/cli/parse-args.ts +23 -0
- package/src/cli/registry.ts +19 -1
- package/src/components/auto-release.ts +2 -1
- package/src/components/pr-checks.ts +165 -17
- package/src/components/pr-pipeline.ts +22 -18
- package/src/components/product-pipeline.apply-status.test.ts +50 -0
- package/src/components/product-pipeline.ts +204 -17
- package/src/components/product-plan.test.ts +60 -4
- package/src/components/product-plan.ts +367 -50
- package/src/drift-record.test.ts +20 -0
- package/src/drift-record.ts +16 -0
- package/src/floor-table.data.ts +63 -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 +89 -1
- package/src/lifecycle/gate-applied.ts +7 -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/apply-status.test.ts +83 -0
- package/src/op/apply-status.ts +132 -0
- package/src/op/before-merge-decide.ts +190 -0
- package/src/op/before-merge-done.ts +99 -0
- package/src/op/before-merge-store.ts +44 -0
- package/src/op/before-merge.test.ts +201 -0
- package/src/op/before-merge.ts +266 -0
- package/src/op/follow-on-run.ts +206 -0
- package/src/op/follow-on-store.ts +54 -0
- package/src/op/gate-resume.test.ts +27 -0
- package/src/op/gate.ts +16 -1
- package/src/op/index.ts +15 -0
- package/src/op/op-waves-after-plan.ts +13 -0
- package/src/op/op-waves-evidence-jobs.ts +21 -7
- package/src/op/op-waves-follow-on-record.test.ts +152 -0
- package/src/op/op-waves-follow-on.test.ts +247 -0
- package/src/op/op-waves-follow-on.ts +385 -0
- package/src/op/op-waves-notify-words.test.ts +18 -0
- package/src/op/op-waves-render-spec.test.ts +159 -0
- package/src/op/op-waves-render-spec.ts +171 -0
- package/src/op/op-waves-run.ts +973 -94
- package/src/op/op-waves-split-product.test.ts +288 -0
- package/src/op/op-waves-split-step.test.ts +298 -0
- package/src/op/op-waves-split.test.ts +196 -0
- package/src/op/op-waves-split.ts +189 -0
- package/src/op/op-waves.ts +31 -3
- package/src/op/schedule-overdue.test.ts +72 -1
- package/src/op/schedule-overdue.ts +84 -6
- package/src/op/stage-hooks.ts +52 -4
- package/src/op/wave-stop.test.ts +72 -0
- package/src/op/wave-stop.ts +139 -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 +151 -15
- package/src/pr-status.ts +91 -0
- package/src/ref-gate-init.ts +30 -11
- package/src/release-floors.ts +81 -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/wave-blocked.ts +9 -4
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-green-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/ci-green-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAA4G,cAAc,EAAE,MAAM,YAAY,CAAC;AAWtJ,OA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c,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBpE;AAeD,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiFxE"}
|
|
@@ -234,10 +234,11 @@ export async function runCiWorkflow(ctx) {
|
|
|
234
234
|
const root = realpathSync(found.dir);
|
|
235
235
|
const repoRoot = gitTop(root) ?? root;
|
|
236
236
|
const member = resolveMemberContext(cwd, found);
|
|
237
|
-
const target = ctx.args.output ? resolve(realpathSync(cwd), ctx.args.output) : join(repoRoot, CI_GREEN_WORKFLOW_FILE);
|
|
238
237
|
// #4909: under `chant dev generated-check` the file goes to the render
|
|
239
|
-
// tree; it is read and named as the committed file it stands for.
|
|
238
|
+
// tree; it is read and named as the committed file it stands for. #4950:
|
|
239
|
+
// with no --output too, so a render needs no `--output {out}/...`.
|
|
240
240
|
const { committedPathOf, isRenderPath, renderPathOf } = await import("../generated-check.js");
|
|
241
|
+
const target = ctx.args.output ? resolve(realpathSync(cwd), ctx.args.output) : renderPathOf(join(repoRoot, CI_GREEN_WORKFLOW_FILE));
|
|
241
242
|
const rendering = isRenderPath(target);
|
|
242
243
|
const asCommitted = committedPathOf(target);
|
|
243
244
|
const fromRepo = relative(repoRoot, asCommitted).split(sep).join("/");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-train.d.ts","sourceRoot":"","sources":["../../src/workspace/release-train.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"release-train.d.ts","sourceRoot":"","sources":["../../src/workspace/release-train.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOtD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,gCA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kspaceReadError } from "./declaration.js";
|
|
17
17
|
import { locateWorkspace } from "./which-chant.js";
|
|
18
18
|
import { appendWorkspaceLine, readWorkspaceLines } from "./workspace-ledger.js";
|
|
19
|
+
import { actorFromEnv } from "../actor.js";
|
|
19
20
|
const TRAINS_FILE = "trains.jsonl";
|
|
20
21
|
/**
|
|
21
22
|
* Pick each member's release, pure. `pins` maps a member to a label or a
|
|
@@ -112,7 +113,7 @@ export async function runWorkspaceTrain(ctx) {
|
|
|
112
113
|
console.error(` ${p}`);
|
|
113
114
|
return 1;
|
|
114
115
|
}
|
|
115
|
-
const actor = ctx.args.actor ??
|
|
116
|
+
const actor = ctx.args.actor ?? actorFromEnv();
|
|
116
117
|
const record = { version: 1, id: `train-${randomUUID()}`, env, timestamp: new Date().toISOString(), actor, members: picked.members };
|
|
117
118
|
if (!ctx.args.dryRun)
|
|
118
119
|
await appendReleaseTrain(root, record);
|
|
@@ -128,8 +128,8 @@ export declare const NPM_TRUSTED_PUBLISHING_SETUP = "have=\"$(npm --version)\";
|
|
|
128
128
|
export declare function targetExtras(forge: ReleaseWorkflowForge, targets: ReadonlyArray<ReleaseWorkflowTarget>, p: ReleasePipelineConfig): Pick<ReleasePipelineConfig, "permissions" | "env" | "setup">;
|
|
129
129
|
/** The platform the jobs `chant release workflow` writes run on: GitHub's and Forgejo's `ubuntu-latest`, and a GitLab runner's default (#4876). */
|
|
130
130
|
export declare const RELEASE_RUNNER_PLATFORM = "linux/amd64";
|
|
131
|
-
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876). */
|
|
132
|
-
export declare const RELEASE_BINFMT_IMAGE
|
|
131
|
+
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876): the repository, which a config's own setup line is recognised by. */
|
|
132
|
+
export declare const RELEASE_BINFMT_IMAGE: string;
|
|
133
133
|
/** The architectures among `platforms` the runner can't run, as QEMU names them (`linux/arm/v7` is `arm`), each once. */
|
|
134
134
|
export declare function qemuArchitectures(platforms: readonly string[]): string[];
|
|
135
135
|
/**
|
|
@@ -137,7 +137,8 @@ export declare function qemuArchitectures(platforms: readonly string[]): string[
|
|
|
137
137
|
* runner can't, such as `linux/arm64` on an amd64 runner (#4876), so no
|
|
138
138
|
* product names it in `release.workflow.setup`. GitHub and Forgejo get
|
|
139
139
|
* `docker/setup-qemu-action` at its pin; GitLab a `docker run --privileged`
|
|
140
|
-
* of {@link RELEASE_BINFMT_IMAGE}
|
|
140
|
+
* of {@link RELEASE_BINFMT_IMAGE} by the digest `IMAGE_PINS.binfmt` records
|
|
141
|
+
* (#4941, ../image-pins.ts), which `chant release workflow` notes needs
|
|
141
142
|
* an executor that runs privileged containers. A config whose `setup` names
|
|
142
143
|
* the action or the binfmt image already gets nothing more, so its file
|
|
143
144
|
* renders as it did.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-workflow.d.ts","sourceRoot":"","sources":["../../src/workspace/release-workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"release-workflow.d.ts","sourceRoot":"","sources":["../../src/workspace/release-workflow.ts"],"names":[],"mappings":"AAiCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,uBAAuB,YAAI,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAChF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAKvE,CAAC;AAEF,yGAAyG;AACzG,MAAM,WAAW,qBAAqB;IACpC,8HAA8H;IAC9H,OAAO,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC7B,iLAAiL;IACjL,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC7B,wEAAwE;IACxE,OAA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;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAItE,CAAC;AAOF,iEAAiE;AACjE,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAoHzE;AAuFD,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,yBAAyB,CAAC;AAuN9D,wFAAwF;AACxF,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,OAAO,iBAAiB,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuEvG"}
|
|
@@ -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.js";
|
|
31
|
+
import { IMAGE_PINS, imageRef } from "../image-pins.js";
|
|
31
32
|
import { releaseImagePlatforms, resolveReleaseImages } from "../lifecycle/release-images.js";
|
|
32
33
|
import { GENERATED_MARKER } from "../discovery/files.js";
|
|
33
34
|
export const RELEASE_WORKFLOW_FORGES = ["github", "forgejo", "gitlab"];
|
|
@@ -75,8 +76,8 @@ export function targetExtras(forge, targets, p) {
|
|
|
75
76
|
}
|
|
76
77
|
/** The platform the jobs `chant release workflow` writes run on: GitHub's and Forgejo's `ubuntu-latest`, and a GitLab runner's default (#4876). */
|
|
77
78
|
export const RELEASE_RUNNER_PLATFORM = "linux/amd64";
|
|
78
|
-
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876). */
|
|
79
|
-
export const RELEASE_BINFMT_IMAGE =
|
|
79
|
+
/** The binfmt image a GitLab job installs QEMU's handlers with (#4876): the repository, which a config's own setup line is recognised by. */
|
|
80
|
+
export const RELEASE_BINFMT_IMAGE = IMAGE_PINS.binfmt.repository;
|
|
80
81
|
/** The architectures among `platforms` the runner can't run, as QEMU names them (`linux/arm/v7` is `arm`), each once. */
|
|
81
82
|
export function qemuArchitectures(platforms) {
|
|
82
83
|
return [...new Set(platforms.filter((p) => p.split("/").slice(0, 2).join("/") !== RELEASE_RUNNER_PLATFORM).map((p) => p.split("/")[1] ?? p))].sort();
|
|
@@ -86,7 +87,8 @@ export function qemuArchitectures(platforms) {
|
|
|
86
87
|
* runner can't, such as `linux/arm64` on an amd64 runner (#4876), so no
|
|
87
88
|
* product names it in `release.workflow.setup`. GitHub and Forgejo get
|
|
88
89
|
* `docker/setup-qemu-action` at its pin; GitLab a `docker run --privileged`
|
|
89
|
-
* of {@link RELEASE_BINFMT_IMAGE}
|
|
90
|
+
* of {@link RELEASE_BINFMT_IMAGE} by the digest `IMAGE_PINS.binfmt` records
|
|
91
|
+
* (#4941, ../image-pins.ts), which `chant release workflow` notes needs
|
|
90
92
|
* an executor that runs privileged containers. A config whose `setup` names
|
|
91
93
|
* the action or the binfmt image already gets nothing more, so its file
|
|
92
94
|
* renders as it did.
|
|
@@ -98,7 +100,7 @@ export function qemuSetup(forge, platforms, p) {
|
|
|
98
100
|
const named = (p.setup ?? []).some((s) => ("uses" in s ? /^docker\/setup-qemu-action@/.test(s.uses) : s.run.includes(RELEASE_BINFMT_IMAGE)));
|
|
99
101
|
if (named)
|
|
100
102
|
return [];
|
|
101
|
-
return forge === "gitlab" ? [{ run: `docker run --privileged --rm ${
|
|
103
|
+
return forge === "gitlab" ? [{ run: `docker run --privileged --rm ${imageRef(IMAGE_PINS.binfmt)} --install ${archs.join(",")}` }] : [{ uses: usesRef(ACTION_PINS.dockerSetupQemu4), with: { platforms: archs.join(",") } }];
|
|
102
104
|
}
|
|
103
105
|
/** The flags `chant release publish` gets under the groups. */
|
|
104
106
|
export function publishFlags(groups) {
|
|
@@ -531,11 +533,12 @@ export async function runReleaseWorkflow(ctx) {
|
|
|
531
533
|
...(args.buildCommand ? { build: args.buildCommand } : {}),
|
|
532
534
|
...(args.ciChant ? { chant: args.ciChant } : {}),
|
|
533
535
|
});
|
|
534
|
-
const target = args.output ? resolve(process.cwd(), args.output) : join(repoRoot, release?.workflow?.file ?? RELEASE_WORKFLOW_FILES[forge]);
|
|
535
536
|
// #4909: under `chant dev generated-check` the header names the committed file the render stands for.
|
|
536
|
-
|
|
537
|
-
const
|
|
537
|
+
// #4950: with no --output the file goes to the render tree too, so a render needs no `--output {out}/...`.
|
|
538
|
+
const { committedPathOf, isRenderPath, renderPathOf } = await import("../generated-check.js");
|
|
538
539
|
const defaultTarget = join(repoRoot, release?.workflow?.file ?? RELEASE_WORKFLOW_FILES[forge]);
|
|
540
|
+
const target = args.output ? resolve(process.cwd(), args.output) : renderPathOf(defaultTarget);
|
|
541
|
+
const asCommitted = committedPathOf(target);
|
|
539
542
|
const parts = ["chant", "release", "workflow", "--forge", forge];
|
|
540
543
|
if (args.ciInstall)
|
|
541
544
|
parts.push("--install", args.ciInstall);
|
|
@@ -42,8 +42,13 @@ export interface CheckEvidenceNote {
|
|
|
42
42
|
reason: string;
|
|
43
43
|
}>;
|
|
44
44
|
}
|
|
45
|
-
/**
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The checks to sign from the plan job's hand-off directory and result, and
|
|
47
|
+
* those left unsigned with why. #4964: a workspace member's plan job plans
|
|
48
|
+
* that member alone, so with `member` the two are `plan:<member>` and
|
|
49
|
+
* `policy:<member>`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function planReportChecks(dir: string, result: string | undefined, member?: string): {
|
|
47
52
|
sign: Array<{
|
|
48
53
|
check: string;
|
|
49
54
|
claim?: Buffer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-evidence-report.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/check-evidence-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,oHAAoH;AACpH,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAEzD,4HAA4H;AAC5H,eAAO,MAAM,sBAAsB,6BAA6B,CAAC;A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C;CACnD;AAkCD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;CAAE,CAoBpL;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAWrE"}
|
|
@@ -66,27 +66,34 @@ function policyOf(dir) {
|
|
|
66
66
|
const standing = overrides.filter((o) => !o.override).length;
|
|
67
67
|
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` };
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
70
|
-
|
|
69
|
+
/**
|
|
70
|
+
* The checks to sign from the plan job's hand-off directory and result, and
|
|
71
|
+
* those left unsigned with why. #4964: a workspace member's plan job plans
|
|
72
|
+
* that member alone, so with `member` the two are `plan:<member>` and
|
|
73
|
+
* `policy:<member>`.
|
|
74
|
+
*/
|
|
75
|
+
export function planReportChecks(dir, result, member) {
|
|
76
|
+
const planCheck = member ? `plan:${member}` : "plan";
|
|
77
|
+
const policyCheck = member ? `policy:${member}` : "policy";
|
|
71
78
|
const file = [REPORT_FILE, HANDOFF_FILE].map((f) => join(dir, f)).find((f) => existsSync(f));
|
|
72
79
|
if (result !== "success") {
|
|
73
80
|
const why = `the plan job's result is ${result ?? "not given"}`;
|
|
74
|
-
return { sign: [], skipped: [{ check:
|
|
81
|
+
return { sign: [], skipped: [{ check: planCheck, reason: why }, { check: policyCheck, reason: why }] };
|
|
75
82
|
}
|
|
76
83
|
if (!file) {
|
|
77
84
|
const why = `the plan job left no ${REPORT_FILE} or ${HANDOFF_FILE}`;
|
|
78
|
-
return { sign: [], skipped: [{ check:
|
|
85
|
+
return { sign: [], skipped: [{ check: planCheck, reason: why }, { check: policyCheck, reason: why }] };
|
|
79
86
|
}
|
|
80
87
|
const claim = readFileSync(file);
|
|
81
|
-
const sign = [{ check:
|
|
88
|
+
const sign = [{ check: planCheck, claim }];
|
|
82
89
|
const skipped = [];
|
|
83
90
|
const policy = policyOf(dir);
|
|
84
91
|
if (policy === null)
|
|
85
|
-
skipped.push({ check:
|
|
92
|
+
skipped.push({ check: policyCheck, reason: "the plan ran no policy" });
|
|
86
93
|
else if (policy.passed)
|
|
87
|
-
sign.push({ check:
|
|
94
|
+
sign.push({ check: policyCheck, claim });
|
|
88
95
|
else
|
|
89
|
-
skipped.push({ check:
|
|
96
|
+
skipped.push({ check: policyCheck, reason: policy.reason });
|
|
90
97
|
return { sign, skipped };
|
|
91
98
|
}
|
|
92
99
|
/**
|
|
@@ -20,7 +20,16 @@ export declare const REF_GATE_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/sch
|
|
|
20
20
|
/** The line a hook chant writes carries, so `install` knows it may replace it. */
|
|
21
21
|
export declare const REF_GATE_HOOK_MARK = "# chant ref gate (#4867)";
|
|
22
22
|
export declare function runWorkspaceRefGate(ctx: CommandContext): Promise<number>;
|
|
23
|
-
/** The
|
|
23
|
+
/** The status `d` sets: its rule's, or `chant/ref-gate` when the gate could not decide (#4964); null when no rule matched. */
|
|
24
|
+
export declare function refGateStatusContext(d: Pick<RefDecision, "status" | "error">): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* The commit status a forge requires for `d`'s ref: `success` when it is
|
|
27
|
+
* admitted, `failure` naming the missing checks when not. A gate that could
|
|
28
|
+
* not decide (#4964: the policy at base does not read, or the commit is not
|
|
29
|
+
* there) fails `chant/ref-gate` closed: the policy that would name another
|
|
30
|
+
* status is the one that did not read, and a forge that requires the status
|
|
31
|
+
* then refuses the merge rather than waiting for a status that never comes.
|
|
32
|
+
*/
|
|
24
33
|
export declare function postRefGateStatus(forge: {
|
|
25
34
|
setStatus(sha: string, status: {
|
|
26
35
|
context: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref-gate-cli.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/ref-gate-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,
|
|
1
|
+
{"version":3,"file":"ref-gate-cli.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/ref-gate-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAaL,KAAK,WAAW,EAGjB,MAAM,YAAY,CAAC;AAIpB,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,yBAAyB,kFAAkF,CAAC;AACzH,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AA0F7D,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8E9E;AAsDD,8HAA8H;AAC9H,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAE5F;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,EAAE;IAAE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAevM;AAED,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,UAAU,EAAE,OAAO,SAAU,GAAG,MAAM,CAEvF"}
|
|
@@ -17,7 +17,7 @@ import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "n
|
|
|
17
17
|
import { join } from "node:path";
|
|
18
18
|
import { formatError, formatSuccess } from "../../cli/format.js";
|
|
19
19
|
import { readerVersion } from "../declaration.js";
|
|
20
|
-
import { appendRefGateLedger, attachEvidence, commitOf, decideRefUpdate, describeDecision, readRefGateLedger, refGateLedgerPath, RefUpdateInputError, runPrePush, runPreReceive, spentOverrides, } from "./ref-gate.js";
|
|
20
|
+
import { appendRefGateLedger, attachEvidence, commitOf, decideRefUpdate, describeDecision, readRefGateLedger, refGateLedgerPath, REF_GATE_STATUS, RefUpdateInputError, runPrePush, runPreReceive, spentOverrides, } from "./ref-gate.js";
|
|
21
21
|
import { resolveBase } from "./provenance.js";
|
|
22
22
|
import { spawnSync } from "node:child_process";
|
|
23
23
|
export const REF_GATE_CONTRACT_VERSION = 1;
|
|
@@ -181,18 +181,21 @@ export async function runWorkspaceRefGate(ctx) {
|
|
|
181
181
|
print(args.json, [d], args.dryRun ? undefined : ledger, "out");
|
|
182
182
|
if (site === "check" && d.decision === "refuse" && !args.dryRun && !here.bare)
|
|
183
183
|
await recordRequests(here.repo, [d], now);
|
|
184
|
-
|
|
184
|
+
const context = refGateStatusContext(d);
|
|
185
|
+
if (site === "status" && context !== null) {
|
|
185
186
|
if (args.dryRun) {
|
|
186
|
-
console.error(`chant ref gate: would set ${
|
|
187
|
+
console.error(`chant ref gate: would set ${context} to ${d.decision === "admit" ? "success" : "failure"} on ${at.slice(0, 8)}`);
|
|
187
188
|
}
|
|
188
189
|
else {
|
|
189
|
-
const { detectForge
|
|
190
|
+
const { detectForge } = await import("../../pr-forge.js");
|
|
190
191
|
const kind = detectForge();
|
|
191
192
|
if (!kind) {
|
|
192
|
-
console.error(formatError({ message: `no forge detected, so ${
|
|
193
|
+
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" }));
|
|
193
194
|
return 1;
|
|
194
195
|
}
|
|
195
|
-
|
|
196
|
+
// #4964: `--at` is a pull_request run's merge preview; the status goes on the pull request's head.
|
|
197
|
+
const { forgeFromJobEnv } = await import("../../pr-forge-job.js");
|
|
198
|
+
await postRefGateStatus(forgeFromJobEnv(kind), d);
|
|
196
199
|
}
|
|
197
200
|
}
|
|
198
201
|
return d.decision === "admit" ? 0 : 1;
|
|
@@ -236,8 +239,9 @@ async function statusOpen(repo, ref, baseRev, ledgerFlag, dryRun, json, now) {
|
|
|
236
239
|
const d = decideRefUpdate({ repo, update: { ref, old: base, new: pr.headSha }, base, spent, now });
|
|
237
240
|
decisions.push(d);
|
|
238
241
|
if (dryRun) {
|
|
239
|
-
|
|
240
|
-
|
|
242
|
+
const context = refGateStatusContext(d);
|
|
243
|
+
if (context !== null)
|
|
244
|
+
console.error(`chant ref gate: would set ${context} to ${d.decision === "admit" ? "success" : "failure"} on #${pr.number} at ${pr.headSha.slice(0, 8)}`);
|
|
241
245
|
continue;
|
|
242
246
|
}
|
|
243
247
|
appendRefGateLedger(ledger, [{ ...d, version: 1, kind: "ref-update", site: "status", timestamp: now }]);
|
|
@@ -253,10 +257,26 @@ async function statusOpen(repo, ref, baseRev, ledgerFlag, dryRun, json, now) {
|
|
|
253
257
|
console.error(`chant ref gate: no open pull request into ${branch} to set a status on`);
|
|
254
258
|
return 0;
|
|
255
259
|
}
|
|
256
|
-
/** The
|
|
260
|
+
/** The status `d` sets: its rule's, or `chant/ref-gate` when the gate could not decide (#4964); null when no rule matched. */
|
|
261
|
+
export function refGateStatusContext(d) {
|
|
262
|
+
return d.status ?? (d.error ? REF_GATE_STATUS : null);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* The commit status a forge requires for `d`'s ref: `success` when it is
|
|
266
|
+
* admitted, `failure` naming the missing checks when not. A gate that could
|
|
267
|
+
* not decide (#4964: the policy at base does not read, or the commit is not
|
|
268
|
+
* there) fails `chant/ref-gate` closed: the policy that would name another
|
|
269
|
+
* status is the one that did not read, and a forge that requires the status
|
|
270
|
+
* then refuses the merge rather than waiting for a status that never comes.
|
|
271
|
+
*/
|
|
257
272
|
export async function postRefGateStatus(forge, d) {
|
|
258
|
-
|
|
273
|
+
const context = refGateStatusContext(d);
|
|
274
|
+
if (context === null || d.new === null)
|
|
259
275
|
return;
|
|
276
|
+
if (d.status === null) {
|
|
277
|
+
await forge.setStatus(d.new, { context, state: "failure", description: `refused: ${d.error.code}` });
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
260
280
|
const missing = d.checks.filter((c) => c.action === "block" && (c.status === "missing" || c.status === "stale"));
|
|
261
281
|
const overridden = d.checks.filter((c) => c.status === "overridden").map((c) => c.check);
|
|
262
282
|
const description = d.error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-run.d.ts","sourceRoot":"","sources":["../../src/workspace/workspace-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAsB,KAAK,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACvG,OAAO,EAAgE,KAAK,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAMnJ,OAAO,KAAK,EAAgB,cAAc,EAAE,MAAM,i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GAC3B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,mBAAmB,EAAE,CAAA;CAAE,GACrE;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,gBAAgB,EAAE,CAAA;CAAE,GAC/E;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AA0D/I,8HAA8H;AAC9H,wBAAsB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAkGzF;AAQD,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuE1E"}
|
|
@@ -43,6 +43,7 @@ import { executePlan, planMembers } from "./member-commands.js";
|
|
|
43
43
|
import { locateWorkspace } from "./which-chant.js";
|
|
44
44
|
import { appendWorkspaceRun } from "./workspace-ledger.js";
|
|
45
45
|
import { appendWorkspaceGatePending } from "./workspace-gates.js";
|
|
46
|
+
import { actorFromEnv } from "../actor.js";
|
|
46
47
|
/** `chant run`'s exit code for a run that stopped at an unapproved gate (`GATED_EXIT_CODE`). */
|
|
47
48
|
const GATED_EXIT = CHANT_EXIT.waiting;
|
|
48
49
|
const USAGE = "chant workspace run <member>/<op>... [--env <env>] [--gate <name>] [--dry-run] [--json] | chant workspace run --dependents-of <member> --op <op> [--env <env>] [--gate <name>] [--dry-run] [--json] | chant workspace run approve <gate> [--plan <digest>] [--approver <principal>]";
|
|
@@ -412,7 +413,7 @@ async function runWorkspaceRunApprove(ctx, words) {
|
|
|
412
413
|
return 1;
|
|
413
414
|
}
|
|
414
415
|
const { approveWorkspaceGate } = await import("./workspace-gates.js");
|
|
415
|
-
const approvedBy = ctx.args.approver ?? ctx.args.actor ??
|
|
416
|
+
const approvedBy = ctx.args.approver ?? ctx.args.actor ?? actorFromEnv();
|
|
416
417
|
try {
|
|
417
418
|
const record = await approveWorkspaceGate(resolve("."), {
|
|
418
419
|
gate,
|
package/package.json
CHANGED
package/src/actor.test.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/** #4911: one actor fallback for the lexicons' gated requests and the products' requesters. */
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { mkdtempSync, readdirSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join, relative } from "node:path";
|
|
6
|
+
import { beforeAll, describe, expect, test } from "vitest";
|
|
7
|
+
import { ACTOR_ENV_ORDER, actorFromEnv, actorOf, actorOrder } from "./actor";
|
|
4
8
|
|
|
5
9
|
test("the forge's actor, then the login, then unknown", () => {
|
|
6
10
|
expect(actorFromEnv({ GITHUB_ACTOR: "octo", GITLAB_USER_LOGIN: "gl", USER: "me" })).toBe("octo");
|
|
@@ -10,3 +14,65 @@ test("the forge's actor, then the login, then unknown", () => {
|
|
|
10
14
|
expect(actorFromEnv({})).toBe("unknown");
|
|
11
15
|
expect(actorFromEnv({}, "chant")).toBe("chant");
|
|
12
16
|
});
|
|
17
|
+
|
|
18
|
+
/** #4966: a product's requester order, with the triggering actor and git's user.name. */
|
|
19
|
+
describe("actorOf", () => {
|
|
20
|
+
let repo: string;
|
|
21
|
+
beforeAll(() => {
|
|
22
|
+
repo = mkdtempSync(join(tmpdir(), "chant-actor-"));
|
|
23
|
+
execFileSync("git", ["init", "-q", repo]);
|
|
24
|
+
execFileSync("git", ["-C", repo, "config", "user.name", "Ada Person"]);
|
|
25
|
+
execFileSync("git", ["-C", repo, "config", "user.email", "ada@example.com"]);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test("with no options it answers as actorFromEnv", () => {
|
|
29
|
+
for (const env of [{ GITHUB_ACTOR: "octo", USER: "me" }, { GITLAB_USER_LOGIN: "gl" }, { USERNAME: "win" }, {}]) {
|
|
30
|
+
expect(actorOf({ env })).toBe(actorFromEnv(env));
|
|
31
|
+
}
|
|
32
|
+
expect(actorOrder()).toEqual([...ACTOR_ENV_ORDER]);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("the triggering actor comes ahead of the forge's actor", () => {
|
|
36
|
+
expect(actorOf({ env: { GITHUB_TRIGGERING_ACTOR: "rerunner", GITHUB_ACTOR: "starter" }, triggering: true })).toBe("rerunner");
|
|
37
|
+
expect(actorOf({ env: { GITHUB_TRIGGERING_ACTOR: " ", GITHUB_ACTOR: "starter" }, triggering: true })).toBe("starter");
|
|
38
|
+
expect(actorOf({ env: { GITHUB_TRIGGERING_ACTOR: "rerunner", GITHUB_ACTOR: "starter" } })).toBe("starter");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("git's user.name comes after the forge's actor and before the login", () => {
|
|
42
|
+
expect(actorOf({ env: { GITHUB_ACTOR: "octo", USER: "me" }, repo })).toBe("octo");
|
|
43
|
+
expect(actorOf({ env: { USER: "me" }, repo })).toBe("Ada Person");
|
|
44
|
+
expect(actorOf({ env: { USER: "me" }, repo, gitKeys: ["user.email", "user.name"] })).toBe("ada@example.com");
|
|
45
|
+
expect(actorOrder({ triggering: true, repo })).toEqual(["GITHUB_TRIGGERING_ACTOR", "GITHUB_ACTOR", "GITLAB_USER_LOGIN", "git:user.name", "USER", "USERNAME"]);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test("the forge and the login can be left out, and the fallback named", () => {
|
|
49
|
+
expect(actorOf({ env: { GITHUB_ACTOR: "octo", USER: "me" }, forge: false, repo })).toBe("Ada Person");
|
|
50
|
+
expect(actorOf({ env: { USER: "me" }, triggering: true, login: false, fallback: "" })).toBe("");
|
|
51
|
+
expect(actorOf({ env: {}, fallback: "terragucci" })).toBe("terragucci");
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* #4952: chant's own handlers and records read the fallback from
|
|
57
|
+
* `actorFromEnv`, so none writes the order inline. A cut's actor
|
|
58
|
+
* (`lifecycle/release-workstation.ts`) is another order, with git's
|
|
59
|
+
* `user.email` between the forge and the login, and stays its own.
|
|
60
|
+
*/
|
|
61
|
+
test("no source under packages/core/src writes the actor fallback inline", () => {
|
|
62
|
+
const root = __dirname;
|
|
63
|
+
const own = new Set(["actor.ts", "lifecycle/release-workstation.ts"]);
|
|
64
|
+
const inline = /GITHUB_ACTOR\s*(?:\?\?|\|\|)\s*(?:process\.)?env\.GITLAB_USER_LOGIN/;
|
|
65
|
+
const found: string[] = [];
|
|
66
|
+
const walk = (dir: string): void => {
|
|
67
|
+
for (const name of readdirSync(dir)) {
|
|
68
|
+
const path = join(dir, name);
|
|
69
|
+
if (statSync(path).isDirectory()) {
|
|
70
|
+
if (name !== "node_modules" && name !== "__fixtures__") walk(path);
|
|
71
|
+
} else if (name.endsWith(".ts") && !name.endsWith(".test.ts") && !own.has(relative(root, path))) {
|
|
72
|
+
if (inline.test(readFileSync(path, "utf-8"))) found.push(relative(root, path));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
walk(root);
|
|
77
|
+
expect(found).toEqual([]);
|
|
78
|
+
});
|
package/src/actor.ts
CHANGED
|
@@ -3,9 +3,19 @@
|
|
|
3
3
|
* actor in a job (`GITHUB_ACTOR`, which Forgejo sets too, then
|
|
4
4
|
* `GITLAB_USER_LOGIN`), else the login (`USER`, `USERNAME` on Windows).
|
|
5
5
|
* The terraform and pulumi lexicons' gated requests and the products'
|
|
6
|
-
* requesters read it here rather than each writing the order
|
|
6
|
+
* requesters read it here rather than each writing the order, and so do
|
|
7
|
+
* chant's own CLI handlers and the records they write (#4952). A caller
|
|
8
|
+
* that refuses when nobody is named passes `""` as the fallback.
|
|
9
|
+
*
|
|
10
|
+
* {@link actorOf} is the same order with the two places a product's
|
|
11
|
+
* requester also looks (#4966): `GITHUB_TRIGGERING_ACTOR` ahead of the
|
|
12
|
+
* forge's actor, which names who re-ran a job rather than who started its
|
|
13
|
+
* run, and git's `user.name` in the checkout between the forge's actor and
|
|
14
|
+
* the login, which names the person at a laptop better than `$USER`.
|
|
7
15
|
*/
|
|
8
16
|
|
|
17
|
+
import { spawnSync } from "node:child_process";
|
|
18
|
+
|
|
9
19
|
/** The actor fallback's variables, in the order {@link actorFromEnv} reads them. */
|
|
10
20
|
export const ACTOR_ENV_ORDER = ["GITHUB_ACTOR", "GITLAB_USER_LOGIN", "USER", "USERNAME"] as const;
|
|
11
21
|
|
|
@@ -17,3 +27,53 @@ export function actorFromEnv(env: Record<string, string | undefined> = process.e
|
|
|
17
27
|
}
|
|
18
28
|
return fallback;
|
|
19
29
|
}
|
|
30
|
+
|
|
31
|
+
/** Which of the places {@link actorOf} reads, and the answer when none is set. */
|
|
32
|
+
export interface ActorOptions {
|
|
33
|
+
/** The variables. Default `process.env`. */
|
|
34
|
+
env?: Record<string, string | undefined>;
|
|
35
|
+
/** Read `GITHUB_TRIGGERING_ACTOR` first: who re-ran the job, ahead of who started the run. Default false. */
|
|
36
|
+
triggering?: boolean;
|
|
37
|
+
/** Read the forge's actor (`GITHUB_ACTOR`, `GITLAB_USER_LOGIN`). Default true. */
|
|
38
|
+
forge?: boolean;
|
|
39
|
+
/** A checkout whose git config is read after the forge's actor. Unset, git is not asked. */
|
|
40
|
+
repo?: string;
|
|
41
|
+
/** The git config keys read in `repo`, in order. Default `["user.name"]`. */
|
|
42
|
+
gitKeys?: readonly string[];
|
|
43
|
+
/** Read the login (`USER`, `USERNAME`) last. Default true. */
|
|
44
|
+
login?: boolean;
|
|
45
|
+
/** The answer when nothing is set. Default `unknown`; `""` for a caller that refuses. */
|
|
46
|
+
fallback?: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The places {@link actorOf} reads for `options`, in order: variable names, and `git:<key>` for a git config key. */
|
|
50
|
+
export function actorOrder(options: Omit<ActorOptions, "env" | "fallback"> = {}): string[] {
|
|
51
|
+
return [
|
|
52
|
+
...(options.triggering ? ["GITHUB_TRIGGERING_ACTOR"] : []),
|
|
53
|
+
...(options.forge === false ? [] : ["GITHUB_ACTOR", "GITLAB_USER_LOGIN"]),
|
|
54
|
+
...(options.repo !== undefined ? (options.gitKeys ?? ["user.name"]).map((k) => `git:${k}`) : []),
|
|
55
|
+
...(options.login === false ? [] : ["USER", "USERNAME"]),
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function gitConfig(repo: string, key: string): string | undefined {
|
|
60
|
+
const r = spawnSync("git", ["-C", repo, "config", key], { encoding: "utf-8", stdio: ["ignore", "pipe", "ignore"] });
|
|
61
|
+
return r.status === 0 ? r.stdout.trim() : undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* The first place of {@link actorOrder} set to something other than blanks,
|
|
66
|
+
* else `fallback` (#4966). With no options it answers as
|
|
67
|
+
* {@link actorFromEnv}. A git config key is read only when every place
|
|
68
|
+
* before it is empty, so a job with a forge actor runs no git.
|
|
69
|
+
*/
|
|
70
|
+
export function actorOf(options: ActorOptions = {}): string {
|
|
71
|
+
const env = options.env ?? process.env;
|
|
72
|
+
for (const place of actorOrder(options)) {
|
|
73
|
+
const v = (place.startsWith("git:") ? gitConfig(options.repo!, place.slice(4)) : env[place])?.trim();
|
|
74
|
+
if (v) return v;
|
|
75
|
+
}
|
|
76
|
+
return options.fallback ?? "unknown";
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export { ACTOR_ORDER_FLOOR } from "./release-floors";
|
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
lastJsonLine,
|
|
28
28
|
runChant,
|
|
29
29
|
} from "./chant-install";
|
|
30
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
31
30
|
|
|
32
31
|
const scratch = mkdtempSync(join(tmpdir(), "chant-install-"));
|
|
33
32
|
afterAll(() => rmSync(scratch, { recursive: true, force: true }));
|
|
@@ -214,7 +213,7 @@ describe("runChant (#4889)", () => {
|
|
|
214
213
|
await expect(runChant([], { chant: join(scratch, "no-such-chant") })).rejects.toThrow(/ENOENT/);
|
|
215
214
|
});
|
|
216
215
|
|
|
217
|
-
test("CHANT_RUN_FLOOR is the
|
|
218
|
-
expect(CHANT_RUN_FLOOR).toBe(
|
|
216
|
+
test("CHANT_RUN_FLOOR is the release that shipped it", () => {
|
|
217
|
+
expect(CHANT_RUN_FLOOR).toBe("0.124.88");
|
|
219
218
|
});
|
|
220
219
|
});
|
package/src/chant-install.ts
CHANGED
|
@@ -33,10 +33,9 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
33
33
|
import * as nodeModule from "node:module";
|
|
34
34
|
import { delimiter, dirname, join, resolve, sep } from "node:path";
|
|
35
35
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
36
|
-
import { NEXT_RELEASE } from "./release-floors";
|
|
37
36
|
|
|
38
37
|
/** The first chant with `runChant`, `lastJsonLine`, `installResolveFallback` and `fallbackImportArgs` in `@intentius/chant/chant-install` (#4889): a product runs chant and reads its `--json` document, and a file with no `node_modules` above it imports the product's packages, with no code of the product's own. */
|
|
39
|
-
export const CHANT_RUN_FLOOR =
|
|
38
|
+
export const CHANT_RUN_FLOOR = "0.124.88";
|
|
40
39
|
|
|
41
40
|
/** Where a chant package is installed. */
|
|
42
41
|
export interface ChantInstall {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** #4966: the base a CI job measures a change from, and `chant ci check`'s default `--base`. */
|
|
2
|
+
import { afterEach, describe, expect, test, vi } from "vitest";
|
|
3
|
+
import { ciBaseRef } from "./ci-base";
|
|
4
|
+
import type { CommandContext } from "./cli/registry";
|
|
5
|
+
import { runCiCheck } from "./cli/handlers/ci-check";
|
|
6
|
+
|
|
7
|
+
describe("ciBaseRef", () => {
|
|
8
|
+
test("a pull request's target branch, on GitHub and Forgejo, and on GitLab", () => {
|
|
9
|
+
expect(ciBaseRef({ GITHUB_BASE_REF: "main", GITHUB_REF_NAME: "12/merge" })).toBe("origin/main");
|
|
10
|
+
expect(ciBaseRef({ CI_MERGE_REQUEST_TARGET_BRANCH_NAME: "release", CI_COMMIT_BRANCH: "feature" })).toBe("origin/release");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test("a push to another branch than the default is measured from the default branch", () => {
|
|
14
|
+
expect(ciBaseRef({ GITHUB_REF_NAME: "feature" }, { defaultBranch: "main" })).toBe("origin/main");
|
|
15
|
+
expect(ciBaseRef({ CI_COMMIT_BRANCH: "feature", CI_DEFAULT_BRANCH: "trunk" })).toBe("origin/trunk");
|
|
16
|
+
expect(ciBaseRef({ CI_COMMIT_BRANCH: "feature", CI_DEFAULT_BRANCH: "trunk" }, { remote: "upstream" })).toBe("upstream/trunk");
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("a push to the default branch, or a job that names no default branch, has no base", () => {
|
|
20
|
+
expect(ciBaseRef({ GITHUB_REF_NAME: "main" }, { defaultBranch: "main" })).toBeUndefined();
|
|
21
|
+
expect(ciBaseRef({ GITHUB_REF_NAME: "feature" })).toBeUndefined();
|
|
22
|
+
expect(ciBaseRef({})).toBeUndefined();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("a base the caller has wins, and blanks count as unset", () => {
|
|
26
|
+
expect(ciBaseRef({ GITHUB_BASE_REF: "main" }, { base: "HEAD^" })).toBe("HEAD^");
|
|
27
|
+
expect(ciBaseRef({ GITHUB_BASE_REF: " ", CI_MERGE_REQUEST_TARGET_BRANCH_NAME: "main" }, { base: " " })).toBe("origin/main");
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("chant ci check with no --base", () => {
|
|
32
|
+
afterEach(() => vi.restoreAllMocks());
|
|
33
|
+
|
|
34
|
+
test("refuses when the job names no base either", async () => {
|
|
35
|
+
const errors: string[] = [];
|
|
36
|
+
vi.spyOn(console, "error").mockImplementation((m: unknown) => void errors.push(String(m)));
|
|
37
|
+
const ctx = { args: { positionals: ["ci", "check"] }, plugins: [], serializers: [] } as unknown as CommandContext;
|
|
38
|
+
expect(await runCiCheck(ctx, { GITHUB_REF_NAME: "main" })).toBe(1);
|
|
39
|
+
expect(errors.join("\n")).toContain("the job names no pull request target or default branch to take it from");
|
|
40
|
+
});
|
|
41
|
+
});
|