@intentius/chant 0.124.51 → 0.124.54
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/audit/discover.d.ts.map +1 -1
- package/dist/audit/discover.js +3 -1
- package/dist/behaviour.d.ts +1 -1
- package/dist/behaviour.d.ts.map +1 -1
- package/dist/capabilities/templates.d.ts +65 -0
- package/dist/capabilities/templates.d.ts.map +1 -0
- package/dist/capabilities/templates.js +193 -0
- package/dist/capabilities/templates.json +145 -0
- package/dist/change-set-graph.d.ts +35 -3
- package/dist/change-set-graph.d.ts.map +1 -1
- package/dist/change-set-graph.js +60 -9
- package/dist/change-set.d.ts +65 -7
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +23 -12
- package/dist/ci-identity.d.ts +7 -2
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +4 -1
- package/dist/cli/commands/import-index.d.ts +52 -0
- package/dist/cli/commands/import-index.d.ts.map +1 -0
- package/dist/cli/commands/import-index.js +226 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +4 -2
- package/dist/cli/handlers/components.d.ts.map +1 -1
- package/dist/cli/handlers/components.js +11 -2
- package/dist/cli/handlers/fan-out.d.ts.map +1 -1
- package/dist/cli/handlers/fan-out.js +16 -3
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +22 -4
- package/dist/cli/handlers/index-cloud.d.ts +14 -0
- package/dist/cli/handlers/index-cloud.d.ts.map +1 -0
- package/dist/cli/handlers/index-cloud.js +22 -0
- package/dist/cli/handlers/index-diff.d.ts +18 -0
- package/dist/cli/handlers/index-diff.d.ts.map +1 -0
- package/dist/cli/handlers/index-diff.js +142 -0
- package/dist/cli/handlers/lifecycle-drift.d.ts +25 -0
- package/dist/cli/handlers/lifecycle-drift.d.ts.map +1 -0
- package/dist/cli/handlers/lifecycle-drift.js +64 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +188 -28
- package/dist/cli/handlers/misc.d.ts +9 -0
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/misc.js +77 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +17 -3
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +89 -15
- package/dist/cli/handlers/query.d.ts.map +1 -1
- package/dist/cli/handlers/query.js +28 -4
- package/dist/cli/handlers/scenario.d.ts.map +1 -1
- package/dist/cli/handlers/scenario.js +8 -7
- package/dist/cli/handlers/search.d.ts +34 -4
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/handlers/search.js +216 -36
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +55 -1
- package/dist/cli/mcp/lifecycle-tools.d.ts.map +1 -1
- package/dist/cli/mcp/lifecycle-tools.js +3 -2
- package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
- package/dist/cli/mcp/resource-handlers.js +4 -3
- package/dist/cli/mcp/workspace-tools.js +1 -1
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +55 -2
- package/dist/cli/registry.d.ts +19 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cloud-lister/aws.d.ts +35 -0
- package/dist/cloud-lister/aws.d.ts.map +1 -0
- package/dist/cloud-lister/aws.js +203 -0
- package/dist/cloud-lister/azure.d.ts +34 -0
- package/dist/cloud-lister/azure.d.ts.map +1 -0
- package/dist/cloud-lister/azure.js +129 -0
- package/dist/cloud-lister/common.d.ts +40 -0
- package/dist/cloud-lister/common.d.ts.map +1 -0
- package/dist/cloud-lister/common.js +83 -0
- package/dist/cloud-lister/credentials.d.ts +50 -0
- package/dist/cloud-lister/credentials.d.ts.map +1 -0
- package/dist/cloud-lister/credentials.js +86 -0
- package/dist/cloud-lister/fakes.d.ts +27 -0
- package/dist/cloud-lister/fakes.d.ts.map +1 -0
- package/dist/cloud-lister/fakes.js +50 -0
- package/dist/cloud-lister/gcp.d.ts +42 -0
- package/dist/cloud-lister/gcp.d.ts.map +1 -0
- package/dist/cloud-lister/gcp.js +143 -0
- package/dist/cloud-lister/guard.d.ts +49 -0
- package/dist/cloud-lister/guard.d.ts.map +1 -0
- package/dist/cloud-lister/guard.js +103 -0
- package/dist/cloud-lister/ids.d.ts +23 -0
- package/dist/cloud-lister/ids.d.ts.map +1 -0
- package/dist/cloud-lister/ids.js +42 -0
- package/dist/cloud-lister/index.d.ts +67 -0
- package/dist/cloud-lister/index.d.ts.map +1 -0
- package/dist/cloud-lister/index.js +102 -0
- package/dist/cloud-lister/kubernetes.d.ts +64 -0
- package/dist/cloud-lister/kubernetes.d.ts.map +1 -0
- package/dist/cloud-lister/kubernetes.js +276 -0
- package/dist/cloud-lister/markers.d.ts +31 -0
- package/dist/cloud-lister/markers.d.ts.map +1 -0
- package/dist/cloud-lister/markers.js +73 -0
- package/dist/cloud-lister/mask.d.ts +31 -0
- package/dist/cloud-lister/mask.d.ts.map +1 -0
- package/dist/cloud-lister/mask.js +74 -0
- package/dist/cloud-lister/sigv4.d.ts +29 -0
- package/dist/cloud-lister/sigv4.d.ts.map +1 -0
- package/dist/cloud-lister/sigv4.js +54 -0
- package/dist/cloud-lister/transport.d.ts +55 -0
- package/dist/cloud-lister/transport.d.ts.map +1 -0
- package/dist/cloud-lister/transport.js +86 -0
- package/dist/cloud-lister/types.d.ts +121 -0
- package/dist/cloud-lister/types.d.ts.map +1 -0
- package/dist/cloud-lister/types.js +24 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.js +6 -0
- package/dist/components/capability-plugin.d.ts +9 -0
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/capability.d.ts +224 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +21 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +58 -14
- package/dist/components/covered-round.d.ts +173 -0
- package/dist/components/covered-round.d.ts.map +1 -0
- package/dist/components/covered-round.js +200 -0
- package/dist/components/declared-reads.d.ts +38 -0
- package/dist/components/declared-reads.d.ts.map +1 -0
- package/dist/components/declared-reads.js +131 -0
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/components/deploy-units.js +4 -0
- package/dist/components/driver.d.ts +42 -1
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +74 -3
- package/dist/components/fan-out-run.d.ts +23 -1
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +82 -14
- package/dist/components/fan-out-support.d.ts +6 -0
- package/dist/components/fan-out-support.d.ts.map +1 -1
- package/dist/components/fan-out-support.js +4 -1
- package/dist/components/fan-out.d.ts +28 -0
- package/dist/components/fan-out.d.ts.map +1 -1
- package/dist/components/groups.d.ts +229 -0
- package/dist/components/groups.d.ts.map +1 -0
- package/dist/components/groups.js +760 -0
- package/dist/components/index.d.ts +7 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -0
- package/dist/components/plan-shape-conformance.d.ts +48 -0
- package/dist/components/plan-shape-conformance.d.ts.map +1 -0
- package/dist/components/plan-shape-conformance.js +122 -0
- package/dist/components/pr-run.d.ts +62 -7
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +354 -53
- package/dist/components/promote-rounds.d.ts +9 -0
- package/dist/components/promote-rounds.d.ts.map +1 -1
- package/dist/components/promote-rounds.js +23 -2
- package/dist/components/promote.d.ts +17 -0
- package/dist/components/promote.d.ts.map +1 -1
- package/dist/components/promote.js +36 -6
- package/dist/components/release-gate.d.ts +23 -1
- package/dist/components/release-gate.d.ts.map +1 -1
- package/dist/components/release-gate.js +97 -33
- package/dist/components/run-groups.d.ts +58 -0
- package/dist/components/run-groups.d.ts.map +1 -0
- package/dist/components/run-groups.js +78 -0
- package/dist/components/starter-plugin.d.ts +1 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/starter-plugin.js +6 -1
- package/dist/components/verbs/index.d.ts +1 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/index.js +1 -0
- package/dist/components/verbs/member-outputs.d.ts +187 -0
- package/dist/components/verbs/member-outputs.d.ts.map +1 -0
- package/dist/components/verbs/member-outputs.js +218 -0
- package/dist/components/wave-plan.d.ts +2 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +4 -1
- package/dist/config.d.ts +60 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +27 -0
- package/dist/deep-observation.d.ts +1 -13
- package/dist/deep-observation.d.ts.map +1 -1
- package/dist/deep-observation.js +5 -22
- package/dist/drift-record.d.ts +542 -0
- package/dist/drift-record.d.ts.map +1 -0
- package/dist/drift-record.js +886 -0
- package/dist/engine-facts.d.ts +144 -0
- package/dist/engine-facts.d.ts.map +1 -0
- package/dist/engine-facts.js +14 -0
- package/dist/graph-ir.d.ts +153 -2
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-ir.js +224 -6
- package/dist/graph-refs.d.ts +145 -0
- package/dist/graph-refs.d.ts.map +1 -1
- package/dist/graph-refs.js +305 -0
- package/dist/graph-schema/fixtures/adopt.json +15 -0
- package/dist/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/dist/graph-schema/fixtures/index.json +68 -0
- package/dist/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/dist/graph-schema/fixtures.d.ts +23 -0
- package/dist/graph-schema/fixtures.d.ts.map +1 -0
- package/dist/graph-schema/fixtures.js +246 -0
- package/dist/graph-schema/generate.d.ts +15 -0
- package/dist/graph-schema/generate.d.ts.map +1 -0
- package/dist/graph-schema/generate.js +267 -0
- package/dist/graph-schema/graph.schema.json +1387 -0
- package/dist/health.schema.json +2 -1
- package/dist/identity.d.ts.map +1 -1
- package/dist/identity.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/instance-nodes.d.ts +159 -0
- package/dist/instance-nodes.d.ts.map +1 -0
- package/dist/instance-nodes.js +231 -0
- package/dist/lexicon.d.ts +72 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/adoption-file.d.ts +56 -0
- package/dist/lifecycle/adoption-file.d.ts.map +1 -0
- package/dist/lifecycle/adoption-file.js +123 -0
- package/dist/lifecycle/cloud-index.d.ts +186 -0
- package/dist/lifecycle/cloud-index.d.ts.map +1 -0
- package/dist/lifecycle/cloud-index.js +618 -0
- package/dist/lifecycle/derive-edges.d.ts +59 -0
- package/dist/lifecycle/derive-edges.d.ts.map +1 -0
- package/dist/lifecycle/derive-edges.js +126 -0
- package/dist/lifecycle/git.d.ts +10 -9
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +7 -1
- package/dist/lifecycle/identity-match.d.ts +133 -0
- package/dist/lifecycle/identity-match.d.ts.map +1 -0
- package/dist/lifecycle/identity-match.js +147 -0
- package/dist/lifecycle/index-diff.d.ts +224 -0
- package/dist/lifecycle/index-diff.d.ts.map +1 -0
- package/dist/lifecycle/index-diff.js +327 -0
- package/dist/lifecycle/index-document.d.ts +130 -0
- package/dist/lifecycle/index-document.d.ts.map +1 -0
- package/dist/lifecycle/index-document.js +189 -0
- package/dist/lifecycle/index-drift.d.ts +121 -0
- package/dist/lifecycle/index-drift.d.ts.map +1 -0
- package/dist/lifecycle/index-drift.js +178 -0
- package/dist/lifecycle/index-import.d.ts +168 -0
- package/dist/lifecycle/index-import.d.ts.map +1 -0
- package/dist/lifecycle/index-import.js +515 -0
- package/dist/lifecycle/index-join.d.ts +129 -0
- package/dist/lifecycle/index-join.d.ts.map +1 -0
- package/dist/lifecycle/index-join.js +248 -0
- package/dist/lifecycle/index.d.ts +4 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/observation-baseline.d.ts +61 -21
- package/dist/lifecycle/observation-baseline.d.ts.map +1 -1
- package/dist/lifecycle/observation-baseline.js +144 -19
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/observe.js +6 -1
- package/dist/lifecycle/query.d.ts +45 -4
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +89 -7
- package/dist/lifecycle/replay.d.ts +10 -3
- package/dist/lifecycle/replay.d.ts.map +1 -1
- package/dist/lifecycle/replay.js +10 -6
- package/dist/lifecycle/scenario.d.ts +4 -3
- package/dist/lifecycle/scenario.d.ts.map +1 -1
- package/dist/lifecycle/snapshot-store-fake.d.ts +9 -0
- package/dist/lifecycle/snapshot-store-fake.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-fake.js +21 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts +102 -0
- package/dist/lifecycle/snapshot-store-s3.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store-s3.js +254 -0
- package/dist/lifecycle/snapshot-store.d.ts +170 -0
- package/dist/lifecycle/snapshot-store.d.ts.map +1 -0
- package/dist/lifecycle/snapshot-store.js +832 -0
- package/dist/lifecycle/snapshot.d.ts +11 -0
- package/dist/lifecycle/snapshot.d.ts.map +1 -1
- package/dist/lifecycle/snapshot.js +18 -5
- package/dist/lifecycle/type-listing.d.ts +148 -0
- package/dist/lifecycle/type-listing.d.ts.map +1 -0
- package/dist/lifecycle/type-listing.js +166 -0
- package/dist/lint/component-checks.d.ts +15 -1
- package/dist/lint/component-checks.d.ts.map +1 -1
- package/dist/lint/component-checks.js +1 -0
- package/dist/lint/presets/relaxed.json +2 -1
- package/dist/lint/presets/strict.json +2 -1
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/fail/dns.component.js +13 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts +4 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.d.ts.map +1 -0
- package/dist/lint/rules/__fixtures__/comp/comp008/pass/dns.component.js +8 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts +33 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.d.ts.map +1 -0
- package/dist/lint/rules/comp/comp008-applies-signal-only-root.js +123 -0
- package/dist/lint/rules/comp/index.d.ts +2 -1
- package/dist/lint/rules/comp/index.d.ts.map +1 -1
- package/dist/lint/rules/comp/index.js +4 -1
- package/dist/observation.d.ts +19 -2
- package/dist/observation.d.ts.map +1 -1
- package/dist/observation.js +18 -1
- package/dist/op/activities/activity-contracts.d.ts +1 -1
- package/dist/op/activities/activity-contracts.js +1 -1
- package/dist/op/activities/change-set.d.ts +6 -4
- package/dist/op/activities/change-set.d.ts.map +1 -1
- package/dist/op/activities/change-set.js +4 -2
- package/dist/op/activity-failure.d.ts +27 -0
- package/dist/op/activity-failure.d.ts.map +1 -1
- package/dist/op/activity-failure.js +31 -0
- package/dist/op/index.d.ts +2 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/local-executor.d.ts +5 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +22 -8
- package/dist/pr-loop.d.ts +92 -3
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +62 -3
- package/dist/pulumi-urn.d.ts +101 -0
- package/dist/pulumi-urn.d.ts.map +1 -0
- package/dist/pulumi-urn.js +131 -0
- package/dist/release-floors.d.ts +23 -0
- package/dist/release-floors.d.ts.map +1 -0
- package/dist/release-floors.js +22 -0
- package/dist/sensitive-key.d.ts +23 -0
- package/dist/sensitive-key.d.ts.map +1 -0
- package/dist/sensitive-key.js +31 -0
- package/dist/wave-runtime.mjs +234 -234
- package/dist/workspace/adoption-report.d.ts +53 -0
- package/dist/workspace/adoption-report.d.ts.map +1 -0
- package/dist/workspace/adoption-report.js +76 -0
- package/dist/workspace/capabilities-contract.d.ts +7 -0
- package/dist/workspace/capabilities-contract.d.ts.map +1 -1
- package/dist/workspace/capabilities-contract.js +2 -1
- package/dist/workspace/capabilities.schema.json +98 -0
- package/dist/workspace/change-set.schema.json +42 -3
- package/dist/workspace/ci-cloud-identity.d.ts +13 -1
- package/dist/workspace/ci-cloud-identity.d.ts.map +1 -1
- package/dist/workspace/ci-cloud-identity.js +30 -1
- package/dist/workspace/compose-graph.d.ts +10 -1
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/compose-graph.js +6 -1
- package/dist/workspace/conformance/index.d.ts +1 -1
- package/dist/workspace/conformance/index.d.ts.map +1 -1
- package/dist/workspace/conformance/index.js +6 -1
- package/dist/workspace/drift-cli.d.ts +81 -0
- package/dist/workspace/drift-cli.d.ts.map +1 -0
- package/dist/workspace/drift-cli.js +317 -0
- package/dist/workspace/drift.schema.json +672 -0
- package/dist/workspace/graph-cli.d.ts +2 -0
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +3 -0
- package/dist/workspace/graph.schema.json +72 -0
- package/dist/workspace/init.d.ts +5 -1
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/init.js +55 -9
- package/dist/workspace/ledger.schema.json +1 -1
- package/dist/workspace/nested-graph.d.ts.map +1 -1
- package/dist/workspace/nested-graph.js +2 -0
- package/dist/workspace/pr-report.schema.json +76 -3
- package/dist/workspace/promote-waves.d.ts +112 -0
- package/dist/workspace/promote-waves.d.ts.map +1 -0
- package/dist/workspace/promote-waves.js +290 -0
- package/dist/workspace/promote.d.ts +84 -2
- package/dist/workspace/promote.d.ts.map +1 -1
- package/dist/workspace/promote.js +347 -61
- package/dist/workspace/reason-codes.d.ts +12 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +14 -0
- package/dist/workspace/search-contract.d.ts +3 -3
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/search-contract.js +2 -0
- package/dist/workspace/search.schema.json +103 -5
- package/package.json +14 -1
- package/src/__fixtures__/drift-record/README.md +58 -0
- package/src/__fixtures__/drift-record/choudoufu-cone.ndjson +4 -0
- package/src/__fixtures__/drift-record/choudoufu-resource.ndjson +3 -0
- package/src/__fixtures__/drift-record/component-status-ledger.json +65 -0
- package/src/__fixtures__/drift-record/component-status.json +91 -0
- package/src/__fixtures__/drift-record/deep-diff.json +259 -0
- package/src/__fixtures__/drift-record/lifecycle-diff-live.json +825 -0
- package/src/__fixtures__/drift-record/live-diff.json +125 -0
- package/src/audit/discover.e2e.test.ts +14 -0
- package/src/audit/discover.ts +3 -1
- package/src/behaviour.ts +1 -1
- package/src/capabilities/templates.json +145 -0
- package/src/capabilities/templates.test.ts +212 -0
- package/src/capabilities/templates.ts +204 -0
- package/src/change-set-bundle.test.ts +83 -0
- package/src/change-set-graph.ts +80 -9
- package/src/change-set.test.ts +24 -0
- package/src/change-set.ts +77 -14
- package/src/ci-identity-targets.test.ts +23 -0
- package/src/ci-identity.ts +10 -4
- package/src/cli/commands/import-index.test.ts +117 -0
- package/src/cli/commands/import-index.ts +265 -0
- package/src/cli/commands/lint.ts +4 -2
- package/src/cli/handlers/components.test.ts +9 -0
- package/src/cli/handlers/components.ts +12 -2
- package/src/cli/handlers/fan-out.ts +17 -3
- package/src/cli/handlers/graph.test.ts +42 -0
- package/src/cli/handlers/graph.ts +26 -4
- package/src/cli/handlers/index-cloud.ts +32 -0
- package/src/cli/handlers/index-diff.test.ts +68 -0
- package/src/cli/handlers/index-diff.ts +146 -0
- package/src/cli/handlers/ledger-root-member.test.ts +161 -0
- package/src/cli/handlers/lifecycle-drift.ts +68 -0
- package/src/cli/handlers/lifecycle.test.ts +33 -11
- package/src/cli/handlers/lifecycle.ts +205 -30
- package/src/cli/handlers/misc.ts +73 -0
- package/src/cli/handlers/pr-waves-blocked.test.ts +37 -2
- package/src/cli/handlers/pr.ts +16 -3
- package/src/cli/handlers/promote.test.ts +64 -0
- package/src/cli/handlers/promote.ts +81 -6
- package/src/cli/handlers/query.ts +27 -4
- package/src/cli/handlers/run-declared-reads-cli.test.ts +187 -0
- package/src/cli/handlers/run-groups-cli.test.ts +229 -0
- package/src/cli/handlers/scenario.test.ts +13 -0
- package/src/cli/handlers/scenario.ts +8 -7
- package/src/cli/handlers/search-index.test.ts +255 -0
- package/src/cli/handlers/search-json.test.ts +1 -1
- package/src/cli/handlers/search-ownership.test.ts +194 -0
- package/src/cli/handlers/search.ts +271 -38
- package/src/cli/main.test.ts +7 -0
- package/src/cli/main.ts +56 -1
- package/src/cli/mcp/lifecycle-tools.ts +3 -2
- package/src/cli/mcp/resource-handlers.ts +4 -3
- package/src/cli/mcp/workspace-tools.ts +1 -1
- package/src/cli/parse-args.ts +40 -2
- package/src/cli/registry.ts +19 -1
- package/src/cloud-lister/aws.test.ts +202 -0
- package/src/cloud-lister/aws.ts +226 -0
- package/src/cloud-lister/azure.test.ts +132 -0
- package/src/cloud-lister/azure.ts +142 -0
- package/src/cloud-lister/common.ts +115 -0
- package/src/cloud-lister/credentials.ts +110 -0
- package/src/cloud-lister/fakes.ts +66 -0
- package/src/cloud-lister/gcp.test.ts +121 -0
- package/src/cloud-lister/gcp.ts +159 -0
- package/src/cloud-lister/guard.test.ts +198 -0
- package/src/cloud-lister/guard.ts +111 -0
- package/src/cloud-lister/ids.ts +54 -0
- package/src/cloud-lister/index.ts +134 -0
- package/src/cloud-lister/kubernetes.test.ts +160 -0
- package/src/cloud-lister/kubernetes.ts +284 -0
- package/src/cloud-lister/markers.ts +74 -0
- package/src/cloud-lister/mask.ts +77 -0
- package/src/cloud-lister/shape.test.ts +81 -0
- package/src/cloud-lister/sigv4.ts +70 -0
- package/src/cloud-lister/transport.ts +118 -0
- package/src/cloud-lister/types.ts +135 -0
- package/src/components/capability-plugin-loader.ts +4 -0
- package/src/components/capability-plugin.ts +10 -0
- package/src/components/capability.ts +238 -0
- package/src/components/cli-support.ts +70 -14
- package/src/components/covered-round.test.ts +166 -0
- package/src/components/covered-round.ts +293 -0
- package/src/components/declared-reads.test.ts +103 -0
- package/src/components/declared-reads.ts +134 -0
- package/src/components/deploy-units.ts +4 -0
- package/src/components/driver.ts +101 -4
- package/src/components/fan-out-run.ts +95 -15
- package/src/components/fan-out-support.ts +10 -1
- package/src/components/fan-out.ts +30 -0
- package/src/components/groups.test.ts +320 -0
- package/src/components/groups.ts +880 -0
- package/src/components/index.ts +59 -0
- package/src/components/plan-shape-conformance.ts +130 -0
- package/src/components/pr-env-run-bundle.test.ts +2 -0
- package/src/components/pr-run.test.ts +728 -4
- package/src/components/pr-run.ts +395 -55
- package/src/components/promote-rounds.ts +25 -2
- package/src/components/promote.ts +55 -5
- package/src/components/registry.test.ts +1 -1
- package/src/components/release-gate.ts +115 -30
- package/src/components/release-groups.test.ts +362 -0
- package/src/components/run-groups.ts +113 -0
- package/src/components/starter-plugin.ts +6 -0
- package/src/components/verbs/index.ts +1 -0
- package/src/components/verbs/member-outputs.test.ts +205 -0
- package/src/components/verbs/member-outputs.ts +308 -0
- package/src/components/wave-plan.ts +5 -2
- package/src/config.ts +44 -0
- package/src/deep-observation.ts +5 -23
- package/src/drift-record.test.ts +596 -0
- package/src/drift-record.ts +1206 -0
- package/src/engine-facts.guard.test.ts +111 -0
- package/src/engine-facts.test.ts +178 -0
- package/src/engine-facts.ts +154 -0
- package/src/gated-waves-bundle.test.ts +2 -0
- package/src/graph-ir-live.test.ts +92 -0
- package/src/graph-ir.ts +317 -7
- package/src/graph-refs.ts +416 -0
- package/src/graph-schema/fixtures/adopt.json +15 -0
- package/src/graph-schema/fixtures/choudoufu.engine-graph.json +169 -0
- package/src/graph-schema/fixtures/index.json +68 -0
- package/src/graph-schema/fixtures/plunge.engine-graph.json +158 -0
- package/src/graph-schema/fixtures.ts +267 -0
- package/src/graph-schema/generate.ts +263 -0
- package/src/graph-schema/graph-schema.test.ts +153 -0
- package/src/graph-schema/graph.schema.json +1387 -0
- package/src/health.schema.json +2 -1
- package/src/identity.ts +2 -0
- package/src/index.ts +2 -0
- package/src/instance-nodes.ts +288 -0
- package/src/lexicon.ts +76 -0
- package/src/lifecycle/__fixtures__/index-diff/20261026T120000Z-aaaaaaaaaaaa.json +149 -0
- package/src/lifecycle/__fixtures__/index-diff/20261026T130000Z-bbbbbbbbbbbb.json +127 -0
- package/src/lifecycle/adoption-file.test.ts +100 -0
- package/src/lifecycle/adoption-file.ts +154 -0
- package/src/lifecycle/cloud-index.test.ts +517 -0
- package/src/lifecycle/cloud-index.ts +736 -0
- package/src/lifecycle/derive-edges.test.ts +193 -0
- package/src/lifecycle/derive-edges.ts +182 -0
- package/src/lifecycle/git.ts +10 -4
- package/src/lifecycle/identity-match.test.ts +308 -0
- package/src/lifecycle/identity-match.ts +257 -0
- package/src/lifecycle/index-diff.test.ts +198 -0
- package/src/lifecycle/index-diff.ts +476 -0
- package/src/lifecycle/index-document.test.ts +64 -0
- package/src/lifecycle/index-document.ts +299 -0
- package/src/lifecycle/index-drift.test.ts +191 -0
- package/src/lifecycle/index-drift.ts +304 -0
- package/src/lifecycle/index-import.test.ts +255 -0
- package/src/lifecycle/index-import.ts +634 -0
- package/src/lifecycle/index-join.test.ts +250 -0
- package/src/lifecycle/index-join.ts +304 -0
- package/src/lifecycle/index-store-load-bearing.test.ts +187 -0
- package/src/lifecycle/index.ts +4 -0
- package/src/lifecycle/member-ledger.test.ts +25 -7
- package/src/lifecycle/observation-baseline.test.ts +72 -1
- package/src/lifecycle/observation-baseline.ts +190 -27
- package/src/lifecycle/observe.ts +6 -1
- package/src/lifecycle/query.test.ts +69 -1
- package/src/lifecycle/query.ts +103 -10
- package/src/lifecycle/replay.test.ts +9 -5
- package/src/lifecycle/replay.ts +9 -5
- package/src/lifecycle/scenario.ts +4 -3
- package/src/lifecycle/snapshot-store-fake.ts +29 -0
- package/src/lifecycle/snapshot-store-s3.ts +316 -0
- package/src/lifecycle/snapshot-store.test.ts +385 -0
- package/src/lifecycle/snapshot-store.ts +981 -0
- package/src/lifecycle/snapshot.test.ts +13 -0
- package/src/lifecycle/snapshot.ts +23 -6
- package/src/lifecycle/type-listing.test.ts +166 -0
- package/src/lifecycle/type-listing.ts +309 -0
- package/src/lint/component-checks.ts +17 -1
- package/src/lint/config.test.ts +3 -0
- package/src/lint/presets/relaxed.json +2 -1
- package/src/lint/presets/strict.json +2 -1
- package/src/lint/rules/__fixtures__/comp/comp008/fail/dns.component.ts +15 -0
- package/src/lint/rules/__fixtures__/comp/comp008/pass/dns.component.ts +10 -0
- package/src/lint/rules/comp/comp.test.ts +2 -1
- package/src/lint/rules/comp/comp008-applies-signal-only-root.ts +121 -0
- package/src/lint/rules/comp/comp008.test.ts +77 -0
- package/src/lint/rules/comp/index.ts +4 -1
- package/src/observation-edges.test.ts +33 -0
- package/src/observation.ts +36 -1
- package/src/op/activities/activity-contracts.ts +1 -1
- package/src/op/activities/change-set.ts +8 -5
- package/src/op/activity-failure.ts +36 -0
- package/src/op/index.ts +2 -1
- package/src/op/local-executor.test.ts +80 -0
- package/src/op/local-executor.ts +27 -9
- package/src/pr-loop-bundle.test.ts +5 -2
- package/src/pr-loop.test.ts +57 -1
- package/src/pr-loop.ts +154 -6
- package/src/pulumi-urn.ts +151 -0
- package/src/release-floors.ts +22 -0
- package/src/sensitive-key.ts +34 -0
- package/src/workspace/adoption-report.test.ts +61 -0
- package/src/workspace/adoption-report.ts +103 -0
- package/src/workspace/capabilities-contract.test.ts +4 -0
- package/src/workspace/capabilities-contract.ts +9 -1
- package/src/workspace/capabilities.schema.json +98 -0
- package/src/workspace/change-set.schema.json +42 -3
- package/src/workspace/ci-cloud-identity.ts +31 -1
- package/src/workspace/compose-graph.test.ts +12 -0
- package/src/workspace/compose-graph.ts +12 -1
- package/src/workspace/conformance/conformance.e2e.test.ts +2 -1
- package/src/workspace/conformance/index.ts +6 -1
- package/src/workspace/drift-cli.test.ts +65 -0
- package/src/workspace/drift-cli.ts +365 -0
- package/src/workspace/drift.schema.json +672 -0
- package/src/workspace/graph-cli.ts +5 -0
- package/src/workspace/graph.schema.json +72 -0
- package/src/workspace/init.test.ts +38 -1
- package/src/workspace/init.ts +50 -8
- package/src/workspace/intent-gaps.test.ts +18 -2
- package/src/workspace/ledger.schema.json +1 -1
- package/src/workspace/nested-graph.ts +1 -0
- package/src/workspace/pr-report.schema.json +76 -3
- package/src/workspace/promote-waves.test.ts +296 -0
- package/src/workspace/promote-waves.ts +340 -0
- package/src/workspace/promote.test.ts +158 -4
- package/src/workspace/promote.ts +398 -57
- package/src/workspace/reason-codes.test.ts +4 -1
- package/src/workspace/reason-codes.ts +14 -0
- package/src/workspace/search-contract.ts +2 -0
- package/src/workspace/search.schema.json +103 -5
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `chant workspace promote --all` (#4461): adopt a workspace of plain
|
|
3
|
+
* Terraform roots into choudoufu in waves, a canary first.
|
|
4
|
+
*
|
|
5
|
+
* Each root goes through {@link promoteCommand} on its own, so each root has
|
|
6
|
+
* its own gate, `workspace-promote/<member>`, whose digest binds that root's
|
|
7
|
+
* own `live-import` report. A root that fails leaves every other root as it
|
|
8
|
+
* was: its staging ran in a worktree, and nothing of it reached the tree.
|
|
9
|
+
*
|
|
10
|
+
* The order:
|
|
11
|
+
*
|
|
12
|
+
* - The canary (`--canary <member>`, else the first candidate in declaration
|
|
13
|
+
* order) is wave 1. Unless every canary lands, no other wave runs.
|
|
14
|
+
* - The rest follow in declaration order, `--wave-size` roots a wave. Every
|
|
15
|
+
* root of a wave is tried even when one of them fails, and the next wave
|
|
16
|
+
* runs only when the whole wave landed.
|
|
17
|
+
*
|
|
18
|
+
* A root lands when it was applied, was already promoted, or (under
|
|
19
|
+
* `--dry-run`) staged cleanly. A gated root has not landed: approve its gate
|
|
20
|
+
* and run the same command again. Roots already of kind `choudoufu` report
|
|
21
|
+
* `already-promoted` and are not staged again, so a re-run over a workspace
|
|
22
|
+
* that has landed is a no-op. A root whose kind was written but whose
|
|
23
|
+
* `live-import -approve` failed is kind `choudoufu` with a pending stamp
|
|
24
|
+
* (#4485): a re-run retries the stamp, and the root lands once it passes or
|
|
25
|
+
* stays `stamp-failed` with the command to run.
|
|
26
|
+
*
|
|
27
|
+
* Before a root is staged its state is checked: `live-import` reads a local
|
|
28
|
+
* tfstate of format version 4, so a missing state under a remote backend, or
|
|
29
|
+
* a state of another version, refuses that root by name.
|
|
30
|
+
*/
|
|
31
|
+
import { existsSync, readdirSync, readFileSync, realpathSync } from "node:fs";
|
|
32
|
+
import { join, resolve } from "node:path";
|
|
33
|
+
import { formatError, formatInfo, formatSuccess, formatWarning } from "../cli/format.js";
|
|
34
|
+
import { readDeclaration } from "./declaration.js";
|
|
35
|
+
import { PROMOTE_GATED_EXIT, PromoteError, promoteCommand, readPendingStamp, retryPendingStamp, stampCommand } from "./promote.js";
|
|
36
|
+
import { workingTree } from "./tree.js";
|
|
37
|
+
export const DEFAULT_WAVE_SIZE = 5;
|
|
38
|
+
const LANDED = new Set(["applied", "already-promoted", "dry-run"]);
|
|
39
|
+
/** Parse `--state <member>=<path>` values. */
|
|
40
|
+
export function parseStateMappings(values) {
|
|
41
|
+
const out = {};
|
|
42
|
+
for (const v of values) {
|
|
43
|
+
const at = v.indexOf("=");
|
|
44
|
+
if (at <= 0 || at === v.length - 1)
|
|
45
|
+
throw new PromoteError(`--state with --all takes <member>=<terraform.tfstate>: got "${v}"`);
|
|
46
|
+
const member = v.slice(0, at);
|
|
47
|
+
if (out[member] !== undefined)
|
|
48
|
+
throw new PromoteError(`--state names ${member} twice`);
|
|
49
|
+
out[member] = v.slice(at + 1);
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
/** The waves: the canaries first, then the rest in declaration order, `size` at a time. */
|
|
54
|
+
export function planWaves(candidates, canary, size) {
|
|
55
|
+
if (!Number.isInteger(size) || size < 1)
|
|
56
|
+
throw new PromoteError(`--wave-size needs a whole number from 1: got ${size}`);
|
|
57
|
+
for (const c of canary) {
|
|
58
|
+
if (!candidates.includes(c))
|
|
59
|
+
throw new PromoteError(`--canary ${c} is not one of the roots being promoted (${candidates.join(", ") || "none"})`);
|
|
60
|
+
}
|
|
61
|
+
const first = canary.length > 0 ? [...new Set(canary)] : candidates.slice(0, 1);
|
|
62
|
+
const rest = candidates.filter((m) => !first.includes(m));
|
|
63
|
+
const waves = first.length > 0 ? [first] : [];
|
|
64
|
+
for (let i = 0; i < rest.length; i += size)
|
|
65
|
+
waves.push(rest.slice(i, i + size));
|
|
66
|
+
return waves;
|
|
67
|
+
}
|
|
68
|
+
/** The backend a root's .tf files declare, or undefined for none or `local`. */
|
|
69
|
+
export function remoteBackend(dir) {
|
|
70
|
+
let files;
|
|
71
|
+
try {
|
|
72
|
+
files = readdirSync(dir).filter((f) => f.endsWith(".tf"));
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
for (const f of files) {
|
|
78
|
+
const text = readFileSync(join(dir, f), "utf-8").replace(/^\s*(#|\/\/).*$/gm, "");
|
|
79
|
+
const backend = /\bbackend\s+"([^"]+)"/.exec(text);
|
|
80
|
+
if (backend && backend[1] !== "local")
|
|
81
|
+
return backend[1];
|
|
82
|
+
if (/^\s*cloud\s*\{/m.test(text))
|
|
83
|
+
return "cloud";
|
|
84
|
+
}
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Why `state` cannot feed `live-import` for `member`, or undefined when it
|
|
89
|
+
* can: it must be a local tfstate of format version 4.
|
|
90
|
+
*/
|
|
91
|
+
export function stateRefusal(member, memberDir, state) {
|
|
92
|
+
const backend = remoteBackend(memberDir);
|
|
93
|
+
if (!existsSync(state)) {
|
|
94
|
+
if (backend) {
|
|
95
|
+
return `${member} uses the ${backend} backend and has no local state at ${state}: live-import reads a local tfstate, so run \`terraform state pull > ${state}\` in ${memberDir} first (or pass --state ${member}=<pulled file>)`;
|
|
96
|
+
}
|
|
97
|
+
return `${member} has no state at ${state}: pass --state ${member}=<terraform.tfstate> or --state-dir <dir>`;
|
|
98
|
+
}
|
|
99
|
+
let parsed;
|
|
100
|
+
try {
|
|
101
|
+
parsed = JSON.parse(readFileSync(state, "utf-8"));
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return `${member}: ${state} is not a JSON tfstate`;
|
|
105
|
+
}
|
|
106
|
+
const version = parsed?.version;
|
|
107
|
+
if (version !== 4) {
|
|
108
|
+
const hint = parsed?.backend !== undefined
|
|
109
|
+
? " It looks like .terraform/terraform.tfstate, the backend's settings: run `terraform state pull` for the state itself."
|
|
110
|
+
: "";
|
|
111
|
+
return `${member}: ${state} is a version ${String(version)} state; live-import reads version 4 only (Terraform 0.12 and later).${hint}`;
|
|
112
|
+
}
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
function reportCounts(r) {
|
|
116
|
+
if (!r.adoption)
|
|
117
|
+
return {};
|
|
118
|
+
return {
|
|
119
|
+
eligible: { stampable: r.adoption.claimed, total: r.adoption.total },
|
|
120
|
+
unadmitted: r.adoption.entries.filter((e) => e.status === "UNADMITTED_TYPE").length,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function stampCounts(text) {
|
|
124
|
+
const m = text ? /(\d+) resource\(s\) newly stamped, (\d+) already stamped, .*?(\d+) failed/.exec(text) : null;
|
|
125
|
+
return m ? { newly: Number(m[1]), already: Number(m[2]), failed: Number(m[3]) } : undefined;
|
|
126
|
+
}
|
|
127
|
+
function rootOutcome(r) {
|
|
128
|
+
if (r.outcome === "applied")
|
|
129
|
+
return r.exitCode === 0 ? "applied" : "stamp-failed";
|
|
130
|
+
if (r.outcome === "top-of-ladder")
|
|
131
|
+
return "already-promoted";
|
|
132
|
+
return r.outcome;
|
|
133
|
+
}
|
|
134
|
+
export async function promoteWavesCommand(opts) {
|
|
135
|
+
const root = resolve(opts.root);
|
|
136
|
+
const decl = readDeclaration(workingTree(root));
|
|
137
|
+
const states = opts.states ?? {};
|
|
138
|
+
const say = (m) => {
|
|
139
|
+
if (!opts.json)
|
|
140
|
+
console.error(m);
|
|
141
|
+
};
|
|
142
|
+
for (const name of Object.keys(states)) {
|
|
143
|
+
if (!decl.members.some((m) => m.name === name))
|
|
144
|
+
throw new PromoteError(`--state names ${name}, which the declaration has no member of`);
|
|
145
|
+
}
|
|
146
|
+
const selected = decl.members.filter((m) => (opts.all ? m.kind === "terraform" || m.kind === "choudoufu" : states[m.name] !== undefined));
|
|
147
|
+
if (selected.length === 0) {
|
|
148
|
+
throw new PromoteError(opts.all ? "the declaration has no member of kind terraform to promote" : "name the roots with --state <member>=<path>, or pass --all");
|
|
149
|
+
}
|
|
150
|
+
for (const m of selected) {
|
|
151
|
+
if (m.kind !== "terraform" && m.kind !== "choudoufu")
|
|
152
|
+
throw new PromoteError(`${m.name} is kind ${m.kind}; promote --all adopts terraform roots into choudoufu`);
|
|
153
|
+
}
|
|
154
|
+
// The waves are planned over every selected root, promoted or not, so a
|
|
155
|
+
// re-run keeps the same waves and the same canary: an already promoted
|
|
156
|
+
// root lands in its wave without being staged.
|
|
157
|
+
const waves = planWaves(selected.map((m) => m.name), opts.canary ?? [], opts.waveSize ?? DEFAULT_WAVE_SIZE);
|
|
158
|
+
const byName = new Map(selected.map((m) => [m.name, m]));
|
|
159
|
+
const roots = [];
|
|
160
|
+
const stateFor = (name) => {
|
|
161
|
+
const dir = byName.get(name).dir;
|
|
162
|
+
if (states[name] !== undefined)
|
|
163
|
+
return resolve(states[name]);
|
|
164
|
+
if (opts.stateDir)
|
|
165
|
+
return resolve(opts.stateDir, `${name}.tfstate`);
|
|
166
|
+
return join(root, dir, "terraform.tfstate");
|
|
167
|
+
};
|
|
168
|
+
let stopped;
|
|
169
|
+
for (const [i, wave] of waves.entries()) {
|
|
170
|
+
const n = i + 1;
|
|
171
|
+
const canary = i === 0;
|
|
172
|
+
if (stopped) {
|
|
173
|
+
for (const name of wave)
|
|
174
|
+
roots.push({ member: name, wave: n, canary, outcome: "not-run", kind: byName.get(name).kind, reason: stopped });
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
say(formatInfo(`wave ${n}${canary ? " (canary)" : ""}: ${wave.join(", ")}`));
|
|
178
|
+
const results = [];
|
|
179
|
+
for (const name of wave) {
|
|
180
|
+
const member = byName.get(name);
|
|
181
|
+
const state = stateFor(name);
|
|
182
|
+
if (member.kind !== "terraform") {
|
|
183
|
+
const pending = member.kind === "choudoufu" ? readPendingStamp(realpathSync(root), name) : undefined;
|
|
184
|
+
if (!pending || opts.dryRun) {
|
|
185
|
+
const why = pending ? `already kind ${member.kind}; its stamp is pending and --dry-run does not retry it` : `already kind ${member.kind}; nothing staged`;
|
|
186
|
+
results.push({ member: name, wave: n, canary, outcome: pending ? "stamp-failed" : "already-promoted", kind: member.kind, reason: why });
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
// #4485: the kind was written and the stamp failed; retry the stamp, against the state this run names if it names one.
|
|
190
|
+
const explicit = states[name] !== undefined || opts.stateDir !== undefined ? stateFor(name) : undefined;
|
|
191
|
+
const row = { member: name, wave: n, canary, outcome: "stamp-failed", kind: member.kind, state: explicit ?? pending.state };
|
|
192
|
+
try {
|
|
193
|
+
const r = (await retryPendingStamp({ root, member: name, ...(explicit ? { state: explicit } : {}), ...(opts.json !== undefined ? { json: opts.json } : {}), ...(opts.runner ? { runner: opts.runner } : {}) }));
|
|
194
|
+
row.outcome = rootOutcome(r);
|
|
195
|
+
const stamped = stampCounts(r.followUpOutput);
|
|
196
|
+
if (stamped)
|
|
197
|
+
row.stamped = stamped;
|
|
198
|
+
row.reason = row.outcome === "applied"
|
|
199
|
+
? `kind written by an earlier run; its failed stamp was retried and passed`
|
|
200
|
+
: `kind written, but ${r.followUpFailed} failed again; live-import is safe to re-run: ${stampCommand({ name, dir: member.dir }, row.state)}`;
|
|
201
|
+
}
|
|
202
|
+
catch (err) {
|
|
203
|
+
if (!(err instanceof PromoteError))
|
|
204
|
+
throw err;
|
|
205
|
+
row.reason = err.message;
|
|
206
|
+
say(formatError({ message: `${name}: ${err.message}` }));
|
|
207
|
+
}
|
|
208
|
+
results.push(row);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
const row = { member: name, wave: n, canary, outcome: "failed", kind: member.kind, state };
|
|
212
|
+
const refusal = stateRefusal(name, join(root, member.dir), state);
|
|
213
|
+
if (refusal) {
|
|
214
|
+
row.outcome = "refused";
|
|
215
|
+
row.reason = refusal;
|
|
216
|
+
say(formatError({ message: refusal }));
|
|
217
|
+
results.push(row);
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
const r = await promoteCommand({
|
|
222
|
+
root,
|
|
223
|
+
member: name,
|
|
224
|
+
state,
|
|
225
|
+
dryRun: opts.dryRun,
|
|
226
|
+
json: opts.json,
|
|
227
|
+
nested: true,
|
|
228
|
+
...(opts.runner ? { runner: opts.runner } : {}),
|
|
229
|
+
...(opts.ledger ? { ledger: opts.ledger } : {}),
|
|
230
|
+
...(opts.now ? { now: opts.now } : {}),
|
|
231
|
+
});
|
|
232
|
+
row.outcome = rootOutcome(r);
|
|
233
|
+
if (r.digest)
|
|
234
|
+
row.digest = r.digest;
|
|
235
|
+
if (r.reportDigest)
|
|
236
|
+
row.reportDigest = r.reportDigest;
|
|
237
|
+
Object.assign(row, reportCounts(r));
|
|
238
|
+
const stamped = stampCounts(r.followUpOutput);
|
|
239
|
+
if (stamped)
|
|
240
|
+
row.stamped = stamped;
|
|
241
|
+
if (row.outcome === "checks-failed")
|
|
242
|
+
row.reason = r.failureOutput?.split("\n").at(-1) || "a staging check failed";
|
|
243
|
+
if (row.outcome === "stamp-failed") {
|
|
244
|
+
row.reason = `kind written, but ${r.followUpFailed} failed; run this again to retry the stamp, or run it by hand (live-import is safe to re-run): ${stampCommand({ name, dir: member.dir }, state)}`;
|
|
245
|
+
}
|
|
246
|
+
if (row.outcome === "gated")
|
|
247
|
+
row.reason = `approve with \`chant approve workspace-promote ${name}\`, then run this again`;
|
|
248
|
+
}
|
|
249
|
+
catch (err) {
|
|
250
|
+
if (!(err instanceof PromoteError))
|
|
251
|
+
throw err;
|
|
252
|
+
row.outcome = "failed";
|
|
253
|
+
row.reason = err.message;
|
|
254
|
+
say(formatError({ message: `${name}: ${err.message}` }));
|
|
255
|
+
}
|
|
256
|
+
results.push(row);
|
|
257
|
+
}
|
|
258
|
+
roots.push(...results);
|
|
259
|
+
const short = results.filter((r) => !LANDED.has(r.outcome));
|
|
260
|
+
if (short.length > 0) {
|
|
261
|
+
stopped = `${canary ? "the canary wave" : `wave ${n}`} did not land (${short.map((r) => `${r.member} ${r.outcome}`).join(", ")})`;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
const failed = roots.some((r) => r.outcome === "refused" || r.outcome === "checks-failed" || r.outcome === "failed" || r.outcome === "stamp-failed");
|
|
265
|
+
const gated = roots.some((r) => r.outcome === "gated");
|
|
266
|
+
const outcome = failed ? "failed" : gated ? "gated" : opts.dryRun ? "dry-run" : "landed";
|
|
267
|
+
const exitCode = failed ? 1 : gated ? PROMOTE_GATED_EXIT : 0;
|
|
268
|
+
const summary = { outcome, exitCode, waves, roots };
|
|
269
|
+
if (opts.json) {
|
|
270
|
+
console.log(JSON.stringify(summary, null, 2));
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
say("");
|
|
274
|
+
for (const r of roots) {
|
|
275
|
+
const counts = [
|
|
276
|
+
r.eligible ? `${r.eligible.stampable} of ${r.eligible.total} stampable` : "",
|
|
277
|
+
r.unadmitted ? `${r.unadmitted} unadmitted, not stamped` : "",
|
|
278
|
+
r.stamped ? `${r.stamped.newly} newly stamped, ${r.stamped.already} already stamped, ${r.stamped.failed} failed` : "",
|
|
279
|
+
].filter(Boolean).join("; ");
|
|
280
|
+
const where = `wave ${r.wave}${r.canary ? " canary" : ""}`;
|
|
281
|
+
const line = `${r.member} ${where} ${r.outcome}${counts ? ` (${counts})` : ""}${r.reason ? `: ${r.reason}` : ""}`;
|
|
282
|
+
say(LANDED.has(r.outcome) ? formatInfo(line) : r.outcome === "gated" || r.outcome === "not-run" ? formatWarning({ message: line }) : formatError({ message: line }));
|
|
283
|
+
}
|
|
284
|
+
if (outcome === "landed")
|
|
285
|
+
say(formatSuccess(`every root landed. Review and commit the declaration.`));
|
|
286
|
+
else if (outcome === "gated")
|
|
287
|
+
say(formatInfo("approve the pending gates and run the same command again; landed roots are not staged twice"));
|
|
288
|
+
}
|
|
289
|
+
return summary;
|
|
290
|
+
}
|
|
@@ -13,17 +13,45 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Rungs:
|
|
15
15
|
*
|
|
16
|
-
* - `terraform` to `choudoufu`: `choudoufu
|
|
16
|
+
* - `terraform` to `choudoufu`: `choudoufu init -backend=false` installs the
|
|
17
|
+
* providers in the staging worktree, which has no `.terraform/` of its own
|
|
18
|
+
* (#4461: `live-import` reads each resource through its provider), then
|
|
19
|
+
* `choudoufu live-check` in the member's
|
|
17
20
|
* directory must pass, then `choudoufu live-import -state=<--state>
|
|
18
21
|
* -estate=<member>` prints its ratification report (read-only: it stamps
|
|
19
|
-
* nothing without `-approve`). The patch changes the member's kind.
|
|
22
|
+
* nothing without `-approve`). The patch changes the member's kind. The
|
|
23
|
+
* report, one entry per resource with its status, rides on `--json` as
|
|
24
|
+
* `adoption` (INTENTIUS/behold#999, ./adoption-report.ts), so
|
|
25
|
+
* `--dry-run --json` is the read-only way to ask what adopting would claim.
|
|
20
26
|
* - `choudoufu` or `other` to `chant`: `chant import` writes TypeScript into
|
|
21
27
|
* the member's directory. The patch holds those files and the kind change.
|
|
22
28
|
*
|
|
29
|
+
* The digest covers the member, the rung, what the staging changed outside
|
|
30
|
+
* the declaration, and (for `choudoufu`) the digest of the `live-import`
|
|
31
|
+
* report, so an approval is for the report the approver read. The kind change
|
|
32
|
+
* itself is written into the tree's declaration on apply rather than carried
|
|
33
|
+
* as a hunk, so promoting one member never conflicts with another member's
|
|
34
|
+
* uncommitted promotion (#4461: `--all` promotes a workspace in waves, see
|
|
35
|
+
* `./promote-waves.ts`).
|
|
36
|
+
*
|
|
37
|
+
* The stamp (`live-import -approve`) runs in the staging worktree's member
|
|
38
|
+
* directory, where `choudoufu init -backend=false` already installed the
|
|
39
|
+
* providers, so the member's own directory needs none (chant#4492).
|
|
40
|
+
*
|
|
41
|
+
* When `live-import -approve` fails after the kind change is written, the
|
|
42
|
+
* promote leaves a stamp record under `.chant/workspace-promote/` (#4485). A
|
|
43
|
+
* re-run finds the member already of kind `choudoufu` and the record, and
|
|
44
|
+
* retries the stamp ({@link retryPendingStamp}) rather than reporting it
|
|
45
|
+
* promoted or starting the next rung. The retry has no staging of its own to
|
|
46
|
+
* reuse, so it stages one first: a worktree at HEAD with the tree's changes to
|
|
47
|
+
* the member, and `choudoufu init -backend=false` in it. The record goes once
|
|
48
|
+
* a stamp passes.
|
|
49
|
+
*
|
|
23
50
|
* Commands run through an injectable runner, so a test never starts a binary.
|
|
24
51
|
*/
|
|
25
52
|
import type { CommandContext } from "../cli/registry.js";
|
|
26
53
|
import { type GateLedgerPort } from "../op/gate.js";
|
|
54
|
+
import { type AdoptionReport } from "./adoption-report.js";
|
|
27
55
|
export declare const PROMOTE_PLAN_KIND = "workspace-promote";
|
|
28
56
|
export declare const PROMOTE_GATED_EXIT = 3;
|
|
29
57
|
export declare class PromoteError extends Error {
|
|
@@ -41,6 +69,8 @@ export interface CommandRun {
|
|
|
41
69
|
argv: string[];
|
|
42
70
|
/** Directory relative to the project root. */
|
|
43
71
|
cwd: string;
|
|
72
|
+
/** The `live-import` ratification report: its output is digested into the gate. */
|
|
73
|
+
report?: boolean;
|
|
44
74
|
}
|
|
45
75
|
export type PromoteRunner = (argv: string[], cwd: string) => Promise<{
|
|
46
76
|
exitCode: number;
|
|
@@ -62,6 +92,44 @@ export declare function followUpRuns(rung: Rung, member: {
|
|
|
62
92
|
}, opts: {
|
|
63
93
|
state?: string;
|
|
64
94
|
}): CommandRun[];
|
|
95
|
+
/** Where a promote keeps what a re-run needs, relative to the project root. */
|
|
96
|
+
export declare const PROMOTE_RECORD_DIR = ".chant/workspace-promote";
|
|
97
|
+
export declare const PENDING_STAMP_SCHEMA = "chant-workspace-promote-stamp/v1";
|
|
98
|
+
/** A stamp the kind change was written for and that did not pass (#4485). */
|
|
99
|
+
export interface PendingStamp {
|
|
100
|
+
schema: typeof PENDING_STAMP_SCHEMA;
|
|
101
|
+
member: string;
|
|
102
|
+
/** The member's directory, relative to the project root. */
|
|
103
|
+
dir: string;
|
|
104
|
+
/** The state `live-import -approve` read, absolute. */
|
|
105
|
+
state: string;
|
|
106
|
+
/** The follow-up that failed. */
|
|
107
|
+
failed: string;
|
|
108
|
+
/** ISO 8601. */
|
|
109
|
+
at: string;
|
|
110
|
+
}
|
|
111
|
+
/** The stamp a promote of `member` left failed, or undefined when none is pending. */
|
|
112
|
+
export declare function readPendingStamp(root: string, member: string): PendingStamp | undefined;
|
|
113
|
+
/** The `live-import -approve` line to run by hand for a pending stamp. */
|
|
114
|
+
export declare function stampCommand(member: {
|
|
115
|
+
name: string;
|
|
116
|
+
dir: string;
|
|
117
|
+
}, state: string): string;
|
|
118
|
+
/**
|
|
119
|
+
* Retry the stamp an earlier promote of `member` left failed (#4485), or
|
|
120
|
+
* undefined when none is pending. The member is already of kind
|
|
121
|
+
* `choudoufu`: its kind change was written, so only the stamp runs, against
|
|
122
|
+
* `state` when given, else the state the record names. The result is
|
|
123
|
+
* `applied`: exit 0 once the stamp passed, exit 1 with the failed follow-up
|
|
124
|
+
* when it failed again.
|
|
125
|
+
*/
|
|
126
|
+
export declare function retryPendingStamp(opts: {
|
|
127
|
+
root: string;
|
|
128
|
+
member: string;
|
|
129
|
+
state?: string;
|
|
130
|
+
json?: boolean;
|
|
131
|
+
runner?: PromoteRunner;
|
|
132
|
+
}): Promise<PromoteResult | undefined>;
|
|
65
133
|
export interface PromoteOptions {
|
|
66
134
|
root: string;
|
|
67
135
|
member: string;
|
|
@@ -70,6 +138,8 @@ export interface PromoteOptions {
|
|
|
70
138
|
dryRun?: boolean;
|
|
71
139
|
output?: string;
|
|
72
140
|
json?: boolean;
|
|
141
|
+
/** Run by `promote --all` (#4461): print no JSON of its own, the wave summary does. */
|
|
142
|
+
nested?: boolean;
|
|
73
143
|
/** For tests. */
|
|
74
144
|
runner?: PromoteRunner;
|
|
75
145
|
ledger?: GateLedgerPort;
|
|
@@ -84,10 +154,22 @@ export interface PromoteResult {
|
|
|
84
154
|
to?: string;
|
|
85
155
|
digest?: string;
|
|
86
156
|
patch?: string;
|
|
157
|
+
/** Digest of the `live-import` report the gate binds (terraform to choudoufu). */
|
|
158
|
+
reportDigest?: string;
|
|
87
159
|
ran?: {
|
|
88
160
|
label: string;
|
|
89
161
|
exitCode: number;
|
|
90
162
|
}[];
|
|
163
|
+
/** The `terraform` to `choudoufu` rung's adoption report, from `live-import` without `-approve`. */
|
|
164
|
+
adoption?: AdoptionReport;
|
|
165
|
+
/** The label of the follow-up that failed after the patch was applied. */
|
|
166
|
+
followUpFailed?: string;
|
|
167
|
+
/** The last output of the failed check or follow-up. */
|
|
168
|
+
failureOutput?: string;
|
|
169
|
+
/** The follow-up's output when it ran (the stamp report). */
|
|
170
|
+
followUpOutput?: string;
|
|
171
|
+
/** Set when this run only retried the stamp an earlier one left failed (#4485). */
|
|
172
|
+
retriedStamp?: true;
|
|
91
173
|
}
|
|
92
174
|
/** Rewrite the member's `kind` in the declaration text. */
|
|
93
175
|
export declare function setMemberKind(text: string, file: string, member: string, kind: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../src/workspace/promote.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"promote.d.ts","sourceRoot":"","sources":["../../src/workspace/promote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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