@intentius/chant 0.124.108 → 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/release.js +4 -2
- 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/train-cut.js +5 -2
- package/dist/workspace/train-shell.d.ts +18 -0
- package/dist/workspace/train-shell.js +43 -0
- package/dist/workspace/trust/seal.d.ts +7 -0
- package/dist/workspace/trust/seal.js +9 -0
- package/package.json +5 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release artifacts (#5356): named values a stage publishes for the release
|
|
3
|
+
* it applied, which later stages and other repositories read.
|
|
4
|
+
*
|
|
5
|
+
* A stage often produces a value a later stage or another repository needs:
|
|
6
|
+
* a cluster endpoint, an image tag, a database host. A stage declares what
|
|
7
|
+
* it publishes under `publish`, each artifact by name:
|
|
8
|
+
*
|
|
9
|
+
* {
|
|
10
|
+
* name: "dev",
|
|
11
|
+
* waves: [...],
|
|
12
|
+
* publish: {
|
|
13
|
+
* endpoint: { member: "cluster", output: "endpoint" },
|
|
14
|
+
* db_password: { secret: { awsSecretsManager: "arn:aws:secretsmanager:...:secret:dev/db" } },
|
|
15
|
+
* },
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* - `{ member, output }` publishes the member's output as the stage left it
|
|
19
|
+
* once it applied: a string, or any JSON value. An output the engine marks
|
|
20
|
+
* sensitive or secret (a Terraform output with `sensitive = true`, a Pulumi
|
|
21
|
+
* secret) is refused, and nothing of that publish is recorded.
|
|
22
|
+
* - `{ secret }` publishes where a secret is kept, in the words of #5348's
|
|
23
|
+
* config and secret sets (a forge secret's name, an AWS Secrets Manager
|
|
24
|
+
* secret, a Google Secret Manager version or an Azure Key Vault secret).
|
|
25
|
+
* The reference is recorded and the secret itself is never read.
|
|
26
|
+
*
|
|
27
|
+
* Artifacts are values, never files: a value's JSON text is at most
|
|
28
|
+
* {@link STAGE_ARTIFACT_MAX_BYTES}.
|
|
29
|
+
*
|
|
30
|
+
* Each publish is one line of `<stage>/artifacts.jsonl` on `chant/lifecycle`
|
|
31
|
+
* ({@link STAGE_ARTIFACTS_FILE}), beside the stage's `releases.jsonl`: the
|
|
32
|
+
* pipeline, the stage, the release digest, its label, the commit, and every
|
|
33
|
+
* artifact the stage declares. The first stage publishes once its last wave
|
|
34
|
+
* applied and the merge cut its release (an after-apply hook after the cut,
|
|
35
|
+
* `./stages.ts`). A later stage publishes once `chant components promote
|
|
36
|
+
* --to <stage> --release <ref>` deployed.
|
|
37
|
+
*
|
|
38
|
+
* A later stage reads an upstream stage's artifact of the same release under
|
|
39
|
+
* `reads`, keyed by the variable name its deploy gets the value in:
|
|
40
|
+
*
|
|
41
|
+
* { name: "staging", waves: [...], reads: { TF_VAR_dev_endpoint: { stage: "dev", artifact: "endpoint" } } }
|
|
42
|
+
*
|
|
43
|
+
* `chant build` refuses a read of a stage that is not upstream of the reading
|
|
44
|
+
* stage (#5385): earlier in the list when no stage declares `after`, else an
|
|
45
|
+
* ancestor through `after`, so a sibling is refused. It also refuses a read of an artifact that stage does not publish
|
|
46
|
+
* ({@link stageArtifactsSpecProblems}). The promote refuses before anything
|
|
47
|
+
* deploys when the upstream has not published the artifact for the release
|
|
48
|
+
* being promoted ({@link resolveStageReads}). A string reaches the variable
|
|
49
|
+
* as it is, any other JSON value as its JSON text, and a secret as its
|
|
50
|
+
* reference's JSON.
|
|
51
|
+
*
|
|
52
|
+
* Another repository reads with {@link readStageArtifacts} (`chant pipeline
|
|
53
|
+
* artifacts read --stage <stage> --from <dir>`): the artifacts of the release
|
|
54
|
+
* the stage last published for, or of a named release. The `<product>-applied`
|
|
55
|
+
* dispatch carries the release digest when `control.release` is set
|
|
56
|
+
* (../control/dispatch.ts), and the read takes it from `CHANT_CONTROL_RELEASE`,
|
|
57
|
+
* so a downstream run pins to the release the member applied.
|
|
58
|
+
*
|
|
59
|
+
* Off by default: a stage with no `publish` publishes nothing, and its jobs
|
|
60
|
+
* render as before.
|
|
61
|
+
*
|
|
62
|
+
* This module imports types alone at load, and the ledger at call time.
|
|
63
|
+
*/
|
|
64
|
+
import { type EnvironmentSecretRef, type EnvironmentSecretSource } from "../components/environment-sets.js";
|
|
65
|
+
import type { PipelineSpec, PipelineStage } from "./spec.js";
|
|
66
|
+
/**
|
|
67
|
+
* The first chant with release artifacts (#5356): a stage's `publish` and
|
|
68
|
+
* `reads` in `.chant/pipeline.ts`, the build's refusal of a read no upstream
|
|
69
|
+
* publishes, the publish after the first stage's release cut and after a
|
|
70
|
+
* promote under a release, `chant pipeline artifacts publish|read`, `chant
|
|
71
|
+
* pipeline release-of`, and `control.release` on the `<product>-applied`
|
|
72
|
+
* dispatch. A product feature-detects release artifacts on this name.
|
|
73
|
+
*/
|
|
74
|
+
export declare const STAGE_ARTIFACTS_FLOOR = "0.124.110";
|
|
75
|
+
/** The ledger file a stage's publishes are kept in, beside its `releases.jsonl`. */
|
|
76
|
+
export declare const STAGE_ARTIFACTS_FILE = "artifacts.jsonl";
|
|
77
|
+
/** The record kind a line of {@link STAGE_ARTIFACTS_FILE} carries. A reader skips any other. */
|
|
78
|
+
export declare const STAGE_ARTIFACTS_KIND = "stage-artifacts";
|
|
79
|
+
/** The largest JSON text one artifact's value may have, in bytes. An artifact is a value, never a file. */
|
|
80
|
+
export declare const STAGE_ARTIFACT_MAX_BYTES = 65536;
|
|
81
|
+
/** The variable a read takes its release from when none is named: the one the `<product>-applied` dispatch carries. */
|
|
82
|
+
export declare const STAGE_ARTIFACTS_RELEASE_ENV = "CHANT_CONTROL_RELEASE";
|
|
83
|
+
/** What a stage publishes under one name. */
|
|
84
|
+
export type StageArtifactSource =
|
|
85
|
+
/** A member's output, as the stage left it once it applied. Refused when the engine marks it sensitive. */
|
|
86
|
+
{
|
|
87
|
+
member: string;
|
|
88
|
+
output: string;
|
|
89
|
+
}
|
|
90
|
+
/** Where a secret is kept (#5348's words). The reference is published, never the secret. */
|
|
91
|
+
| {
|
|
92
|
+
secret: EnvironmentSecretRef;
|
|
93
|
+
};
|
|
94
|
+
/** One artifact of an upstream stage that a stage reads. */
|
|
95
|
+
export interface StageArtifactRead {
|
|
96
|
+
/** The upstream stage: one before the reading stage in promotion order. */
|
|
97
|
+
stage: string;
|
|
98
|
+
/** The artifact's name in that stage's `publish`. */
|
|
99
|
+
artifact: string;
|
|
100
|
+
}
|
|
101
|
+
/** A JSON value. */
|
|
102
|
+
export type StageArtifactValue = string | number | boolean | null | StageArtifactValue[] | {
|
|
103
|
+
[key: string]: StageArtifactValue;
|
|
104
|
+
};
|
|
105
|
+
/** One published artifact, as the ledger holds it. */
|
|
106
|
+
export type StageArtifactEntry = {
|
|
107
|
+
kind: "value";
|
|
108
|
+
value: StageArtifactValue;
|
|
109
|
+
member: string;
|
|
110
|
+
output: string;
|
|
111
|
+
} | {
|
|
112
|
+
kind: "secret";
|
|
113
|
+
source: EnvironmentSecretSource;
|
|
114
|
+
};
|
|
115
|
+
/** One line of `<stage>/artifacts.jsonl`: every artifact a stage published for one release. */
|
|
116
|
+
export interface StageArtifactRecord {
|
|
117
|
+
version: 1;
|
|
118
|
+
kind: typeof STAGE_ARTIFACTS_KIND;
|
|
119
|
+
pipeline: string;
|
|
120
|
+
stage: string;
|
|
121
|
+
/** The release digest the stage applied. */
|
|
122
|
+
release: string;
|
|
123
|
+
/** The release's label, when its cut named one. */
|
|
124
|
+
label?: string;
|
|
125
|
+
/** The commit the release was cut from. */
|
|
126
|
+
gitSha?: string;
|
|
127
|
+
at: string;
|
|
128
|
+
/** By artifact name. */
|
|
129
|
+
artifacts: Record<string, StageArtifactEntry>;
|
|
130
|
+
}
|
|
131
|
+
/** Where a stage's artifact records are read and written. */
|
|
132
|
+
export interface StageArtifactPort {
|
|
133
|
+
read(stage: string): Promise<StageArtifactRecord[]>;
|
|
134
|
+
append(stage: string, record: StageArtifactRecord): Promise<void>;
|
|
135
|
+
}
|
|
136
|
+
/** What is wrong with a stage's `publish`, one line each. */
|
|
137
|
+
export declare function stagePublishProblems(publish: unknown, at: string): string[];
|
|
138
|
+
/** What is wrong with a stage's `reads` on its own, one line each. Whether an upstream publishes each is {@link stageArtifactsSpecProblems}'s. */
|
|
139
|
+
export declare function stageReadsProblems(reads: unknown, at: string): string[];
|
|
140
|
+
/**
|
|
141
|
+
* The indexes of every stage upstream of stage `index`, through `after`
|
|
142
|
+
* (#5353): a stage follows its `after`, else the stage before it. Mirrors
|
|
143
|
+
* `stageUpstreams` in ./spec, which this module cannot import at load. A
|
|
144
|
+
* cycle or an unknown name ends that path.
|
|
145
|
+
*/
|
|
146
|
+
export declare function ancestorsOf(stages: Array<Partial<PipelineStage>>, index: number): Set<number>;
|
|
147
|
+
/**
|
|
148
|
+
* The reads no upstream publishes (#5356), one line each: a read of a stage
|
|
149
|
+
* that is not before the reading stage in promotion order, or of an
|
|
150
|
+
* artifact that stage's `publish` does not name, and a first stage that
|
|
151
|
+
* publishes while the merge cuts no release. `chant build` refuses each.
|
|
152
|
+
*/
|
|
153
|
+
export declare function stageArtifactsSpecProblems(spec: {
|
|
154
|
+
stages?: unknown;
|
|
155
|
+
release?: unknown;
|
|
156
|
+
}): string[];
|
|
157
|
+
/** The records in a ledger file's text, oldest first, malformed lines left out. */
|
|
158
|
+
export declare function parseStageArtifactRecords(text: string): StageArtifactRecord[];
|
|
159
|
+
/**
|
|
160
|
+
* {@link StageArtifactPort} on `chant/lifecycle`, at `<stage>/artifacts.jsonl`.
|
|
161
|
+
* `cwd` may be a checkout of another repository, or a directory holding its
|
|
162
|
+
* `chant/lifecycle` alone; `member` or `ledgerPrefix` names a workspace
|
|
163
|
+
* member's records there.
|
|
164
|
+
*/
|
|
165
|
+
export declare function gitStageArtifactPort(opts?: {
|
|
166
|
+
cwd?: string;
|
|
167
|
+
member?: string;
|
|
168
|
+
ledgerPrefix?: string;
|
|
169
|
+
}): StageArtifactPort;
|
|
170
|
+
/** A member's outputs after the stage applied, and the names its engine marks sensitive or secret. */
|
|
171
|
+
export interface MemberOutputs {
|
|
172
|
+
outputs: Record<string, unknown>;
|
|
173
|
+
sensitive: readonly string[];
|
|
174
|
+
}
|
|
175
|
+
/** What {@link publishStageArtifacts} takes. */
|
|
176
|
+
export interface PublishStageArtifactsInput {
|
|
177
|
+
spec: Pick<PipelineSpec, "name" | "stages">;
|
|
178
|
+
stage: string;
|
|
179
|
+
release: {
|
|
180
|
+
digest: string;
|
|
181
|
+
label?: string | null;
|
|
182
|
+
gitSha?: string;
|
|
183
|
+
};
|
|
184
|
+
/** A member's outputs as its steps read them now, or undefined when its steps say none. */
|
|
185
|
+
outputsOf: (member: string) => Promise<MemberOutputs | undefined>;
|
|
186
|
+
port: StageArtifactPort;
|
|
187
|
+
/** Check and answer the record; write nothing. */
|
|
188
|
+
dryRun?: boolean;
|
|
189
|
+
now?: () => string;
|
|
190
|
+
}
|
|
191
|
+
/** What a publish did. `refused` lists why nothing was recorded; a refusal never quotes an output's value. */
|
|
192
|
+
export type PublishStageArtifactsResult = {
|
|
193
|
+
status: "none";
|
|
194
|
+
stage: string;
|
|
195
|
+
} | {
|
|
196
|
+
status: "published";
|
|
197
|
+
record: StageArtifactRecord;
|
|
198
|
+
dryRun?: true;
|
|
199
|
+
} | {
|
|
200
|
+
status: "refused";
|
|
201
|
+
stage: string;
|
|
202
|
+
problems: string[];
|
|
203
|
+
};
|
|
204
|
+
/**
|
|
205
|
+
* Publish the artifacts `stage` declares for `release` (#5356): every one or
|
|
206
|
+
* none. A member output the engine marks sensitive is refused, by name; a
|
|
207
|
+
* secret is recorded as where it is kept. The record holds no value the
|
|
208
|
+
* engine marks sensitive and no secret, and neither does a refusal.
|
|
209
|
+
*/
|
|
210
|
+
export declare function publishStageArtifacts(input: PublishStageArtifactsInput): Promise<PublishStageArtifactsResult>;
|
|
211
|
+
/**
|
|
212
|
+
* The artifacts `stage` published (#5356): for `release` when named (a
|
|
213
|
+
* digest), else for the release it last published for. The latest record
|
|
214
|
+
* wins when a release was published twice. Undefined when there is none.
|
|
215
|
+
*/
|
|
216
|
+
export declare function readStageArtifacts(port: StageArtifactPort, query: {
|
|
217
|
+
stage: string;
|
|
218
|
+
release?: string;
|
|
219
|
+
}): Promise<StageArtifactRecord | undefined>;
|
|
220
|
+
/** The text a variable holds for an artifact: a string as it is, any other value as JSON, a secret as its reference's JSON. */
|
|
221
|
+
export declare function stageArtifactText(entry: StageArtifactEntry): string;
|
|
222
|
+
/** One read a stage's deploy gets. */
|
|
223
|
+
export interface ResolvedStageRead extends StageArtifactRead {
|
|
224
|
+
/** The variable it is in. */
|
|
225
|
+
variable: string;
|
|
226
|
+
kind: StageArtifactEntry["kind"];
|
|
227
|
+
}
|
|
228
|
+
/** What {@link resolveStageReads} found. */
|
|
229
|
+
export type StageReadsResult = {
|
|
230
|
+
status: "resolved";
|
|
231
|
+
variables: Record<string, string>;
|
|
232
|
+
reads: ResolvedStageRead[];
|
|
233
|
+
} | {
|
|
234
|
+
status: "refused";
|
|
235
|
+
problems: string[];
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* The variables `stage`'s reads hold for `release` (#5356), each from the
|
|
239
|
+
* upstream stage's record of that same release. Refused, naming each, when
|
|
240
|
+
* an upstream has not published the artifact for this release, or when the
|
|
241
|
+
* stage reads and no release is named. Empty when the stage reads nothing.
|
|
242
|
+
*/
|
|
243
|
+
export declare function resolveStageReads(spec: Pick<PipelineSpec, "stages">, stage: string, release: string | undefined, port: StageArtifactPort): Promise<StageReadsResult>;
|
|
244
|
+
/**
|
|
245
|
+
* The note a publish or a read prints (Markdown): each artifact, a value as
|
|
246
|
+
* JSON, a secret as where it is kept. Holds no secret: a secret artifact's
|
|
247
|
+
* record never holds one.
|
|
248
|
+
*/
|
|
249
|
+
export declare function stageArtifactsNote(record: StageArtifactRecord): string;
|
|
250
|
+
/**
|
|
251
|
+
* The release cut from `commit` (#5356): the newest cut whose release names
|
|
252
|
+
* that commit, with its label. Undefined when none was cut from it.
|
|
253
|
+
*/
|
|
254
|
+
export declare function releaseCutFrom(commit: string, opts?: {
|
|
255
|
+
cwd?: string;
|
|
256
|
+
member?: string;
|
|
257
|
+
ledgerPrefix?: string;
|
|
258
|
+
}): Promise<{
|
|
259
|
+
digest: string;
|
|
260
|
+
label: string | null;
|
|
261
|
+
commit: string;
|
|
262
|
+
} | undefined>;
|
|
263
|
+
/** The variables of {@link resolveStageReads} set in `env` for the length of `run`, then put back as they were. */
|
|
264
|
+
export declare function withStageReadVariables<T>(variables: Record<string, string>, run: () => Promise<T>, env?: NodeJS.ProcessEnv): Promise<T>;
|