@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
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
import { existsSync, readFileSync, realpathSync, statSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { join } from "node:path";
|
|
12
12
|
import { describe, expect, test } from "vitest";
|
|
13
|
-
import {
|
|
13
|
+
import { beforeMergeBranch, beforeMergeRefGate } from "../../cli/handlers/pr";
|
|
14
|
+
import { refGateInitChecks, refGateInitPlan, RefGateInitError, writeRefGateInit } from "../../ref-gate-init";
|
|
15
|
+
import { productPlanEvidenceChecks, targetEvidenceCheck } from "../../ci-evidence-jobs";
|
|
14
16
|
import { REF_GATE_STATUS, refGateRulesAt, refGateStatusFor } from "../../ref-gate-rules";
|
|
15
17
|
import { decideRefUpdate, describeDecision, requestCommand } from "./ref-gate";
|
|
16
18
|
import { REF_GATE_HOOK_MARK } from "./ref-gate-cli";
|
|
@@ -77,6 +79,30 @@ describe("the ref gate's rules as a library (#4913)", () => {
|
|
|
77
79
|
});
|
|
78
80
|
});
|
|
79
81
|
|
|
82
|
+
describe("an apply before merge waits for the ref gate's status (#4966)", () => {
|
|
83
|
+
test("the target branch: --branch, the pull request's target, then the branch the job runs on", () => {
|
|
84
|
+
expect(beforeMergeBranch("release/2", { GITHUB_REF_NAME: "main" })).toBe("release/2");
|
|
85
|
+
expect(beforeMergeBranch(undefined, { GITHUB_BASE_REF: "trunk", GITHUB_REF_NAME: "7/merge" })).toBe("trunk");
|
|
86
|
+
expect(beforeMergeBranch(undefined, { CI_COMMIT_BRANCH: "main" })).toBe("main");
|
|
87
|
+
expect(beforeMergeBranch(undefined, { GITHUB_REF_NAME: "main" })).toBe("main");
|
|
88
|
+
expect(beforeMergeBranch(" ", {})).toBeUndefined();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test("the status the policy at base sets for the target branch is required, and none without a rule", async () => {
|
|
92
|
+
const r = new GateRepos("4966-before-merge");
|
|
93
|
+
const ci = runnerKey();
|
|
94
|
+
r.write(".chant/trust.json", JSON.stringify({ schema: 1, runners: [{ principal: RUNNER, class: "runner", key: ci.pub }], refs: [{ ref: "refs/heads/main", checks: CHECKS, status: "acme/gate" }] }));
|
|
95
|
+
const base = r.commit("policy");
|
|
96
|
+
expect(await beforeMergeRefGate(r.work, base, undefined, { GITHUB_REF_NAME: "main" })).toMatchObject({ require: ["acme/gate"] });
|
|
97
|
+
expect(await beforeMergeRefGate(r.work, base, "feature", {})).toEqual({ require: [] });
|
|
98
|
+
expect(await beforeMergeRefGate(r.work, base, undefined, {})).toMatchObject({ require: [], note: expect.stringContaining("names no target branch") });
|
|
99
|
+
r.write(".chant/trust.json", "{ not json");
|
|
100
|
+
const broken = r.commit("broken policy");
|
|
101
|
+
const refused = await beforeMergeRefGate(r.work, broken, "main", {});
|
|
102
|
+
expect("problem" in refused && refused.problem).toContain("the trust policy at base can't be read");
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
80
106
|
describe("the ref gate's init pieces (#4913)", () => {
|
|
81
107
|
test("a checkout with no trust policy gets one with the rule, the pre-push hook and the runner key hint", () => {
|
|
82
108
|
const r = new GateRepos("4913-init-new");
|
|
@@ -139,6 +165,25 @@ describe("the ref gate's init pieces (#4913)", () => {
|
|
|
139
165
|
expect(bad.notes[0]).toContain("does not read as chant's trust policy");
|
|
140
166
|
});
|
|
141
167
|
|
|
168
|
+
test("#4978: with a product plan's targets, plan and policy are each target's, the checks the targets' note jobs sign", () => {
|
|
169
|
+
const r = new GateRepos("4978-init-targets");
|
|
170
|
+
r.commit("start");
|
|
171
|
+
const checks = [{ check: "lint", command: "npm run lint" }, { check: "plan", command: "/yodel plan" }, { check: "policy", action: "warn" as const, command: "/yodel plan" }];
|
|
172
|
+
const plan = refGateInitPlan(r.work, { checks, targets: ["staging", "prod"], prePush: false });
|
|
173
|
+
expect(JSON.parse(plan.files[0]!.content).refs[0].checks).toEqual([
|
|
174
|
+
{ check: "lint", command: "npm run lint" },
|
|
175
|
+
{ check: "plan:staging", command: "/yodel plan" },
|
|
176
|
+
{ check: "plan:prod", command: "/yodel plan" },
|
|
177
|
+
{ check: "policy:staging", action: "warn", command: "/yodel plan" },
|
|
178
|
+
{ check: "policy:prod", action: "warn", command: "/yodel plan" },
|
|
179
|
+
]);
|
|
180
|
+
expect(productPlanEvidenceChecks(["staging", "prod"])).toEqual(["plan:staging", "policy:staging", "plan:prod", "policy:prod"]);
|
|
181
|
+
expect(productPlanEvidenceChecks()).toEqual(["plan", "policy"]);
|
|
182
|
+
expect(targetEvidenceCheck("policy", "prod")).toBe("policy:prod");
|
|
183
|
+
expect(refGateInitChecks(checks, [])).toEqual(checks);
|
|
184
|
+
expect(() => refGateInitPlan(r.work, { checks, targets: ["no:colon"], prePush: false })).toThrow("is not a product plan target's name");
|
|
185
|
+
});
|
|
186
|
+
|
|
142
187
|
test("options no rule can hold, or a directory outside git, are refused", () => {
|
|
143
188
|
const r = new GateRepos("4913-init-refuse");
|
|
144
189
|
r.commit("start");
|
|
@@ -232,6 +232,16 @@ describe("the developer's side and the forge", () => {
|
|
|
232
232
|
]);
|
|
233
233
|
});
|
|
234
234
|
|
|
235
|
+
test("a policy at base that does not read fails the status closed (#4964)", async () => {
|
|
236
|
+
const { r, base } = setup("status-unreadable");
|
|
237
|
+
r.write(".chant/trust.json", "{ not json");
|
|
238
|
+
const broken = r.commit("broken policy");
|
|
239
|
+
const posted: Array<{ sha: string; context: string; state: string; description: string }> = [];
|
|
240
|
+
const forge = { setStatus: async (sha: string, s: { context: string; state: string; description: string }) => void posted.push({ sha, ...s }) };
|
|
241
|
+
await postRefGateStatus(forge, decideRefUpdate({ repo: r.work, update: { ref: "refs/heads/main", old: base, new: broken }, base: broken, now: NOW }));
|
|
242
|
+
expect(posted).toEqual([{ sha: broken, context: "chant/ref-gate", state: "failure", description: "refused: trust-policy-unreadable" }]);
|
|
243
|
+
});
|
|
244
|
+
|
|
235
245
|
test("the hooks run chant with git's arguments and input", () => {
|
|
236
246
|
expect(refGateHook("pre-receive")).toBe('#!/bin/sh\n# chant ref gate (#4867)\nexec chant workspace ref-gate pre-receive "$@"\n');
|
|
237
247
|
expect(refGateHook("pre-push", "npx chant")).toContain("exec npx chant workspace ref-gate pre-push");
|
|
@@ -47,6 +47,7 @@ import { executePlan, planMembers } from "./member-commands";
|
|
|
47
47
|
import { locateWorkspace } from "./which-chant";
|
|
48
48
|
import { appendWorkspaceRun, type WorkspaceRunRecord, type WorkspaceRunStep } from "./workspace-ledger";
|
|
49
49
|
import { appendWorkspaceGatePending, type WorkspaceGateCover, type WorkspaceGatePending } from "./workspace-gates";
|
|
50
|
+
import { actorFromEnv } from "../actor";
|
|
50
51
|
|
|
51
52
|
/** `chant run`'s exit code for a run that stopped at an unapproved gate (`GATED_EXIT_CODE`). */
|
|
52
53
|
const GATED_EXIT = CHANT_EXIT.waiting;
|
|
@@ -444,7 +445,7 @@ async function runWorkspaceRunApprove(ctx: CommandContext, words: string[]): Pro
|
|
|
444
445
|
return 1;
|
|
445
446
|
}
|
|
446
447
|
const { approveWorkspaceGate } = await import("./workspace-gates");
|
|
447
|
-
const approvedBy = ctx.args.approver ?? ctx.args.actor ??
|
|
448
|
+
const approvedBy = ctx.args.approver ?? ctx.args.actor ?? actorFromEnv();
|
|
448
449
|
try {
|
|
449
450
|
const record = await approveWorkspaceGate(resolve("."), {
|
|
450
451
|
gate,
|