@intentius/chant 0.124.32 → 0.124.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ci-jobs.d.ts +4 -0
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +9 -2
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +18 -3
- package/dist/cli/handlers/lifecycle-health.d.ts +16 -0
- package/dist/cli/handlers/lifecycle-health.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-health.js +150 -0
- package/dist/cli/handlers/lifecycle.d.ts +26 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +1 -1
- package/dist/cli/handlers/pr.d.ts +2 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +124 -2
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +16 -1
- package/dist/cli/handlers/release.d.ts +16 -1
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +83 -11
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +81 -21
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +23 -1
- package/dist/cli/registry.d.ts +18 -4
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/deploy-inputs.d.ts +91 -0
- package/dist/components/deploy-inputs.d.ts.map +1 -0
- package/dist/components/deploy-inputs.js +184 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +9 -0
- package/dist/components/gate-plan.d.ts +8 -0
- package/dist/components/gate-plan.d.ts.map +1 -1
- package/dist/components/gate-plan.js +6 -0
- package/dist/components/pr-pipeline.d.ts +33 -10
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +42 -11
- package/dist/components/pr-run.d.ts +1 -1
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/release-compile.d.ts +37 -2
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +64 -8
- package/dist/components/release-promote.d.ts +17 -3
- package/dist/components/release-promote.d.ts.map +1 -1
- package/dist/components/release-promote.js +79 -18
- package/dist/components/verbs/bom-writer.d.ts +1 -1
- package/dist/components/verbs/bom-writer.d.ts.map +1 -1
- package/dist/components/verbs/lockfile-sbom-generator.d.ts +20 -0
- package/dist/components/verbs/lockfile-sbom-generator.d.ts.map +1 -1
- package/dist/components/verbs/lockfile-sbom-generator.js +41 -4
- package/dist/components/wave-plan.d.ts +10 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +32 -4
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/graph-detail.js +32 -7
- package/dist/health.d.ts +110 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +105 -0
- package/dist/health.schema.json +191 -0
- package/dist/lexicon.d.ts +27 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/merge-record.d.ts +104 -0
- package/dist/lifecycle/merge-record.d.ts.map +1 -0
- package/dist/lifecycle/merge-record.js +102 -0
- package/dist/lifecycle/publish-attachments.d.ts +8 -5
- package/dist/lifecycle/publish-attachments.d.ts.map +1 -1
- package/dist/lifecycle/publish-attachments.js +27 -13
- package/dist/lifecycle/publish-npm.d.ts +3 -2
- package/dist/lifecycle/publish-npm.d.ts.map +1 -1
- package/dist/lifecycle/publish-npm.js +4 -3
- package/dist/lifecycle/release-at.d.ts +40 -0
- package/dist/lifecycle/release-at.d.ts.map +1 -0
- package/dist/lifecycle/release-at.js +83 -0
- package/dist/lifecycle/release-cut.d.ts.map +1 -1
- package/dist/lifecycle/release-cut.js +23 -12
- package/dist/lifecycle/release-publish.d.ts +28 -12
- package/dist/lifecycle/release-publish.d.ts.map +1 -1
- package/dist/lifecycle/release-publish.js +29 -17
- package/dist/lifecycle/release-store.d.ts +25 -2
- package/dist/lifecycle/release-store.d.ts.map +1 -1
- package/dist/lifecycle/release-store.js +40 -13
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +1 -0
- package/dist/lint/rules/op/index.d.ts +2 -1
- package/dist/lint/rules/op/index.d.ts.map +1 -1
- package/dist/lint/rules/op/index.js +4 -2
- package/dist/lint/rules/op/ops018-shell-image-digest.d.ts +10 -0
- package/dist/lint/rules/op/ops018-shell-image-digest.d.ts.map +1 -0
- package/dist/lint/rules/op/ops018-shell-image-digest.js +38 -0
- package/dist/op/activities/activity-contracts.d.ts +5 -0
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.js +3 -0
- package/dist/op/activities/shell.d.ts +38 -0
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/activities/shell.js +89 -3
- package/dist/op/builders.d.ts +7 -0
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +7 -0
- package/dist/op/runtime.d.ts +2 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/pr-loop.d.ts +14 -3
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +15 -5
- package/dist/pr-report-url.d.ts +2 -2
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/runner-start.d.ts +179 -0
- package/dist/runner-start.d.ts.map +1 -0
- package/dist/runner-start.js +277 -0
- package/dist/wave-runtime.mjs +235 -228
- package/dist/workspace/check.schema.json +70 -2
- package/dist/workspace/checks/security.d.ts +35 -0
- package/dist/workspace/checks/security.d.ts.map +1 -0
- package/dist/workspace/checks/security.js +305 -0
- package/dist/workspace/checks.d.ts +2 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +5 -0
- package/dist/workspace/ci-builds.d.ts +163 -0
- package/dist/workspace/ci-builds.d.ts.map +1 -0
- package/dist/workspace/ci-builds.js +315 -0
- package/dist/workspace/ci-green-cli.d.ts +2 -1
- package/dist/workspace/ci-green-cli.d.ts.map +1 -1
- package/dist/workspace/ci-green-cli.js +25 -5
- package/dist/workspace/ci-green-forge.d.ts +12 -0
- package/dist/workspace/ci-green-forge.d.ts.map +1 -1
- package/dist/workspace/ci-green-forge.js +12 -0
- package/dist/workspace/ci-green-workflow.d.ts +55 -1
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +128 -1
- package/dist/workspace/ci-green.d.ts +89 -4
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +310 -23
- package/dist/workspace/ci-last-green.schema.json +49 -0
- package/dist/workspace/ci-list.schema.json +35 -1
- package/dist/workspace/ci-run-index.d.ts +1 -1
- package/dist/workspace/ci-run-index.d.ts.map +1 -1
- package/dist/workspace/ci-run-index.schema.json +1 -1
- package/dist/workspace/ci-run.d.ts +12 -6
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +72 -16
- package/dist/workspace/ci-runner-start.d.ts +77 -0
- package/dist/workspace/ci-runner-start.d.ts.map +1 -0
- package/dist/workspace/ci-runner-start.js +185 -0
- package/dist/workspace/ci-serve.d.ts +76 -7
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +153 -19
- package/dist/workspace/declaration.d.ts +17 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +3 -0
- package/dist/workspace/declaration.schema.json +23 -0
- package/dist/workspace/ls.d.ts +2 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +1 -1
- package/dist/workspace/ls.schema.json +2 -1
- package/dist/workspace/member-pipeline.d.ts +1 -0
- package/dist/workspace/member-pipeline.d.ts.map +1 -1
- package/dist/workspace/member-pipeline.js +2 -0
- package/dist/workspace/merge-record.schema.json +49 -0
- package/dist/workspace/pr-report.schema.json +3 -3
- package/dist/workspace/reason-codes.d.ts +17 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +18 -0
- package/dist/workspace/release-candidates.d.ts +129 -0
- package/dist/workspace/release-candidates.d.ts.map +1 -0
- package/dist/workspace/release-candidates.js +233 -0
- package/dist/workspace/release-candidates.schema.json +353 -0
- package/dist/workspace/security.d.ts +40 -0
- package/dist/workspace/security.d.ts.map +1 -0
- package/dist/workspace/security.js +99 -0
- package/package.json +8 -1
- package/src/__fixtures__/pr-loop/pr-plan.note.golden.md +1 -1
- package/src/ci-jobs.ts +11 -2
- package/src/cli/handlers/build.test.ts +36 -0
- package/src/cli/handlers/build.ts +18 -3
- package/src/cli/handlers/lifecycle-health.test.ts +123 -0
- package/src/cli/handlers/lifecycle-health.ts +157 -0
- package/src/cli/handlers/lifecycle.ts +1 -1
- package/src/cli/handlers/pr-deploy-inputs.test.ts +209 -0
- package/src/cli/handlers/pr-record.test.ts +201 -0
- package/src/cli/handlers/pr.test.ts +22 -0
- package/src/cli/handlers/pr.ts +127 -4
- package/src/cli/handlers/promote.test.ts +17 -0
- package/src/cli/handlers/promote.ts +16 -1
- package/src/cli/handlers/release-cut-at.e2e.test.ts +115 -0
- package/src/cli/handlers/release-publish-targets.e2e.test.ts +2 -2
- package/src/cli/handlers/release-verify.e2e.test.ts +12 -10
- package/src/cli/handlers/release.e2e.test.ts +19 -28
- package/src/cli/handlers/release.ts +81 -11
- package/src/cli/main.ts +81 -21
- package/src/cli/parse-args.ts +17 -1
- package/src/cli/registry.ts +18 -4
- package/src/components/deploy-inputs.test.ts +108 -0
- package/src/components/deploy-inputs.ts +225 -0
- package/src/components/driver.ts +11 -0
- package/src/components/gate-plan.ts +9 -0
- package/src/components/pr-pipeline.ts +56 -15
- package/src/components/pr-run.ts +1 -1
- package/src/components/release-compile.test.ts +34 -0
- package/src/components/release-compile.ts +89 -8
- package/src/components/release-promote.test.ts +55 -2
- package/src/components/release-promote.ts +93 -23
- package/src/components/verbs/bom-writer.ts +1 -1
- package/src/components/verbs/lockfile-sbom-generator.test.ts +36 -0
- package/src/components/verbs/lockfile-sbom-generator.ts +43 -5
- package/src/components/wave-plan.ts +32 -4
- package/src/graph-detail.test.ts +57 -0
- package/src/graph-detail.ts +33 -7
- package/src/health.schema.json +191 -0
- package/src/health.test.ts +62 -0
- package/src/health.ts +178 -0
- package/src/lexicon.ts +41 -1
- package/src/lifecycle/merge-record.test.ts +111 -0
- package/src/lifecycle/merge-record.ts +154 -0
- package/src/lifecycle/publish-attachments.ts +25 -13
- package/src/lifecycle/publish-npm.ts +4 -3
- package/src/lifecycle/publish-targets.test.ts +34 -4
- package/src/lifecycle/release-at.test.ts +48 -0
- package/src/lifecycle/release-at.ts +100 -0
- package/src/lifecycle/release-cut.test.ts +41 -0
- package/src/lifecycle/release-cut.ts +22 -11
- package/src/lifecycle/release-publish.test.ts +43 -13
- package/src/lifecycle/release-publish.ts +38 -18
- package/src/lifecycle/release-store.ts +57 -13
- package/src/lifecycle/run-ledger.test.ts +13 -0
- package/src/lifecycle/run-ledger.ts +1 -0
- package/src/lint/rules/op/index.ts +4 -2
- package/src/lint/rules/op/ops018-shell-image-digest.test.ts +60 -0
- package/src/lint/rules/op/ops018-shell-image-digest.ts +48 -0
- package/src/op/activities/activity-contracts.ts +3 -0
- package/src/op/activities/shell-container.e2e.test.ts +67 -0
- package/src/op/activities/shell.test.ts +44 -1
- package/src/op/activities/shell.ts +110 -3
- package/src/op/builders.ts +7 -0
- package/src/op/runtime.ts +2 -0
- package/src/op/step-console.test.ts +4 -2
- package/src/pr-loop.test.ts +29 -0
- package/src/pr-loop.ts +26 -7
- package/src/pr-report-url.ts +2 -2
- package/src/runner-start-bundle.test.ts +29 -0
- package/src/runner-start.test.ts +179 -0
- package/src/runner-start.ts +329 -0
- package/src/workspace/check-contract.test.ts +3 -2
- package/src/workspace/check.schema.json +70 -2
- package/src/workspace/checks/security.test.ts +138 -0
- package/src/workspace/checks/security.ts +305 -0
- package/src/workspace/checks.ts +5 -0
- package/src/workspace/ci-builds.e2e.test.ts +208 -0
- package/src/workspace/ci-builds.test.ts +174 -0
- package/src/workspace/ci-builds.ts +385 -0
- package/src/workspace/ci-green-builds.test.ts +180 -0
- package/src/workspace/ci-green-cli.test.ts +54 -0
- package/src/workspace/ci-green-cli.ts +26 -5
- package/src/workspace/ci-green-forge.ts +24 -0
- package/src/workspace/ci-green-workflow.test.ts +84 -1
- package/src/workspace/ci-green-workflow.ts +139 -2
- package/src/workspace/ci-green.test.ts +5 -2
- package/src/workspace/ci-green.ts +359 -27
- package/src/workspace/ci-last-green.schema.json +49 -0
- package/src/workspace/ci-list.schema.json +35 -1
- package/src/workspace/ci-run-index.schema.json +1 -1
- package/src/workspace/ci-run-index.ts +1 -1
- package/src/workspace/ci-run.test.ts +24 -7
- package/src/workspace/ci-run.ts +78 -16
- package/src/workspace/ci-runner-start.test.ts +151 -0
- package/src/workspace/ci-runner-start.ts +193 -0
- package/src/workspace/ci-serve-builds.test.ts +86 -0
- package/src/workspace/ci-serve.test.ts +59 -0
- package/src/workspace/ci-serve.ts +177 -22
- package/src/workspace/declaration.schema.json +23 -0
- package/src/workspace/declaration.test.ts +17 -0
- package/src/workspace/declaration.ts +22 -1
- package/src/workspace/ls.schema.json +2 -1
- package/src/workspace/ls.ts +3 -2
- package/src/workspace/member-pipeline.ts +2 -1
- package/src/workspace/merge-record.schema.json +49 -0
- package/src/workspace/pr-report.schema.json +3 -3
- package/src/workspace/reason-codes.test.ts +2 -0
- package/src/workspace/reason-codes.ts +18 -0
- package/src/workspace/release-candidates.schema.json +353 -0
- package/src/workspace/release-candidates.test.ts +106 -0
- package/src/workspace/release-candidates.ts +315 -0
- package/src/workspace/security.test.ts +70 -0
- package/src/workspace/security.ts +118 -0
package/dist/ci-jobs.d.ts
CHANGED
|
@@ -199,6 +199,10 @@ export declare const GITLAB_SCHEDULE_SOURCE = "$CI_PIPELINE_SOURCE == \"schedule
|
|
|
199
199
|
export declare const GITLAB_FULL_HISTORY: {
|
|
200
200
|
readonly GIT_DEPTH: "0";
|
|
201
201
|
};
|
|
202
|
+
/** The tags a build request is pushed as (#4169), as a glob for a trigger. */
|
|
203
|
+
export declare const BUILD_REQUEST_TAGS = "ci/build/**";
|
|
204
|
+
/** The `rules:` if-expression for a build request's tag (#4169). */
|
|
205
|
+
export declare const GITLAB_BUILD_REQUEST_RULE = "$CI_COMMIT_TAG =~ /^ci\\/build\\//";
|
|
202
206
|
/** The `rules:` if-expression for a push to `branch`, a quoted name or an expression such as `$CI_DEFAULT_BRANCH`. */
|
|
203
207
|
export declare function gitlabPushRule(branch: string): string;
|
|
204
208
|
/**
|
package/dist/ci-jobs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-jobs.d.ts","sourceRoot":"","sources":["../src/ci-jobs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAItF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,YAAY,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAE9E;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CASxE;AAED,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAE/E;AAED,gHAAgH;AAChH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EA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,GAAG,IAAI,CAqBtF"}
|
package/dist/ci-jobs.js
CHANGED
|
@@ -356,6 +356,10 @@ export const GITLAB_MERGE_REQUEST_SOURCE = '$CI_PIPELINE_SOURCE == "merge_reques
|
|
|
356
356
|
export const GITLAB_SCHEDULE_SOURCE = '$CI_PIPELINE_SOURCE == "schedule"';
|
|
357
357
|
/** A job variable that makes the runner clone the whole history, which a job reading the base commit needs. */
|
|
358
358
|
export const GITLAB_FULL_HISTORY = { GIT_DEPTH: "0" };
|
|
359
|
+
/** The tags a build request is pushed as (#4169), as a glob for a trigger. */
|
|
360
|
+
export const BUILD_REQUEST_TAGS = "ci/build/**";
|
|
361
|
+
/** The `rules:` if-expression for a build request's tag (#4169). */
|
|
362
|
+
export const GITLAB_BUILD_REQUEST_RULE = "$CI_COMMIT_TAG =~ /^ci\\/build\\//";
|
|
359
363
|
/** The `rules:` if-expression for a push to `branch`, a quoted name or an expression such as `$CI_DEFAULT_BRANCH`. */
|
|
360
364
|
export function gitlabPushRule(branch) {
|
|
361
365
|
return `$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == ${branch}`;
|
|
@@ -398,11 +402,14 @@ export function gitlabRules(subject, trigger, selector) {
|
|
|
398
402
|
return { if: `${GITLAB_MERGE_REQUEST_SOURCE} && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "${branch}"` };
|
|
399
403
|
});
|
|
400
404
|
}
|
|
401
|
-
case "push":
|
|
402
|
-
|
|
405
|
+
case "push": {
|
|
406
|
+
const rules = pushBranches(trigger.branches).map((branch) => {
|
|
403
407
|
assertGitlabBranch(subject, branch);
|
|
404
408
|
return { if: gitlabPushRule(JSON.stringify(branch)) };
|
|
405
409
|
});
|
|
410
|
+
// #4169: a newest build also runs at each build request's tag.
|
|
411
|
+
return trigger.build === "newest" ? [...rules, { if: GITLAB_BUILD_REQUEST_RULE }] : rules;
|
|
412
|
+
}
|
|
406
413
|
}
|
|
407
414
|
}
|
|
408
415
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/build.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAsNlD,wBAAsB,QAAQ,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsJnE"}
|
|
@@ -14,8 +14,12 @@ import { resolvePromotionSource } from "../../components/promote-order.js";
|
|
|
14
14
|
* flags the generated jobs pass to pr-plan and pr-apply. `--pr-build` and
|
|
15
15
|
* `--pr-build-command` (#4088) add the build and lint steps before both.
|
|
16
16
|
* `reportUrl` is `--report-url`, else the workspace's `ci.reportUrl` (#4160).
|
|
17
|
+
* `requireReview` is `--require-review`, or a workspace that opts into the
|
|
18
|
+
* `review-rules` security group (#4168); off otherwise. `requireRunnerStart`
|
|
19
|
+
* is `--require-runner-start`, or the `isolated-runners` group. `--apply-on-merge`
|
|
20
|
+
* (#4168) writes the apply job on merge in place of the record job.
|
|
17
21
|
*/
|
|
18
|
-
function prLoopOption(args, reportUrl) {
|
|
22
|
+
function prLoopOption(args, reportUrl, requireReview = false, requireRunnerStart = false) {
|
|
19
23
|
return {
|
|
20
24
|
...(args.gate ? { gate: args.gate } : {}),
|
|
21
25
|
...(args.branch ? { branch: args.branch } : {}),
|
|
@@ -23,6 +27,9 @@ function prLoopOption(args, reportUrl) {
|
|
|
23
27
|
...(reportUrl ? { reportUrl } : {}),
|
|
24
28
|
...(args.prBuild ? { build: true } : {}),
|
|
25
29
|
...(args.prBuildCommand ? { buildCommand: args.prBuildCommand } : {}),
|
|
30
|
+
...(args.requireReview === true || requireReview ? { requireReview: true } : {}),
|
|
31
|
+
...(args.requireRunnerStart === true || requireRunnerStart ? { requireRunnerStart: true } : {}),
|
|
32
|
+
...(args.applyOnMerge ? { applyOnMerge: true } : {}),
|
|
26
33
|
};
|
|
27
34
|
}
|
|
28
35
|
/**
|
|
@@ -97,6 +104,14 @@ async function runGenerateComponents(ctx) {
|
|
|
97
104
|
return 1;
|
|
98
105
|
}
|
|
99
106
|
}
|
|
107
|
+
// #4168: the review-rules group turns on --require-review in the generated apply. Read only inside a workspace.
|
|
108
|
+
let reviewRules = false;
|
|
109
|
+
let isolatedRunners = false;
|
|
110
|
+
if (found && args.prLoop) {
|
|
111
|
+
const groups = (await import("../../workspace/security.js")).securityGroupsAt(resolve(args.path));
|
|
112
|
+
reviewRules = groups.has("review-rules");
|
|
113
|
+
isolatedRunners = groups.has("isolated-runners");
|
|
114
|
+
}
|
|
100
115
|
if (found) {
|
|
101
116
|
memberPipeline = await import("../../workspace/member-pipeline.js");
|
|
102
117
|
try {
|
|
@@ -111,7 +126,7 @@ async function runGenerateComponents(ctx) {
|
|
|
111
126
|
params: args.param,
|
|
112
127
|
paramsFile: args.paramsFile,
|
|
113
128
|
...(args.waveGate ? { waveGate: { gate: args.waveGate, ...(args.canary?.length ? { canary: args.canary } : {}), ...(args.base ? { base: args.base } : {}) } } : {}),
|
|
114
|
-
...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl) } : {}),
|
|
129
|
+
...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl, reviewRules, isolatedRunners) } : {}),
|
|
115
130
|
...(args.image ? { image: args.image } : {}),
|
|
116
131
|
...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
|
|
117
132
|
});
|
|
@@ -138,7 +153,7 @@ async function runGenerateComponents(ctx) {
|
|
|
138
153
|
? { gatedWaves: { gate: args.waveGate, ...(args.canary?.length ? { canary: args.canary } : {}), ...(args.base ? { base: args.base } : {}) } }
|
|
139
154
|
: {}),
|
|
140
155
|
// #3183: a plan job per pull request and an apply job per merge.
|
|
141
|
-
...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl) } : {}),
|
|
156
|
+
...(args.prLoop ? { prLoop: prLoopOption(args, reportUrl, reviewRules, isolatedRunners) } : {}),
|
|
142
157
|
// #4002: the job image and the lines that install what it lacks, chant itself included.
|
|
143
158
|
...(args.image ? { image: args.image } : {}),
|
|
144
159
|
...(args.beforeScript?.length ? { beforeScript: args.beforeScript } : {}),
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant lifecycle health <env> [lexicon] [--json]` (#4177): whether each
|
|
3
|
+
* declared resource that has a health read is up, separate from drift.
|
|
4
|
+
*
|
|
5
|
+
* It builds the project as `lifecycle diff` does, so the entity names are the
|
|
6
|
+
* graph's node ids, then asks each lexicon with a health read about the
|
|
7
|
+
* entities whose types it names. An environment's declared endpoint is applied
|
|
8
|
+
* for the read, as on the other live reads (#1166).
|
|
9
|
+
*
|
|
10
|
+
* The JSON is the {@link HEALTH_SCHEMA} shape. A single-stack project prints
|
|
11
|
+
* `lexicons` at the top level; a multi-stack one nests them under `stacks`,
|
|
12
|
+
* the same split `lifecycle diff --live --json` makes.
|
|
13
|
+
*/
|
|
14
|
+
import type { CommandContext } from "../registry.js";
|
|
15
|
+
export declare function runLifecycleHealth(ctx: CommandContext): Promise<number>;
|
|
16
|
+
//# sourceMappingURL=lifecycle-health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle-health.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle-health.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiH7E"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant lifecycle health <env> [lexicon] [--json]` (#4177): whether each
|
|
3
|
+
* declared resource that has a health read is up, separate from drift.
|
|
4
|
+
*
|
|
5
|
+
* It builds the project as `lifecycle diff` does, so the entity names are the
|
|
6
|
+
* graph's node ids, then asks each lexicon with a health read about the
|
|
7
|
+
* entities whose types it names. An environment's declared endpoint is applied
|
|
8
|
+
* for the read, as on the other live reads (#1166).
|
|
9
|
+
*
|
|
10
|
+
* The JSON is the {@link HEALTH_SCHEMA} shape. A single-stack project prints
|
|
11
|
+
* `lexicons` at the top level; a multi-stack one nests them under `stacks`,
|
|
12
|
+
* the same split `lifecycle diff --live --json` makes.
|
|
13
|
+
*/
|
|
14
|
+
import { resolve } from "node:path";
|
|
15
|
+
import { build } from "../../build.js";
|
|
16
|
+
import { loadChantConfig } from "../../config.js";
|
|
17
|
+
import { isObservableDeclarable } from "../../declarable.js";
|
|
18
|
+
import { HEALTH_SCHEMA, healthApplicable, observeHealthFor, summarizeHealth } from "../../health.js";
|
|
19
|
+
import { applyLiveEndpoint } from "../../live-endpoint.js";
|
|
20
|
+
import { CHANT_VERSION } from "../version.js";
|
|
21
|
+
import { commandBuildParams } from "../build-params-cli.js";
|
|
22
|
+
import { resolveBuildModes, resolveProjectBuildOptions } from "../build-options.js";
|
|
23
|
+
import { formatBold, formatError, formatWarning } from "../format.js";
|
|
24
|
+
import { resolveStackTargets } from "./lifecycle.js";
|
|
25
|
+
export async function runLifecycleHealth(ctx) {
|
|
26
|
+
const { args, plugins } = ctx;
|
|
27
|
+
const environment = args.extraPositional;
|
|
28
|
+
const lexiconFilter = args.extraPositional2;
|
|
29
|
+
if (!environment) {
|
|
30
|
+
console.error(formatError({ message: "Environment is required: chant lifecycle health <environment> [lexicon]" }));
|
|
31
|
+
return 1;
|
|
32
|
+
}
|
|
33
|
+
const readers = plugins.filter((p) => p.observeHealth && (p.healthTypes?.length ?? 0) > 0 && (!lexiconFilter || p.name === lexiconFilter));
|
|
34
|
+
if (readers.length === 0) {
|
|
35
|
+
console.error(formatWarning({
|
|
36
|
+
message: lexiconFilter
|
|
37
|
+
? `${lexiconFilter}: no health read in this lexicon`
|
|
38
|
+
: "No configured lexicon has a health read (aws, azure and gcp do)",
|
|
39
|
+
}));
|
|
40
|
+
return 1;
|
|
41
|
+
}
|
|
42
|
+
const projectRoot = resolve(".");
|
|
43
|
+
const { config } = await loadChantConfig(projectRoot);
|
|
44
|
+
const declaredParams = await commandBuildParams(config.buildParams, args);
|
|
45
|
+
if (!declaredParams)
|
|
46
|
+
return 1;
|
|
47
|
+
const targets = resolveStackTargets(args, config);
|
|
48
|
+
const buildOptions = resolveProjectBuildOptions({
|
|
49
|
+
config,
|
|
50
|
+
configDir: projectRoot,
|
|
51
|
+
plugins,
|
|
52
|
+
modes: resolveBuildModes(config, { fold: args.fold, sandbox: args.sandbox }),
|
|
53
|
+
buildParams: declaredParams,
|
|
54
|
+
});
|
|
55
|
+
const serializers = readers.map((p) => p.serializer);
|
|
56
|
+
const endpoint = applyLiveEndpoint(config.environments, environment, readers);
|
|
57
|
+
if (endpoint.notice)
|
|
58
|
+
console.error(formatWarning({ message: endpoint.notice }));
|
|
59
|
+
const perStack = {};
|
|
60
|
+
let single;
|
|
61
|
+
let anyBuildError = false;
|
|
62
|
+
const observedAt = new Date().toISOString();
|
|
63
|
+
try {
|
|
64
|
+
for (const target of targets) {
|
|
65
|
+
const buildResult = await build(target.root, serializers, undefined, buildOptions);
|
|
66
|
+
if (buildResult.errors.length > 0) {
|
|
67
|
+
console.error(formatError({
|
|
68
|
+
message: `Build failed for ${target.stack ? `stack "${target.stack}"` : "project"}; fix errors before reading health`,
|
|
69
|
+
}));
|
|
70
|
+
anyBuildError = true;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const byLexicon = {};
|
|
74
|
+
for (const plugin of readers) {
|
|
75
|
+
const declared = new Map();
|
|
76
|
+
for (const [name, entity] of buildResult.entities) {
|
|
77
|
+
if (entity.lexicon === plugin.name && isObservableDeclarable(entity)) {
|
|
78
|
+
declared.set(name, {
|
|
79
|
+
entityType: entity.entityType,
|
|
80
|
+
props: (entity.props != null ? entity.props : {}),
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const entities = healthApplicable(plugin, declared);
|
|
85
|
+
if (entities.size === 0)
|
|
86
|
+
continue;
|
|
87
|
+
const raw = buildResult.outputs.get(plugin.name);
|
|
88
|
+
const buildOutput = raw === undefined ? "" : typeof raw === "string" ? raw : raw.primary;
|
|
89
|
+
byLexicon[plugin.name] = await observeHealthFor(plugin, {
|
|
90
|
+
environment,
|
|
91
|
+
buildOutput,
|
|
92
|
+
entities,
|
|
93
|
+
...(target.stack ? { stack: target.stack } : {}),
|
|
94
|
+
...(target.region ? { region: target.region } : {}),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (target.stack)
|
|
98
|
+
perStack[target.stack] = byLexicon;
|
|
99
|
+
else
|
|
100
|
+
single = byLexicon;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
finally {
|
|
104
|
+
endpoint.restore();
|
|
105
|
+
}
|
|
106
|
+
const all = single ? [single] : Object.values(perStack);
|
|
107
|
+
const summary = summarizeHealth(all.flatMap((b) => Object.values(b)));
|
|
108
|
+
if (args.json) {
|
|
109
|
+
console.log(JSON.stringify({
|
|
110
|
+
schema: HEALTH_SCHEMA,
|
|
111
|
+
chantVersion: CHANT_VERSION,
|
|
112
|
+
environment,
|
|
113
|
+
observedAt,
|
|
114
|
+
...(single ? { lexicons: single } : { stacks: perStack }),
|
|
115
|
+
summary,
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
if (single)
|
|
120
|
+
renderHealth(single);
|
|
121
|
+
else
|
|
122
|
+
for (const [stack, byLexicon] of Object.entries(perStack)) {
|
|
123
|
+
console.log(`\n${formatBold(`■ stack ${stack}`)}`);
|
|
124
|
+
renderHealth(byLexicon);
|
|
125
|
+
}
|
|
126
|
+
const total = summary.healthy + summary.unhealthy + summary.unknown + summary.unobserved + summary.absent;
|
|
127
|
+
if (total === 0) {
|
|
128
|
+
console.error(formatWarning({ message: "No declared resource has a health read" }));
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
console.error(`${summary.healthy} healthy, ${summary.unhealthy} unhealthy, ${summary.unknown} unknown` +
|
|
132
|
+
(summary.unobserved > 0 ? `, ${summary.unobserved} not observed` : "") +
|
|
133
|
+
(summary.absent > 0 ? `, ${summary.absent} not deployed` : ""));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return anyBuildError ? 1 : 0;
|
|
137
|
+
}
|
|
138
|
+
function renderHealth(byLexicon) {
|
|
139
|
+
for (const [lexicon, result] of Object.entries(byLexicon)) {
|
|
140
|
+
console.log(formatBold(lexicon));
|
|
141
|
+
for (const [name, entry] of Object.entries(result.entities)) {
|
|
142
|
+
console.log(` ${entry.state.padEnd(9)} ${name} (${entry.type}): ${entry.detail}`);
|
|
143
|
+
}
|
|
144
|
+
for (const [name, hole] of Object.entries(result.unobserved)) {
|
|
145
|
+
console.log(` ${"not read".padEnd(9)} ${name}${hole.type ? ` (${hole.type})` : ""}: ${hole.reason}${hole.detail ? `, ${hole.detail}` : ""}`);
|
|
146
|
+
}
|
|
147
|
+
for (const name of result.absent)
|
|
148
|
+
console.log(` ${"absent".padEnd(9)} ${name}: not deployed`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -10,6 +10,31 @@ import type { ChantConfig } from "../../config.js";
|
|
|
10
10
|
* so their build digests stay consistent.
|
|
11
11
|
*/
|
|
12
12
|
export declare function resolveBuildRoot(args: ParsedArgs, config: ChantConfig): string;
|
|
13
|
+
/** One stack a lifecycle command operates on: its build root and, for a
|
|
14
|
+
* multi-stack project, the deployed CloudFormation stack name it observes
|
|
15
|
+
* against. */
|
|
16
|
+
interface StackTarget {
|
|
17
|
+
/** The deployed stack name to observe (undefined ⇒ single-stack convention:
|
|
18
|
+
* the stack named after the environment). */
|
|
19
|
+
stack?: string;
|
|
20
|
+
/** Build root to synthesize this stack from, scoped so its logical ids match
|
|
21
|
+
* what the stack actually deploys. */
|
|
22
|
+
root: string;
|
|
23
|
+
/** Region the stack is deployed in, from `stacks[].region` (#1261). Without
|
|
24
|
+
* it every stack is observed against the ambient region, so a multi-region
|
|
25
|
+
* estate snapshots only the stacks that happen to share it and reports the
|
|
26
|
+
* rest as "no valid resources or artifacts returned". */
|
|
27
|
+
region?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The stacks a lifecycle command (`snapshot`/`diff`) iterates. A multi-stack
|
|
31
|
+
* project declares them via `stacks` in chant.config (#932) — each built from
|
|
32
|
+
* its own `src` and observed against its own live stack `name`. A single-stack
|
|
33
|
+
* project (no `stacks`) resolves to one target built from `sourceDir`/root and
|
|
34
|
+
* observed as the stack named after the environment (unchanged behavior). An
|
|
35
|
+
* explicit `--src` always wins and forces a single scoped target.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveStackTargets(args: ParsedArgs, config: ChantConfig): StackTarget[];
|
|
13
38
|
/**
|
|
14
39
|
* chant lifecycle snapshot <environment> [lexicon]
|
|
15
40
|
*/
|
|
@@ -93,4 +118,5 @@ export declare function runLifecycleUnknown(ctx: CommandContext): Promise<number
|
|
|
93
118
|
* an empty list as if it meant "nothing downstream".
|
|
94
119
|
*/
|
|
95
120
|
export declare function runLifecycleAffected(ctx: CommandContext): Promise<number>;
|
|
121
|
+
export {};
|
|
96
122
|
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/lifecycle.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAKlD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,U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ACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2L/E;AAsBD;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiB1E;AAgBD;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAmE7E;AAiCD;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAM9E;AAkBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA8D/E"}
|
|
@@ -48,7 +48,7 @@ export function resolveBuildRoot(args, config) {
|
|
|
48
48
|
* observed as the stack named after the environment (unchanged behavior). An
|
|
49
49
|
* explicit `--src` always wins and forces a single scoped target.
|
|
50
50
|
*/
|
|
51
|
-
function resolveStackTargets(args, config) {
|
|
51
|
+
export function resolveStackTargets(args, config) {
|
|
52
52
|
if (args.src)
|
|
53
53
|
return [{ root: resolve(args.src) }];
|
|
54
54
|
if (config.stacks && config.stacks.length > 0) {
|
|
@@ -70,4 +70,6 @@ export declare const PR_REPORT_DIR = ".chant/pr";
|
|
|
70
70
|
export declare function runComponentsPrPlan(ctx: CommandContext): Promise<number>;
|
|
71
71
|
/** chant components pr-apply --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--require-review] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
72
72
|
export declare function runComponentsPrApply(ctx: CommandContext): Promise<number>;
|
|
73
|
+
/** chant components pr-record --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
74
|
+
export declare function runComponentsPrRecord(ctx: CommandContext): Promise<number>;
|
|
73
75
|
//# sourceMappingURL=pr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAuDH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD,qDAAqD;AACrD,eAAO,MAAM,aAAa,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/pr.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAuDH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD,qDAAqD;AACrD,eAAO,MAAM,aAAa,cAAc,CAAC;AAqSzC,mKAAmK;AACnK,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGxE;AAyDD,yLAAyL;AACzL,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAGzE;AAuPD,uKAAuK;AACvK,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAG1E"}
|
package/dist/cli/handlers/pr.js
CHANGED
|
@@ -239,6 +239,7 @@ function settleOf(status) {
|
|
|
239
239
|
switch (status) {
|
|
240
240
|
case "nothing":
|
|
241
241
|
case "planned":
|
|
242
|
+
case "recorded":
|
|
242
243
|
case "applied":
|
|
243
244
|
return "ok";
|
|
244
245
|
case "refused":
|
|
@@ -415,6 +416,13 @@ export function runComponentsPrApply(ctx) {
|
|
|
415
416
|
return withStageEvents("pr-apply", ctx, (events) => prApply(ctx, events));
|
|
416
417
|
}
|
|
417
418
|
async function prApply(ctx, stage) {
|
|
419
|
+
// #4168: the review-rules security group turns --require-review on, read from the declaration at base.
|
|
420
|
+
const { securityGroupsAt } = await import("../../workspace/security.js");
|
|
421
|
+
const reviewRules = !ctx.args.requireReview && securityGroupsAt(process.cwd(), ctx.args.base).has("review-rules");
|
|
422
|
+
if (reviewRules && !ctx.args.forge)
|
|
423
|
+
return fail("the workspace opts into review-rules, which reads the pull request's reviews, so pr-apply needs --forge <kind>");
|
|
424
|
+
if (reviewRules)
|
|
425
|
+
ctx = { ...ctx, args: { ...ctx.args, requireReview: true } };
|
|
418
426
|
const { args } = ctx;
|
|
419
427
|
if (args.requireReview && !args.forge)
|
|
420
428
|
return fail("--require-review reads the pull request's reviews, so it needs --forge <kind>");
|
|
@@ -641,12 +649,126 @@ async function prApply(ctx, stage) {
|
|
|
641
649
|
console.error(formatSuccess(`applied the plan ${report.digest} approved by ${(approval.approvedBy ?? []).join(", ")}`));
|
|
642
650
|
return code;
|
|
643
651
|
}
|
|
652
|
+
/** chant components pr-record --base <ref> [--pr <n>] [--env <env>] [--gate <name>] [--forge <kind>] [--output <dir>] [--json] [--events-json] [--report-url <url>] */
|
|
653
|
+
export function runComponentsPrRecord(ctx) {
|
|
654
|
+
if (refusesEventsWithJson(ctx.args, "the stage's report"))
|
|
655
|
+
return Promise.resolve(1);
|
|
656
|
+
return withStageEvents("pr-record", ctx, (events) => prRecord(ctx, events));
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* The record stage (#4168 step 1): what a merge does unless apply on merge
|
|
660
|
+
* is opted in. It plans the members the change reaches on the merged
|
|
661
|
+
* commit, stores the change set, decides the pull request's gate against
|
|
662
|
+
* it without writing to the ledger, and writes the merge record
|
|
663
|
+
* (`../../lifecycle/merge-record.ts`). It applies nothing and refuses
|
|
664
|
+
* nothing. A plan that differs from the approved one is recorded, and the
|
|
665
|
+
* `chant/record` status fails (decision 1). It exits 1 only when a member
|
|
666
|
+
* failed to plan.
|
|
667
|
+
*/
|
|
668
|
+
async function prRecord(ctx, stage) {
|
|
669
|
+
const { args } = ctx;
|
|
670
|
+
const p = await prepare(ctx, "record");
|
|
671
|
+
if (typeof p === "number")
|
|
672
|
+
return p;
|
|
673
|
+
let pr = args.pr ?? null;
|
|
674
|
+
if (pr === null && p.forge) {
|
|
675
|
+
try {
|
|
676
|
+
pr = await p.forge.pullRequestFor(p.head);
|
|
677
|
+
}
|
|
678
|
+
catch (err) {
|
|
679
|
+
console.error(formatWarning({ message: `could not ask ${p.forge.kind} which pull request merged ${p.head}, so the record names none: ${err instanceof Error ? err.message : String(err)}` }));
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
const op = pr === null ? "pr-unknown" : prOp(pr, p.member);
|
|
683
|
+
const upload = openUpload(stage, "record", pr, p);
|
|
684
|
+
const events = await openCliRunEvents(args, { kind: "component", name: `pr-record ${op}`, cwd: resolve(".") }, upload?.line);
|
|
685
|
+
stage.stream = events;
|
|
686
|
+
events?.emit({ type: "run-start", waves: p.plan.waves });
|
|
687
|
+
const set = await planAll(p, events?.emit);
|
|
688
|
+
const nothing = p.plan.order.length === 0;
|
|
689
|
+
let approval = { status: "pending" };
|
|
690
|
+
if (!nothing && !set.failed) {
|
|
691
|
+
await storeChangeSetForGate(ctx, p, set.doc);
|
|
692
|
+
if (pr !== null) {
|
|
693
|
+
try {
|
|
694
|
+
const check = await emitGateStep(events?.emit, { op, gate: p.gate }, () => decidePrGate(readOnlyLedger(gitGateLedgerPort()), { op, gate: p.gate, digest: set.doc.digest }));
|
|
695
|
+
approval = approvalOf(check);
|
|
696
|
+
}
|
|
697
|
+
catch (err) {
|
|
698
|
+
console.error(formatWarning({ message: `could not read the gate ledger, so the record says no approval: ${err instanceof Error ? err.message : String(err)}` }));
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
// #4000: the record keeps an approval by someone who wrote the change, which review rules would not count.
|
|
703
|
+
let authorApproved;
|
|
704
|
+
if (pr !== null && p.forge && approval.status === "approved") {
|
|
705
|
+
try {
|
|
706
|
+
const authors = (await p.forge.authors(pr)).map((login) => p.forge.principalOf(login));
|
|
707
|
+
authorApproved = approversWhoAuthored(approval.approvedBy ?? [], authors);
|
|
708
|
+
}
|
|
709
|
+
catch (err) {
|
|
710
|
+
console.error(formatWarning({ message: `could not read the authors of #${pr}: ${err instanceof Error ? err.message : String(err)}` }));
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
const status = nothing ? "nothing" : set.failed ? "plan-failed" : "recorded";
|
|
714
|
+
const report = prReport({
|
|
715
|
+
stage: "record",
|
|
716
|
+
pr,
|
|
717
|
+
env: p.env,
|
|
718
|
+
...(p.member ? { member: p.member } : {}),
|
|
719
|
+
base: p.base,
|
|
720
|
+
head: p.head,
|
|
721
|
+
op,
|
|
722
|
+
gate: p.gate,
|
|
723
|
+
plan: p.plan,
|
|
724
|
+
signal: p.signal,
|
|
725
|
+
set,
|
|
726
|
+
approval,
|
|
727
|
+
status,
|
|
728
|
+
...(status === "plan-failed" ? { message: "A member failed to plan on the merged commit, so the record has no plan to compare with the approved one. Nothing was applied." } : {}),
|
|
729
|
+
...(status === "recorded" && approval.status === "changed"
|
|
730
|
+
? { message: `${describePlanChanged({ op, gate: p.gate, digest: set.doc.digest, approval })} The merge stands and nothing was applied; the release gate decides before this deploys.` }
|
|
731
|
+
: {}),
|
|
732
|
+
});
|
|
733
|
+
const { mergeSourceOf, writeMergeRecord, MERGE_RECORD_SCHEMA_ID, MERGE_RECORD_CONTRACT } = await import("../../lifecycle/merge-record.js");
|
|
734
|
+
const { pushLifecycleReport } = await import("../../lifecycle/git.js");
|
|
735
|
+
try {
|
|
736
|
+
const written = await writeMergeRecord({
|
|
737
|
+
$schema: MERGE_RECORD_SCHEMA_ID,
|
|
738
|
+
contract: MERGE_RECORD_CONTRACT,
|
|
739
|
+
commit: p.head,
|
|
740
|
+
base: p.base,
|
|
741
|
+
env: p.env,
|
|
742
|
+
...(p.member ? { member: p.member } : {}),
|
|
743
|
+
source: mergeSourceOf(resolve("."), p.head, pr),
|
|
744
|
+
op: pr === null ? null : op,
|
|
745
|
+
gate: p.gate,
|
|
746
|
+
digest: nothing ? null : set.doc.digest,
|
|
747
|
+
plan: nothing ? "nothing" : set.failed ? "plan-failed" : approval.status === "approved" ? "approved" : approval.status === "changed" ? "changed" : "unapproved",
|
|
748
|
+
...(approval.status === "changed" && approval.approved ? { approvedDigest: approval.approved } : {}),
|
|
749
|
+
approvedBy: approval.status === "approved" ? (approval.approvedBy ?? []) : [],
|
|
750
|
+
...(authorApproved && authorApproved.length > 0 ? { authorApproved } : {}),
|
|
751
|
+
components: p.plan.order,
|
|
752
|
+
recordedAt: new Date().toISOString(),
|
|
753
|
+
});
|
|
754
|
+
if (written.written) {
|
|
755
|
+
const pushed = await pushLifecycleReport();
|
|
756
|
+
if (pushed.pushWarning)
|
|
757
|
+
console.error(formatWarning({ message: pushed.pushWarning }));
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
catch (err) {
|
|
761
|
+
console.error(formatWarning({ message: `could not write the merge record for ${p.head}: ${err instanceof Error ? err.message : String(err)}` }));
|
|
762
|
+
}
|
|
763
|
+
const stop = stopper(ctx, p, events, upload);
|
|
764
|
+
return stop(report, status === "plan-failed" ? 1 : 0);
|
|
765
|
+
}
|
|
644
766
|
/** How a stage stops: settle its events, write and publish the report, say how it ended, and return `code`. */
|
|
645
767
|
function stopper(ctx, p, events, upload) {
|
|
646
768
|
return async (report, code, settle) => {
|
|
647
|
-
events?.settle(settle ?? settleOf(report.status), report.status === "plan-failed" || report.status === "failed" ? report.message ?? `pr
|
|
769
|
+
events?.settle(settle ?? settleOf(report.status), report.status === "plan-failed" || report.status === "failed" ? report.message ?? `pr-${report.stage} ${report.status}` : undefined);
|
|
648
770
|
await finish(ctx, p, report, upload);
|
|
649
|
-
console.error((code === 0 ? formatInfo : (m) => formatWarning({ message: m }))(`pr
|
|
771
|
+
console.error((code === 0 ? formatInfo : (m) => formatWarning({ message: m }))(`pr-${report.stage}: ${report.status}${report.refusal ? ` (${report.refusal})` : ""}`));
|
|
650
772
|
if (report.message)
|
|
651
773
|
console.error(report.message);
|
|
652
774
|
printMembers(report);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+CH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AA+CH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAulBlD,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2E/E;AAED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsChF;AAsCD,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BhF"}
|
|
@@ -247,7 +247,7 @@ async function deployPlan(ctx, verb, plan, project, actor, record, under) {
|
|
|
247
247
|
if (under) {
|
|
248
248
|
const { pinReleaseTemplates } = await import("../../components/release-promote.js");
|
|
249
249
|
const { readReleaseTemplate } = await import("../../lifecycle/release-store.js");
|
|
250
|
-
const pinned = await pinReleaseTemplates(prepared, under.release, under.target, (digest) => readReleaseTemplate(digest));
|
|
250
|
+
const pinned = await pinReleaseTemplates(prepared, under.release, under.target, (digest, encoding) => readReleaseTemplate(digest, undefined, encoding));
|
|
251
251
|
if ("errors" in pinned) {
|
|
252
252
|
for (const message of pinned.errors)
|
|
253
253
|
console.error(formatError({ message }));
|
|
@@ -526,6 +526,21 @@ async function resolveUnderRelease(ref, env, verb, fix) {
|
|
|
526
526
|
console.error(formatError(revokedRefusal({ releaseDigest: found.release.releaseDigest, label: found.label }, revocation, await fix(found.release))));
|
|
527
527
|
return 1;
|
|
528
528
|
}
|
|
529
|
+
// #4168: under verified-releases a release deploys only once `chant release verify` passes for it.
|
|
530
|
+
const { securityGroupsAt } = await import("../../workspace/security.js");
|
|
531
|
+
if (securityGroupsAt(process.cwd()).has("verified-releases")) {
|
|
532
|
+
const { verifyRelease, verificationCode } = await import("../../lifecycle/release-verify.js");
|
|
533
|
+
const name = found.label ?? found.release.releaseDigest;
|
|
534
|
+
const v = await verifyRelease({ cwd: process.cwd(), ref: found.release.releaseDigest });
|
|
535
|
+
const code = "error" in v ? v.error.code : verificationCode(v);
|
|
536
|
+
if (code) {
|
|
537
|
+
console.error(formatError({
|
|
538
|
+
message: `${code}: release ${name} does not verify (${"error" in v ? v.error.message : v.reason}), and the workspace opts into verified-releases, so ${verb} deploys only a verified release`,
|
|
539
|
+
hint: `Check it with: chant release verify ${name}`,
|
|
540
|
+
}));
|
|
541
|
+
return 1;
|
|
542
|
+
}
|
|
543
|
+
}
|
|
529
544
|
return { release: found.release, label: found.label, target: target.target };
|
|
530
545
|
}
|
|
531
546
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `chant release` (#4026, ws-104): the release is what graduates.
|
|
3
3
|
*
|
|
4
|
-
* release cut [<label>] [--yes] [--build <command>] [--param k=v]... [--params-file <file>] [--src <dir>] [-o <file>] [--lexicon <name>] [--actor <name>] [--sign [<key file>]] [--json]
|
|
4
|
+
* release cut [<label>] [--at <sha>] [--yes] [--build <command>] [--param k=v]... [--params-file <file>] [--src <dir>] [-o <file>] [--lexicon <name>] [--actor <name>] [--sign [<key file>]] [--json]
|
|
5
5
|
* a dry run of a cut of this member from the checkout's HEAD, which must be
|
|
6
6
|
* clean, on trunk and pushed, and green (#4027); `--yes` cuts, records,
|
|
7
7
|
* and tags the commit `release/<label>` locally;
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
* release verify <label|digest> [--json]
|
|
18
18
|
* check the release's signature offline against .chant/allowed_signers
|
|
19
19
|
* at the release's commit (#4049)
|
|
20
|
+
* release candidates [--env <env>] [--json]
|
|
21
|
+
* the green commits of trunk a release can be cut from, each with what it
|
|
22
|
+
* would ship, and what each environment runs (#4168 4.2)
|
|
20
23
|
* release list [--json]
|
|
21
24
|
* every release of this member with its targets, its cuts and where it runs;
|
|
22
25
|
* `--json` prints the read contract's `releases` document
|
|
@@ -49,6 +52,11 @@ export declare function sameWithYes(argv: readonly string[]): string;
|
|
|
49
52
|
* would record, build and tag, and what publishes where. With `--yes` it
|
|
50
53
|
* cuts, signs with `--sign`, records the cut with its actor and run id,
|
|
51
54
|
* tags the commit locally and prints the next command.
|
|
55
|
+
*
|
|
56
|
+
* `--at <sha>` (#4168 4.2) cuts that commit instead of `HEAD`, from a
|
|
57
|
+
* temporary worktree (../../lifecycle/release-at.ts), so the checkout need
|
|
58
|
+
* not be clean or at the commit. The label reaches every compile and
|
|
59
|
+
* artifact build as `CHANT_RELEASE_LABEL` (decision 5).
|
|
52
60
|
*/
|
|
53
61
|
export declare function runReleaseCut(ctx: CommandContext): Promise<number>;
|
|
54
62
|
/**
|
|
@@ -76,6 +84,13 @@ export declare function runReleasePublish(ctx: CommandContext): Promise<number>;
|
|
|
76
84
|
* verifies and 1 when it does not or can't be checked.
|
|
77
85
|
*/
|
|
78
86
|
export declare function runReleaseVerify(ctx: CommandContext): Promise<number>;
|
|
87
|
+
/**
|
|
88
|
+
* `release candidates [--env <env>] [--json]` (#4168 4.2): the green commits
|
|
89
|
+
* of trunk a release can be cut from, newest first, each with what it would
|
|
90
|
+
* ship since the previous one, and what each environment runs. `--json`
|
|
91
|
+
* prints the read contract's `release-candidates` document.
|
|
92
|
+
*/
|
|
93
|
+
export declare function runReleaseCandidates(ctx: CommandContext): Promise<number>;
|
|
79
94
|
export declare function runReleaseList(ctx: CommandContext): Promise<number>;
|
|
80
95
|
/**
|
|
81
96
|
* `release export <label|digest> --env <env> [-o <dir>]` (#4046): write each
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/release.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../../src/cli/handlers/release.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAOH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAyBlD,0HAA0H;AAC1H,wBAAgB,YAAY,CAAC,GAAG,EAAE;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uFAAuF;IACvF,YAAY,EAAE,OAAO,CAAC;CACvB,GAAG,MAAM,EAAE,CASX;AAED,wGAAwG;AACxG,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAG3D;AAiBD;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwNxE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA2G5E;AAQD;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAkC3E;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiC/E;AAED,wBAAsB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,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