@intentius/chant 0.124.109 → 0.124.110
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/__golden__/wave-loop/fan-out-applied.json +12 -6
- package/dist/__golden__/wave-loop/fan-out-apply-fails.json +8 -4
- package/dist/__golden__/wave-loop/fan-out-gated.json +4 -2
- package/dist/__golden__/wave-loop/fan-out-no-members.json +16 -8
- package/dist/__golden__/wave-loop/fan-out-plan-fails.json +8 -4
- package/dist/__golden__/wave-loop/fan-out-same-root.json +4 -2
- package/dist/agent-facts.d.ts +130 -0
- package/dist/agent-facts.js +196 -0
- package/dist/change-risk.d.ts +216 -0
- package/dist/change-risk.js +304 -0
- package/dist/change-set.d.ts +8 -0
- package/dist/ci-agent-alert.d.ts +139 -0
- package/dist/ci-agent-alert.js +342 -0
- package/dist/ci-agent-triggers.d.ts +152 -0
- package/dist/ci-agent-triggers.js +232 -0
- package/dist/ci-agent-verify-failed.d.ts +149 -0
- package/dist/ci-agent-verify-failed.js +191 -0
- package/dist/ci-agent.d.ts +136 -8
- package/dist/ci-agent.js +353 -26
- package/dist/ci-comment-commands.d.ts +8 -0
- package/dist/ci-comment-commands.js +17 -1
- package/dist/ci-comment-reject.d.ts +70 -0
- package/dist/ci-comment-reject.js +135 -0
- package/dist/ci-comment-replies.d.ts +3 -1
- package/dist/ci-comment-replies.js +6 -0
- package/dist/ci-estate/delivery.d.ts +25 -3
- package/dist/ci-estate/delivery.js +28 -9
- package/dist/ci-estate/page.d.ts +7 -3
- package/dist/ci-estate/page.js +19 -4
- package/dist/ci-estate/rows.d.ts +14 -2
- package/dist/ci-estate/rows.js +9 -1
- package/dist/ci-estate.d.ts +5 -2
- package/dist/ci-estate.js +3 -2
- package/dist/ci-handover.d.ts +2 -7
- package/dist/ci-handover.js +3 -20
- package/dist/ci-jobs.d.ts +6 -0
- package/dist/ci-jobs.js +17 -0
- package/dist/ci-note-commands.d.ts +2 -0
- package/dist/ci-note-commands.js +12 -1
- package/dist/ci-product-words.d.ts +151 -1
- package/dist/ci-product-words.js +1390 -3
- package/dist/ci-product.d.ts +100 -4
- package/dist/ci-product.js +99 -3
- package/dist/ci-respond-run.d.ts +9 -0
- package/dist/ci-respond-run.js +35 -4
- package/dist/ci-respond-summary-env.d.ts +56 -0
- package/dist/ci-respond-summary-env.js +81 -0
- package/dist/ci-respond-summary.d.ts +103 -0
- package/dist/ci-respond-summary.js +243 -0
- package/dist/ci-respond.d.ts +4 -2
- package/dist/ci-respond.js +4 -2
- package/dist/cli/command-group.js +1 -1
- package/dist/cli/commands/lint.js +21 -3
- package/dist/cli/handlers/agent.js +49 -4
- package/dist/cli/handlers/approve.js +3 -1
- package/dist/cli/handlers/build.d.ts +97 -1
- package/dist/cli/handlers/build.js +251 -3
- package/dist/cli/handlers/fan-out.js +55 -0
- package/dist/cli/handlers/graph.d.ts +14 -0
- package/dist/cli/handlers/graph.js +58 -3
- package/dist/cli/handlers/lifecycle-health.d.ts +7 -0
- package/dist/cli/handlers/lifecycle-health.js +47 -9
- package/dist/cli/handlers/lifecycle.js +4 -1
- package/dist/cli/handlers/notify-relay.d.ts +2 -2
- package/dist/cli/handlers/notify-relay.js +67 -7
- package/dist/cli/handlers/pipeline-agent.d.ts +30 -0
- package/dist/cli/handlers/pipeline-agent.js +255 -0
- package/dist/cli/handlers/pipeline-artifacts.d.ts +39 -0
- package/dist/cli/handlers/pipeline-artifacts.js +203 -0
- package/dist/cli/handlers/pipeline.d.ts +16 -0
- package/dist/cli/handlers/pipeline.js +112 -0
- package/dist/cli/handlers/pr-comment.js +4 -0
- package/dist/cli/handlers/pr-notes.js +4 -1
- package/dist/cli/handlers/pr.d.ts +20 -0
- package/dist/cli/handlers/pr.js +114 -11
- package/dist/cli/handlers/promote.js +792 -47
- package/dist/cli/handlers/reject.d.ts +84 -0
- package/dist/cli/handlers/reject.js +216 -0
- package/dist/cli/handlers/replan.d.ts +54 -0
- package/dist/cli/handlers/replan.js +177 -0
- package/dist/cli/handlers/run-generate.d.ts +5 -0
- package/dist/cli/handlers/run-generate.js +31 -4
- package/dist/cli/handlers/run-wave.js +15 -2
- package/dist/cli/handlers/run.js +4 -2
- package/dist/cli/handlers/stage.d.ts +35 -0
- package/dist/cli/handlers/stage.js +90 -0
- package/dist/cli/lsp/server.js +4 -0
- package/dist/cli/main.js +88 -8
- package/dist/cli/parse-args.js +35 -2
- package/dist/cli/registry.d.ts +12 -0
- package/dist/components/auto-release.d.ts +2 -0
- package/dist/components/auto-release.js +1 -0
- package/dist/components/capability.d.ts +40 -0
- package/dist/components/cli-support.d.ts +21 -1
- package/dist/components/cli-support.js +28 -6
- package/dist/components/component.d.ts +23 -4
- package/dist/components/component.schema.json +28 -0
- package/dist/components/declared-reads.d.ts +44 -4
- package/dist/components/declared-reads.js +80 -3
- package/dist/components/discover.d.ts +8 -0
- package/dist/components/discover.js +1 -1
- package/dist/components/driver.d.ts +13 -0
- package/dist/components/driver.js +23 -2
- package/dist/components/environment-sets.d.ts +229 -0
- package/dist/components/environment-sets.js +338 -0
- package/dist/components/fan-out-canary.d.ts +47 -0
- package/dist/components/fan-out-canary.js +58 -0
- package/dist/components/fan-out-run.d.ts +17 -0
- package/dist/components/fan-out-run.js +14 -1
- package/dist/components/fan-out-support.d.ts +7 -0
- package/dist/components/fan-out-support.js +1 -1
- package/dist/components/groups.d.ts +8 -1
- package/dist/components/groups.js +19 -1
- package/dist/components/index.d.ts +5 -2
- package/dist/components/index.js +4 -1
- package/dist/components/pr-cost.d.ts +28 -0
- package/dist/components/pr-cost.js +53 -0
- package/dist/components/pr-pipeline.d.ts +33 -0
- package/dist/components/pr-pipeline.js +32 -5
- package/dist/components/pr-policy.d.ts +33 -2
- package/dist/components/pr-policy.js +5 -2
- package/dist/components/pr-risk.d.ts +42 -0
- package/dist/components/pr-risk.js +74 -0
- package/dist/components/product-pipeline.d.ts +43 -0
- package/dist/components/product-pipeline.js +67 -1
- package/dist/components/promote.d.ts +6 -0
- package/dist/components/promote.js +13 -0
- package/dist/components/release-compile.js +3 -1
- package/dist/components/release-gate.d.ts +6 -1
- package/dist/components/release-gate.js +10 -2
- package/dist/components/step-environments.d.ts +236 -0
- package/dist/components/step-environments.js +392 -0
- package/dist/components/upstream-replan.d.ts +201 -0
- package/dist/components/upstream-replan.js +249 -0
- package/dist/components/verify-step.d.ts +30 -0
- package/dist/components/verify-step.js +27 -0
- package/dist/components/wave-plan.js +6 -2
- package/dist/config-environments.d.ts +4 -2
- package/dist/control/dispatch.d.ts +15 -0
- package/dist/control/dispatch.js +28 -4
- package/dist/cost-estimate.d.ts +188 -0
- package/dist/cost-estimate.js +363 -0
- package/dist/drift-record.d.ts +36 -0
- package/dist/drift-record.js +44 -0
- package/dist/engine-facts.d.ts +105 -0
- package/dist/engine-facts.js +111 -0
- package/dist/exit-codes.d.ts +4 -3
- package/dist/exit-codes.js +4 -3
- package/dist/flag-params.d.ts +2 -2
- package/dist/flag-params.js +9 -4
- package/dist/floor-table.data.js +53 -0
- package/dist/forge-token-vars.d.ts +12 -0
- package/dist/forge-token-vars.js +25 -0
- package/dist/gate-decision.d.ts +3 -1
- package/dist/gate-decision.js +3 -1
- package/dist/gated-waves.d.ts +2 -0
- package/dist/gated-waves.js +1 -0
- package/dist/graph-ir.d.ts +30 -0
- package/dist/graph-ir.js +33 -1
- package/dist/graph-refs.d.ts +26 -0
- package/dist/graph-refs.js +34 -3
- package/dist/graph-schema/graph.schema.json +136 -0
- package/dist/health.d.ts +65 -0
- package/dist/health.js +62 -0
- package/dist/lexicon.d.ts +188 -1
- package/dist/lifecycle/disruption.d.ts +14 -1
- package/dist/lifecycle/disruption.js +5 -1
- package/dist/lifecycle/gate-change-set.d.ts +8 -0
- package/dist/lifecycle/gate-change-set.js +2 -1
- package/dist/lifecycle/gate-ledger.d.ts +26 -0
- package/dist/lifecycle/gate-rejection.d.ts +82 -0
- package/dist/lifecycle/gate-rejection.js +93 -0
- package/dist/lifecycle/gate-seal.d.ts +3 -3
- package/dist/lifecycle/gate-seal.js +5 -5
- package/dist/lifecycle/observe.d.ts +17 -0
- package/dist/lifecycle/observe.js +10 -1
- package/dist/lifecycle/release-cut.js +4 -0
- package/dist/lifecycle/release-ledger.d.ts +8 -0
- package/dist/lifecycle/release-risk.d.ts +137 -0
- package/dist/lifecycle/release-risk.js +214 -0
- package/dist/lifecycle/release-store.d.ts +9 -0
- package/dist/lifecycle/release-store.js +4 -0
- package/dist/lifecycle/stage-log.d.ts +85 -0
- package/dist/lifecycle/stage-log.js +141 -0
- package/dist/lint/canary-checks.d.ts +31 -0
- package/dist/lint/canary-checks.js +45 -0
- package/dist/lint/rule.d.ts +1 -0
- package/dist/lint/rules/evl012-pipeline-fold.d.ts +14 -0
- package/dist/lint/rules/evl012-pipeline-fold.js +30 -0
- package/dist/lint/rules/index.d.ts +1 -0
- package/dist/lint/rules/index.js +3 -0
- package/dist/notify-relay-repo.d.ts +54 -0
- package/dist/notify-relay-repo.js +84 -0
- package/dist/notify-relay.d.ts +53 -3
- package/dist/notify-relay.js +96 -3
- package/dist/notify.d.ts +57 -1
- package/dist/notify.js +7 -1
- package/dist/notify.schema.json +61 -3
- package/dist/observation.d.ts +34 -0
- package/dist/observation.js +14 -1
- package/dist/op/activities/review-agent.d.ts +39 -2
- package/dist/op/activities/review-agent.js +88 -5
- package/dist/op/agent-permit.d.ts +88 -0
- package/dist/op/agent-permit.js +97 -0
- package/dist/op/gate-approval-base.d.ts +8 -0
- package/dist/op/gate-approval-base.js +9 -0
- package/dist/op/gate-approval.d.ts +30 -1
- package/dist/op/gate-approval.js +23 -2
- package/dist/op/gate-quorum.d.ts +114 -8
- package/dist/op/gate-quorum.js +198 -21
- package/dist/op/gate-reject.d.ts +79 -0
- package/dist/op/gate-reject.js +96 -0
- package/dist/op/gate-summary.js +1 -1
- package/dist/op/gate.d.ts +28 -3
- package/dist/op/gate.js +55 -13
- package/dist/op/generate-pipeline.d.ts +15 -1
- package/dist/op/generate-pipeline.js +32 -5
- package/dist/op/index.d.ts +11 -6
- package/dist/op/index.js +10 -5
- package/dist/op/local-executor.d.ts +2 -0
- package/dist/op/local-executor.js +23 -4
- package/dist/op/op-waves-after-plan.d.ts +23 -0
- package/dist/op/op-waves-after-plan.js +12 -1
- package/dist/op/op-waves-capability-spec.d.ts +14 -0
- package/dist/op/op-waves-capability-spec.js +46 -6
- package/dist/op/op-waves-capability.d.ts +21 -13
- package/dist/op/op-waves-capability.js +22 -59
- package/dist/op/op-waves-environment-sets.d.ts +41 -0
- package/dist/op/op-waves-environment-sets.js +82 -0
- package/dist/op/op-waves-quorum-warnings.d.ts +53 -0
- package/dist/op/op-waves-quorum-warnings.js +90 -0
- package/dist/op/op-waves-release-port.d.ts +7 -0
- package/dist/op/op-waves-release-port.js +15 -3
- package/dist/op/op-waves-release.d.ts +15 -0
- package/dist/op/op-waves-release.js +15 -0
- package/dist/op/op-waves-run.d.ts +37 -3
- package/dist/op/op-waves-run.js +141 -18
- package/dist/op/op-waves-soak.d.ts +57 -0
- package/dist/op/op-waves-soak.js +111 -0
- package/dist/op/op-waves-split.d.ts +4 -0
- package/dist/op/op-waves-split.js +4 -0
- package/dist/op/op-waves.d.ts +67 -4
- package/dist/op/op-waves.js +71 -3
- package/dist/pipeline/agent-ajv.d.ts +4 -0
- package/dist/pipeline/agent-ajv.js +14 -0
- package/dist/pipeline/agent-steps.d.ts +329 -0
- package/dist/pipeline/agent-steps.js +602 -0
- package/dist/pipeline/artifacts.d.ts +264 -0
- package/dist/pipeline/artifacts.js +425 -0
- package/dist/pipeline/diff.d.ts +45 -0
- package/dist/pipeline/diff.js +177 -0
- package/dist/pipeline/fold.d.ts +43 -0
- package/dist/pipeline/fold.js +140 -0
- package/dist/pipeline/generate.d.ts +52 -0
- package/dist/pipeline/generate.js +120 -0
- package/dist/pipeline/product.d.ts +225 -0
- package/dist/pipeline/product.js +257 -0
- package/dist/pipeline/promote.d.ts +404 -0
- package/dist/pipeline/promote.js +694 -0
- package/dist/pipeline/read.d.ts +37 -0
- package/dist/pipeline/read.js +58 -0
- package/dist/pipeline/rendered.d.ts +25 -0
- package/dist/pipeline/rendered.js +53 -0
- package/dist/pipeline/soak-checks.d.ts +80 -0
- package/dist/pipeline/soak-checks.js +254 -0
- package/dist/pipeline/soak-gate.d.ts +97 -0
- package/dist/pipeline/soak-gate.js +176 -0
- package/dist/pipeline/soak-sources.d.ts +17 -0
- package/dist/pipeline/soak-sources.js +42 -0
- package/dist/pipeline/soak.d.ts +260 -0
- package/dist/pipeline/soak.js +378 -0
- package/dist/pipeline/spec.d.ts +724 -0
- package/dist/pipeline/spec.js +567 -0
- package/dist/pipeline/stage-ledger.d.ts +187 -0
- package/dist/pipeline/stage-ledger.js +185 -0
- package/dist/pipeline/stage-waves.d.ts +114 -0
- package/dist/pipeline/stage-waves.js +161 -0
- package/dist/pipeline/stages.d.ts +64 -0
- package/dist/pipeline/stages.js +174 -0
- package/dist/pipeline/verify-rollback.d.ts +277 -0
- package/dist/pipeline/verify-rollback.js +393 -0
- package/dist/pipeline.d.ts +142 -0
- package/dist/pipeline.js +143 -0
- package/dist/pr-loop.d.ts +22 -0
- package/dist/pr-loop.js +8 -0
- package/dist/pr-plan-note.d.ts +15 -1
- package/dist/pr-plan-note.js +8 -0
- package/dist/pr-post.d.ts +31 -0
- package/dist/pr-post.js +89 -0
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/report-store/audit.schema.json +50 -0
- package/dist/report-store/dora.schema.json +331 -0
- package/dist/report-store/estate.schema.json +96 -0
- package/dist/report-store/run.schema.json +14 -0
- package/dist/report-store.d.ts +151 -0
- package/dist/report-store.js +344 -0
- package/dist/run-event.d.ts +7 -2
- package/dist/wave-runtime.mjs +458 -404
- package/dist/workspace/catalog-edges.js +3 -3
- package/dist/workspace/change-set.schema.json +4 -0
- package/dist/workspace/ci-cloud-identity.d.ts +4 -0
- package/dist/workspace/ci-cloud-identity.js +30 -0
- package/dist/workspace/ci-run.js +17 -2
- package/dist/workspace/ci-secrets.d.ts +3 -1
- package/dist/workspace/ci-secrets.js +7 -1
- package/dist/workspace/compose-graph.d.ts +1 -1
- package/dist/workspace/compose-graph.js +3 -1
- package/dist/workspace/declaration.d.ts +27 -0
- package/dist/workspace/declaration.js +35 -0
- package/dist/workspace/declaration.schema.json +56 -0
- package/dist/workspace/graph-cli.js +26 -0
- package/dist/workspace/graph.schema.json +5 -1
- package/dist/workspace/identity-gate-rule.d.ts +4 -0
- package/dist/workspace/identity-gate-rule.js +2 -2
- package/dist/workspace/identity-reject-rule.d.ts +14 -0
- package/dist/workspace/identity-reject-rule.js +24 -0
- package/dist/workspace/identity.d.ts +3 -0
- package/dist/workspace/identity.js +2 -1
- package/dist/workspace/nested-graph.js +2 -0
- package/dist/workspace/pr-report.schema.json +65 -0
- package/dist/workspace/promotion-order.d.ts +19 -4
- package/dist/workspace/promotion-order.js +26 -4
- package/dist/workspace/release-train.d.ts +14 -0
- package/dist/workspace/release-train.js +32 -0
- package/dist/workspace/run-event.schema.json +2 -2
- package/dist/workspace/stack-read-edges.d.ts +19 -0
- package/dist/workspace/stack-read-edges.js +54 -0
- package/dist/workspace/status-gates.d.ts +51 -1
- package/dist/workspace/status-gates.js +60 -0
- package/dist/workspace/status-stages.d.ts +223 -0
- package/dist/workspace/status-stages.js +279 -0
- package/dist/workspace/status.d.ts +45 -1
- package/dist/workspace/status.js +109 -5
- package/dist/workspace/status.schema.json +283 -2
- package/dist/workspace/trust/seal.d.ts +7 -0
- package/dist/workspace/trust/seal.js +9 -0
- package/package.json +5 -1
package/dist/ci-handover.d.ts
CHANGED
|
@@ -29,13 +29,8 @@
|
|
|
29
29
|
* (../workspace/ci-run.ts).
|
|
30
30
|
*/
|
|
31
31
|
import type { ForgeKind } from "./pr-forge.js";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* A step that runs the change's code starts without them. The list is
|
|
35
|
-
* terragucci's `STEP_TOKEN_VARS` (render.ts:1787) with chant's own names
|
|
36
|
-
* (`FORGE_TOKEN_ENV` in ./pr-forge.ts) and GitLab's added.
|
|
37
|
-
*/
|
|
38
|
-
export declare const FORGE_TOKEN_VARS: readonly ["CHANT_FORGE_TOKEN", "CHANT_GITHUB_TOKEN", "CHANT_FORGEJO_TOKEN", "CHANT_GITLAB_TOKEN", "CHANT_CHECKOUT_TOKEN", "GITHUB_TOKEN", "GH_TOKEN", "FORGEJO_TOKEN", "GITEA_TOKEN", "GITLAB_TOKEN", "CI_JOB_TOKEN", "ACTIONS_RUNTIME_TOKEN"];
|
|
32
|
+
import { FORGE_TOKEN_VARS } from "./forge-token-vars.js";
|
|
33
|
+
export { FORGE_TOKEN_VARS };
|
|
39
34
|
/** `env` without {@link FORGE_TOKEN_VARS}. */
|
|
40
35
|
export declare function withoutForgeTokens<T extends Record<string, string | undefined>>(env: T): T;
|
|
41
36
|
/** Whether `env` holds a forge token under one of {@link FORGE_TOKEN_VARS}. */
|
package/dist/ci-handover.js
CHANGED
|
@@ -28,26 +28,9 @@
|
|
|
28
28
|
* forge token, and the runner posts from the report once the steps settle
|
|
29
29
|
* (../workspace/ci-run.ts).
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
* terragucci's `STEP_TOKEN_VARS` (render.ts:1787) with chant's own names
|
|
35
|
-
* (`FORGE_TOKEN_ENV` in ./pr-forge.ts) and GitLab's added.
|
|
36
|
-
*/
|
|
37
|
-
export const FORGE_TOKEN_VARS = [
|
|
38
|
-
"CHANT_FORGE_TOKEN",
|
|
39
|
-
"CHANT_GITHUB_TOKEN",
|
|
40
|
-
"CHANT_FORGEJO_TOKEN",
|
|
41
|
-
"CHANT_GITLAB_TOKEN",
|
|
42
|
-
"CHANT_CHECKOUT_TOKEN",
|
|
43
|
-
"GITHUB_TOKEN",
|
|
44
|
-
"GH_TOKEN",
|
|
45
|
-
"FORGEJO_TOKEN",
|
|
46
|
-
"GITEA_TOKEN",
|
|
47
|
-
"GITLAB_TOKEN",
|
|
48
|
-
"CI_JOB_TOKEN",
|
|
49
|
-
"ACTIONS_RUNTIME_TOKEN",
|
|
50
|
-
];
|
|
31
|
+
import { FORGE_TOKEN_VARS } from "./forge-token-vars.js";
|
|
32
|
+
// The list lives in ./forge-token-vars so the pull-request loop's bundle takes it alone (#5416).
|
|
33
|
+
export { FORGE_TOKEN_VARS };
|
|
51
34
|
/** `env` without {@link FORGE_TOKEN_VARS}. */
|
|
52
35
|
export function withoutForgeTokens(env) {
|
|
53
36
|
const out = { ...env };
|
package/dist/ci-jobs.d.ts
CHANGED
|
@@ -124,6 +124,12 @@ export declare function assertRunnerLabels(subject: string, field: string, runne
|
|
|
124
124
|
* ({@link gitlabIdTokensDoc}).
|
|
125
125
|
*/
|
|
126
126
|
export declare function idTokenAudienceEnv(idTokens: Readonly<Record<string, string>> | undefined): Record<string, string>;
|
|
127
|
+
/**
|
|
128
|
+
* What is wrong with `idTokens` (#5427), or undefined: it must be `{
|
|
129
|
+
* "<variable>": "<audience>" }` with at least one token, each a variable
|
|
130
|
+
* name and a non-empty audience.
|
|
131
|
+
*/
|
|
132
|
+
export declare function idTokensProblem(field: string, idTokens: unknown): string | undefined;
|
|
127
133
|
/** A job's GitLab `id_tokens:` for `{ <variable>: <audience> }` (#3914), or undefined when there are none. */
|
|
128
134
|
export declare function gitlabIdTokensDoc(idTokens: Readonly<Record<string, string>> | undefined): Record<string, {
|
|
129
135
|
aud: string;
|
package/dist/ci-jobs.js
CHANGED
|
@@ -139,6 +139,23 @@ export function assertRunnerLabels(subject, field, runner, forge) {
|
|
|
139
139
|
export function idTokenAudienceEnv(idTokens) {
|
|
140
140
|
return Object.fromEntries(Object.entries(idTokens ?? {}).map(([name, aud]) => [`${name}_AUDIENCE`, aud]));
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* What is wrong with `idTokens` (#5427), or undefined: it must be `{
|
|
144
|
+
* "<variable>": "<audience>" }` with at least one token, each a variable
|
|
145
|
+
* name and a non-empty audience.
|
|
146
|
+
*/
|
|
147
|
+
export function idTokensProblem(field, idTokens) {
|
|
148
|
+
if (idTokens === null || typeof idTokens !== "object" || Array.isArray(idTokens) || Object.keys(idTokens).length === 0) {
|
|
149
|
+
return `${field} must be { "<variable>": "<audience>" }, with at least one token.`;
|
|
150
|
+
}
|
|
151
|
+
for (const [name, aud] of Object.entries(idTokens)) {
|
|
152
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name))
|
|
153
|
+
return `${field} names "${name}", which is not a variable name (letters, digits and "_", not starting with a digit).`;
|
|
154
|
+
if (typeof aud !== "string" || aud.trim() === "")
|
|
155
|
+
return `${field}.${name} must be an audience, a non-empty string.`;
|
|
156
|
+
}
|
|
157
|
+
return undefined;
|
|
158
|
+
}
|
|
142
159
|
/** A job's GitLab `id_tokens:` for `{ <variable>: <audience> }` (#3914), or undefined when there are none. */
|
|
143
160
|
export function gitlabIdTokensDoc(idTokens) {
|
|
144
161
|
const entries = Object.entries(idTokens ?? {});
|
|
@@ -275,6 +275,8 @@ export interface ChantNoteJobs {
|
|
|
275
275
|
export interface ChantNoteRunsOptions {
|
|
276
276
|
/** With `jobs.wavesBeforeMerge`: what the decision before merge reads and writes with. */
|
|
277
277
|
beforeMerge?: Pick<DecideBeforeMergeInput, "requires" | "statuses" | "git" | "cwd" | "lock" | "unlock" | "record" | "stop" | "now">;
|
|
278
|
+
/** What a reject note is recorded with (#5354), under the note author's GitLab identity. Absent: the reply names the reject line. */
|
|
279
|
+
reject?: import("./ci-comment-reject.js").CommentReject;
|
|
278
280
|
}
|
|
279
281
|
/**
|
|
280
282
|
* What a command runs in chant's own GitLab pipeline, for the jobs it has.
|
package/dist/ci-note-commands.js
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
import { GITLAB_AGENT_ASK_VAR, GITLAB_AGENT_PR_VAR } from "./ci-agent.js";
|
|
30
30
|
import { GITLAB_COMMIT_ARG_VAR, GITLAB_COMMIT_PR_VAR, GITLAB_COMMIT_WORD_VAR } from "./ci-commit.js";
|
|
31
31
|
import { parseProductComment, productStatusContext } from "./ci-product-words.js";
|
|
32
|
-
import { commandLine, commentTerms, forkReply, memberReply, notRunReply } from "./ci-comment-replies.js";
|
|
32
|
+
import { commandLine, commentTerms, forkReply, memberReply, notRunReply, rejectNotRecorded } from "./ci-comment-replies.js";
|
|
33
33
|
import { GITLAB_APPLY_PR_VAR, GITLAB_LOCK_PR_VAR, GITLAB_PREVIEW_PR_VAR, GITLAB_UNLOCK_PR_VAR, PREVIEW_COMMENT_ENV } from "./components/pr-pipeline.js";
|
|
34
34
|
import { ForgeApiError } from "./pr-forge.js";
|
|
35
35
|
export { GITLAB_NOTE_COMMANDS_VAR } from "./components/pr-pipeline.js";
|
|
@@ -402,6 +402,17 @@ export function chantNoteRuns(jobs, opts = {}) {
|
|
|
402
402
|
if (!open)
|
|
403
403
|
return { kind: "reply", text: `${at} is not open, so \`/${words.product} ${parsed.word}\` does not run` };
|
|
404
404
|
return { kind: "pipeline", ref: base, variables: { [GITLAB_COMMIT_PR_VAR]: iid, [GITLAB_COMMIT_WORD_VAR]: parsed.word, ...(parsed.arg !== undefined ? { [GITLAB_COMMIT_ARG_VAR]: parsed.arg } : {}) }, doing: `run \`${parsed.word}\` on ${at}` };
|
|
405
|
+
case "reject": {
|
|
406
|
+
// #5354: the poll checked the author's role before this; the stage's approval mode decides whether a note's identity counts.
|
|
407
|
+
const reject = opts.reject;
|
|
408
|
+
if (!reject)
|
|
409
|
+
return { kind: "reply", text: rejectNotRecorded(words, "gitlab") };
|
|
410
|
+
const { reason, stage } = parsed;
|
|
411
|
+
return import("./ci-comment-reject.js").then(async ({ decideCommentReject }) => {
|
|
412
|
+
const done = await decideCommentReject({ reject, words, user: note.author ?? "", reason, ...(stage !== undefined ? { stage } : {}) });
|
|
413
|
+
return done.kind === "fail" ? { kind: "fail", reason: done.reason } : { kind: "reply", text: done.text };
|
|
414
|
+
});
|
|
415
|
+
}
|
|
405
416
|
case "action":
|
|
406
417
|
return { kind: "reply", text: `${line("action")} does not run from a merge request note on GitLab: run \`${words.bin ?? words.product} action ${parsed.member} ${parsed.address}\` from a checkout of the default branch` };
|
|
407
418
|
}
|
|
@@ -32,7 +32,7 @@ export declare const CI_PRODUCT_STAGES: readonly CiProductStage[];
|
|
|
32
32
|
* answers it. `action` (#4653) asks for a day-2 action on one member, which
|
|
33
33
|
* runs under a gated request.
|
|
34
34
|
*/
|
|
35
|
-
export type CiProductCommand = "plan" | "apply" | "lock" | "unlock" | "agent" | "action" | "commit";
|
|
35
|
+
export type CiProductCommand = "plan" | "apply" | "lock" | "unlock" | "agent" | "action" | "commit" | "reject";
|
|
36
36
|
export declare const CI_PRODUCT_COMMANDS: readonly CiProductCommand[];
|
|
37
37
|
/**
|
|
38
38
|
* What an approval of a product's waves binds to (ruling B, 2026-10-27).
|
|
@@ -127,6 +127,13 @@ export interface CiProductWordsInput {
|
|
|
127
127
|
approve?: string;
|
|
128
128
|
/** The override line, the same kind of template, with `{rule}` and `{reason}` too. */
|
|
129
129
|
override?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The reject line (#5354), the same kind of template over `{op}`,
|
|
132
|
+
* `{gate}`, `{digest}`, `{reason}`, `{sign}` and `{target}`: what a
|
|
133
|
+
* reviewer runs to turn a release down at a stage's gate. A comment job
|
|
134
|
+
* answers with it where a comment cannot record the rejection itself.
|
|
135
|
+
*/
|
|
136
|
+
reject?: string;
|
|
130
137
|
/** The op the waves record under. Default: the spec's own. */
|
|
131
138
|
op?: string;
|
|
132
139
|
/** The wave gate pattern, over `{gate}` and `{k}`. Default `{gate}-wave-{k}`. */
|
|
@@ -198,6 +205,8 @@ export interface CiProductWords {
|
|
|
198
205
|
aliases: CiProductAlias[];
|
|
199
206
|
approve: string;
|
|
200
207
|
override: string;
|
|
208
|
+
/** The reject line (#5354). Filled by {@link resolveProductWords}; words built before it read chant's grammar under the product's name. */
|
|
209
|
+
reject?: string;
|
|
201
210
|
op?: string;
|
|
202
211
|
gateName: string;
|
|
203
212
|
prGate: string;
|
|
@@ -213,6 +222,8 @@ export interface CiProductWords {
|
|
|
213
222
|
export declare const CHANT_APPROVE_TEMPLATE = "chant approve {op} {gate} --plan {digest} --approver {approver} {sign}";
|
|
214
223
|
/** chant's own override line. */
|
|
215
224
|
export declare const CHANT_OVERRIDE_TEMPLATE = "chant approve {op} {target} --rule {rule} --reason \"<why>\" {sign}";
|
|
225
|
+
/** chant's own reject line (#5354). */
|
|
226
|
+
export declare const CHANT_REJECT_TEMPLATE = "chant reject {op} {gate} --plan {digest} --reason {reason} {sign}";
|
|
216
227
|
/** chant's words: what every slot defaults to. */
|
|
217
228
|
export declare const CHANT_WORDS: CiProductWords;
|
|
218
229
|
/** Fill every slot `input` leaves out with chant's word. */
|
|
@@ -294,6 +305,19 @@ export interface OverrideLineInput {
|
|
|
294
305
|
}
|
|
295
306
|
/** The command that overrides a policy denial: the product's template filled. */
|
|
296
307
|
export declare function overrideLine(words: CiProductWords, input: OverrideLineInput): string;
|
|
308
|
+
/** What {@link rejectLine} fills (#5354). */
|
|
309
|
+
export interface RejectLineInput {
|
|
310
|
+
op: string;
|
|
311
|
+
gate: string;
|
|
312
|
+
digest: string;
|
|
313
|
+
/** Default `<why>`, for the person to write. */
|
|
314
|
+
reason?: string;
|
|
315
|
+
/** Seal it: `--sign` fills `{sign}`. Default true. */
|
|
316
|
+
sign?: boolean;
|
|
317
|
+
target?: string;
|
|
318
|
+
}
|
|
319
|
+
/** The command a reviewer runs to reject a release at a gate (#5354): the product's reject template filled. */
|
|
320
|
+
export declare function rejectLine(words: CiProductWords, input: RejectLineInput): string;
|
|
297
321
|
/** The typed word for one of chant's commands: the first `commands` entry that maps onto it. */
|
|
298
322
|
export declare function commandWord(words: CiProductWords, command: CiProductCommand): string | undefined;
|
|
299
323
|
/** The comment a job answers: `/<product> <word>`, such as `/plywood up`. Undefined when the product has no word for the command. */
|
|
@@ -342,6 +366,16 @@ export type ParsedProductComment =
|
|
|
342
366
|
kind: "commit";
|
|
343
367
|
word: string;
|
|
344
368
|
arg?: string;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* A rejection of the release a stage waits on (#5354): `/<product>
|
|
372
|
+
* reject [--stage <stage>] <reason>`. The comment job records it when the
|
|
373
|
+
* stage's approval mode takes the comment author's forge identity.
|
|
374
|
+
*/
|
|
375
|
+
| {
|
|
376
|
+
kind: "reject";
|
|
377
|
+
stage?: string;
|
|
378
|
+
reason: string;
|
|
345
379
|
} | {
|
|
346
380
|
kind: "refused";
|
|
347
381
|
reason: string;
|
|
@@ -418,3 +452,119 @@ export type ProductActionRequest = {
|
|
|
418
452
|
* {@link PRODUCT_ACTION_EVENT_FLAG}.
|
|
419
453
|
*/
|
|
420
454
|
export declare function productActionFromEnv(words: CiProductWords, env: Record<string, string | undefined>): ProductActionRequest;
|
|
455
|
+
/** How a product spells a key: snake_case (YAML) or camelCase (TypeScript). */
|
|
456
|
+
export type ProductConfigCase = "snake" | "camel";
|
|
457
|
+
/** The page section a word sits in. `stage` holds the words for stages and releases. */
|
|
458
|
+
export type ProductConfigSection = "environments" | "stage" | "apply" | "approval" | "respond" | "reports" | "identity" | "secrets" | "notify" | "agents" | "jobs";
|
|
459
|
+
/**
|
|
460
|
+
* The shape an alias's value has when it reads as the vocabulary key. A key
|
|
461
|
+
* that one product uses with another meaning is an alias only in that shape.
|
|
462
|
+
*/
|
|
463
|
+
export type ProductConfigAliasShape = "string" | "map" | "list-or-map" | "storage-url" | "forge-environments";
|
|
464
|
+
/** A spelling one product accepts in place of the vocabulary's. */
|
|
465
|
+
export interface ProductConfigAlias {
|
|
466
|
+
/** The product that accepts it. */
|
|
467
|
+
product: string;
|
|
468
|
+
/** The key it accepts, in the same notation as {@link ProductConfigWord.key}. Absent for a value alias. */
|
|
469
|
+
key?: string;
|
|
470
|
+
/** A value word it accepts: `[alias, word]`. */
|
|
471
|
+
value?: readonly [string, string];
|
|
472
|
+
/** The alias reads as the key only when its value has this shape. */
|
|
473
|
+
shape?: ProductConfigAliasShape;
|
|
474
|
+
}
|
|
475
|
+
/** One concept of product config: its key, its value words, and the chant field it maps to. */
|
|
476
|
+
export interface ProductConfigWord {
|
|
477
|
+
key: string;
|
|
478
|
+
/** What the key sets, in a few words. */
|
|
479
|
+
concept: string;
|
|
480
|
+
section: ProductConfigSection;
|
|
481
|
+
/** The value words, when the value is one word from a list (or a list of them). */
|
|
482
|
+
values?: readonly string[];
|
|
483
|
+
/** A pattern a string value matches, when the value is not a word from a list. */
|
|
484
|
+
pattern?: string;
|
|
485
|
+
/** What the value is, for the page, when `values` does not say. */
|
|
486
|
+
value?: string;
|
|
487
|
+
/** The chant field, type or command the product maps the key onto. */
|
|
488
|
+
chant: string;
|
|
489
|
+
/** Other places the same word is set, such as a per-environment copy. */
|
|
490
|
+
also?: readonly string[];
|
|
491
|
+
/** The products that set the key with this spelling today. */
|
|
492
|
+
products: readonly string[];
|
|
493
|
+
aliases?: readonly ProductConfigAlias[];
|
|
494
|
+
}
|
|
495
|
+
/** The CI products this vocabulary was settled across. */
|
|
496
|
+
export declare const CI_PRODUCTS: readonly string[];
|
|
497
|
+
/** The vocabulary, in page order. */
|
|
498
|
+
export declare const PRODUCT_CONFIG_WORDS: readonly ProductConfigWord[];
|
|
499
|
+
/** The words for a release through the environments: the subcommands and flags a product's bin passes to `chant components`. */
|
|
500
|
+
export declare const PRODUCT_RELEASE_WORDS: Readonly<{
|
|
501
|
+
/** `<product> promote --to <env> [--release <label>]`: `chant components promote`. */
|
|
502
|
+
readonly promote: "promote";
|
|
503
|
+
/** `<product> reject <op> <gate> --plan <digest> --reason <text>`: `chant reject` (#5354), the release turned down at a stage's gate. */
|
|
504
|
+
readonly reject: "reject";
|
|
505
|
+
/** Why a release is rejected, on one line (#5354), and why a pause, a resume or an urgent promote was made (#5355). */
|
|
506
|
+
readonly reason: "--reason";
|
|
507
|
+
/** `<product> rollback <env> --release <label>`: `chant components rollback`, the environment positional. */
|
|
508
|
+
readonly rollback: "rollback";
|
|
509
|
+
/** `<product> redeploy <env>`: `chant components redeploy`. */
|
|
510
|
+
readonly redeploy: "redeploy";
|
|
511
|
+
/** The environment a promote deploys to. */
|
|
512
|
+
readonly to: "--to";
|
|
513
|
+
/** The environment a promote reads from; default the step before `--to` in `promotion`. */
|
|
514
|
+
readonly from: "--from";
|
|
515
|
+
/** A release's label or digest. */
|
|
516
|
+
readonly release: "--release";
|
|
517
|
+
/** Lets a promote skip an environment of `promotion`. */
|
|
518
|
+
readonly allowSkip: "--allow-skip";
|
|
519
|
+
/** Prints the plan and changes nothing. */
|
|
520
|
+
readonly dryRun: "--dry-run";
|
|
521
|
+
/** `<product> pause <env> --reason <text>`: `chant stage pause` (#5355). */
|
|
522
|
+
readonly pause: "pause";
|
|
523
|
+
/** `<product> resume <env> --reason <text>`: `chant stage resume` (#5355). */
|
|
524
|
+
readonly resume: "resume";
|
|
525
|
+
/** Lets a promote pass the stage's gate on its urgent rule (#5355). */
|
|
526
|
+
readonly urgent: "--urgent";
|
|
527
|
+
}>;
|
|
528
|
+
/** Release command spellings a product accepts beside {@link PRODUCT_RELEASE_WORDS}: `rollback --env <env>` for the positional. */
|
|
529
|
+
export declare const PRODUCT_RELEASE_ALIASES: readonly {
|
|
530
|
+
product: string;
|
|
531
|
+
command: string;
|
|
532
|
+
alias: string;
|
|
533
|
+
word: string;
|
|
534
|
+
}[];
|
|
535
|
+
/**
|
|
536
|
+
* The kinds of an audit line, in the words a person reads: the event that
|
|
537
|
+
* happened, each with the spellings a product wrote for it. The gate ledger's
|
|
538
|
+
* entries (`GATE_AUDIT_KINDS`) are the first eight; `refused` and `recorded`
|
|
539
|
+
* hold a product's own records. The report store's audit line
|
|
540
|
+
* (`@intentius/chant/report-store`, #5336) takes its `kind` from here.
|
|
541
|
+
*/
|
|
542
|
+
export declare const PRODUCT_AUDIT_KINDS: Readonly<Record<string, readonly string[]>>;
|
|
543
|
+
/** One finding of {@link productConfigProblems}. */
|
|
544
|
+
export interface ProductConfigProblem {
|
|
545
|
+
level: "error" | "warning";
|
|
546
|
+
/** Where in the config, dotted, as the product spells it. */
|
|
547
|
+
path: string;
|
|
548
|
+
/** The vocabulary key the finding is about. */
|
|
549
|
+
key: string;
|
|
550
|
+
message: string;
|
|
551
|
+
}
|
|
552
|
+
export interface ProductConfigOptions {
|
|
553
|
+
/** The product whose aliases are accepted. */
|
|
554
|
+
product: string;
|
|
555
|
+
/** How the product spells keys. Default `snake`. */
|
|
556
|
+
case?: ProductConfigCase;
|
|
557
|
+
/** Maps the vocabulary's keys may also sit under, such as sql-yodeler's `ci`. The top level is always read. An alias whose key starts at a scope is read inside it too, to find the key set beside it. */
|
|
558
|
+
scopes?: readonly string[];
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Checks a product's config against the vocabulary: each alias the product
|
|
562
|
+
* accepts is a warning naming the vocabulary key, an alias set beside its key
|
|
563
|
+
* is an error, and a value outside a key's words or pattern is an error.
|
|
564
|
+
* Keys the vocabulary does not hold are the product's own and are not read.
|
|
565
|
+
* `promotion` is checked as a list of distinct environment names, each one a
|
|
566
|
+
* key of `environments` when the config has that map.
|
|
567
|
+
*/
|
|
568
|
+
export declare function productConfigProblems(config: unknown, options: ProductConfigOptions): ProductConfigProblem[];
|
|
569
|
+
/** The vocabulary's word for `key` (snake_case notation), or undefined. */
|
|
570
|
+
export declare function productConfigWord(key: string): ProductConfigWord | undefined;
|