@intentius/chant 0.124.55 → 0.124.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ci-agent.d.ts.map +1 -1
- package/dist/ci-agent.js +1 -2
- package/dist/ci-audit/attribution.d.ts +111 -0
- package/dist/ci-audit/attribution.d.ts.map +1 -0
- package/dist/ci-audit/attribution.js +194 -0
- package/dist/ci-audit/audit-log.d.ts +144 -0
- package/dist/ci-audit/audit-log.d.ts.map +1 -0
- package/dist/ci-audit/audit-log.js +149 -0
- package/dist/ci-audit/index.d.ts +12 -0
- package/dist/ci-audit/index.d.ts.map +1 -0
- package/dist/ci-audit/index.js +11 -0
- package/dist/ci-audit/unrecorded.d.ts +74 -0
- package/dist/ci-audit/unrecorded.d.ts.map +1 -0
- package/dist/ci-audit/unrecorded.js +95 -0
- package/dist/ci-audit.d.ts +3 -0
- package/dist/ci-audit.d.ts.map +1 -0
- package/dist/ci-audit.js +2 -0
- package/dist/ci-control.d.ts.map +1 -1
- package/dist/ci-control.js +3 -4
- package/dist/ci-estate.d.ts +24 -0
- package/dist/ci-estate.d.ts.map +1 -1
- package/dist/ci-estate.js +1 -2
- package/dist/ci-identity.d.ts.map +1 -1
- package/dist/ci-identity.js +2 -3
- package/dist/ci-job-guard.d.ts +139 -0
- package/dist/ci-job-guard.d.ts.map +1 -0
- package/dist/ci-job-guard.js +287 -0
- package/dist/ci-jobs.d.ts +7 -0
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +7 -0
- package/dist/ci-product-words.d.ts +7 -1
- package/dist/ci-product-words.d.ts.map +1 -1
- package/dist/ci-product-words.js +38 -4
- package/dist/ci-product.d.ts +35 -0
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +38 -4
- package/dist/ci-respond-run.d.ts +73 -0
- package/dist/ci-respond-run.d.ts.map +1 -0
- package/dist/ci-respond-run.js +247 -0
- package/dist/ci-respond.d.ts +189 -0
- package/dist/ci-respond.d.ts.map +1 -0
- package/dist/ci-respond.js +285 -0
- package/dist/cli/handlers/audit-log.d.ts +12 -0
- package/dist/cli/handlers/audit-log.d.ts.map +1 -0
- package/dist/cli/handlers/audit-log.js +81 -0
- package/dist/cli/handlers/build.d.ts +7 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +81 -0
- package/dist/cli/handlers/ci-check-job.d.ts +11 -0
- package/dist/cli/handlers/ci-check-job.d.ts.map +1 -0
- package/dist/cli/handlers/ci-check-job.js +27 -0
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +38 -9
- package/dist/cli/handlers/e2e-safe-run.d.ts +12 -0
- package/dist/cli/handlers/e2e-safe-run.d.ts.map +1 -0
- package/dist/cli/handlers/e2e-safe-run.js +23 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +14 -0
- package/dist/cli/handlers/pr.d.ts +5 -0
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +346 -36
- package/dist/cli/handlers/run-wave.js +89 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +56 -2
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +107 -0
- package/dist/cli/registry.d.ts +38 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/adoption.d.ts.map +1 -1
- package/dist/components/adoption.js +1 -2
- package/dist/components/auto-release.d.ts +5 -2
- package/dist/components/auto-release.d.ts.map +1 -1
- package/dist/components/auto-release.js +9 -4
- package/dist/components/capability.d.ts +47 -0
- package/dist/components/capability.d.ts.map +1 -1
- package/dist/components/capability.js +25 -0
- package/dist/components/check-hooks.d.ts +4 -1
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-steps.d.ts +74 -0
- package/dist/components/check-steps.d.ts.map +1 -0
- package/dist/components/check-steps.js +102 -0
- package/dist/components/ci-services.d.ts.map +1 -1
- package/dist/components/ci-services.js +1 -2
- package/dist/components/deploy-units.d.ts +12 -0
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/components/deploy-units.js +20 -1
- package/dist/components/driver.d.ts +12 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +35 -1
- package/dist/components/groups.d.ts.map +1 -1
- package/dist/components/groups.js +4 -3
- package/dist/components/pr-env-ledger.d.ts.map +1 -1
- package/dist/components/pr-env-ledger.js +1 -2
- package/dist/components/pr-environment.d.ts +1 -1
- package/dist/components/pr-environment.d.ts.map +1 -1
- package/dist/components/pr-environment.js +1 -1
- package/dist/components/pr-pipeline.d.ts +137 -5
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +164 -20
- package/dist/components/pr-run.d.ts +8 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +9 -4
- package/dist/components/product-pipeline.d.ts +35 -2
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +24 -5
- package/dist/components/row-lease.d.ts +22 -1
- package/dist/components/row-lease.d.ts.map +1 -1
- package/dist/components/row-lease.js +32 -6
- package/dist/components/wave-plan.d.ts +8 -0
- package/dist/components/wave-plan.d.ts.map +1 -1
- package/dist/components/wave-plan.js +18 -2
- package/dist/e2e-harness/bucket.d.ts +21 -0
- package/dist/e2e-harness/bucket.d.ts.map +1 -0
- package/dist/e2e-harness/bucket.js +61 -0
- package/dist/e2e-harness/claim.d.ts +70 -0
- package/dist/e2e-harness/claim.d.ts.map +1 -0
- package/dist/e2e-harness/claim.js +98 -0
- package/dist/e2e-harness/driver.d.ts +64 -0
- package/dist/e2e-harness/driver.d.ts.map +1 -0
- package/dist/e2e-harness/driver.js +243 -0
- package/dist/e2e-harness/forgejo.d.ts +77 -0
- package/dist/e2e-harness/forgejo.d.ts.map +1 -0
- package/dist/e2e-harness/forgejo.js +205 -0
- package/dist/e2e-harness/git.d.ts +32 -0
- package/dist/e2e-harness/git.d.ts.map +1 -0
- package/dist/e2e-harness/git.js +67 -0
- package/dist/e2e-harness/index.d.ts +22 -0
- package/dist/e2e-harness/index.d.ts.map +1 -0
- package/dist/e2e-harness/index.js +47 -0
- package/dist/e2e-harness/jobs.d.ts +8 -0
- package/dist/e2e-harness/jobs.d.ts.map +1 -0
- package/dist/e2e-harness/jobs.js +34 -0
- package/dist/e2e-harness/pins.d.ts +45 -0
- package/dist/e2e-harness/pins.d.ts.map +1 -0
- package/dist/e2e-harness/pins.js +44 -0
- package/dist/e2e-harness/ports.d.ts +113 -0
- package/dist/e2e-harness/ports.d.ts.map +1 -0
- package/dist/e2e-harness/ports.js +4 -0
- package/dist/e2e-harness/reports.d.ts +45 -0
- package/dist/e2e-harness/reports.d.ts.map +1 -0
- package/dist/e2e-harness/reports.js +57 -0
- package/dist/e2e-harness/safe-run-cli.d.ts +17 -0
- package/dist/e2e-harness/safe-run-cli.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run-cli.js +43 -0
- package/dist/e2e-harness/safe-run.d.ts +61 -0
- package/dist/e2e-harness/safe-run.d.ts.map +1 -0
- package/dist/e2e-harness/safe-run.js +172 -0
- package/dist/e2e-harness/scenario.d.ts +11 -0
- package/dist/e2e-harness/scenario.d.ts.map +1 -0
- package/dist/e2e-harness/scenario.js +89 -0
- package/dist/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/dist/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/dist/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/dist/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/dist/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/dist/e2e-harness/schemas/index.d.ts +191 -0
- package/dist/e2e-harness/schemas/index.d.ts.map +1 -0
- package/dist/e2e-harness/schemas/index.js +62 -0
- package/dist/e2e-harness/stack.d.ts +124 -0
- package/dist/e2e-harness/stack.d.ts.map +1 -0
- package/dist/e2e-harness/stack.js +207 -0
- package/dist/e2e-harness/steps.d.ts +11 -0
- package/dist/e2e-harness/steps.d.ts.map +1 -0
- package/dist/e2e-harness/steps.js +22 -0
- package/dist/e2e-harness.d.ts +3 -0
- package/dist/e2e-harness.d.ts.map +1 -0
- package/dist/e2e-harness.js +2 -0
- package/dist/exit-codes.d.ts +7 -1
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +7 -1
- package/dist/lexicon.d.ts +55 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +2 -3
- package/dist/lifecycle/gated-request.d.ts.map +1 -1
- package/dist/lifecycle/gated-request.js +1 -2
- package/dist/lifecycle/git.d.ts +39 -3
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +223 -15
- package/dist/lifecycle/lock-rows.d.ts +23 -0
- package/dist/lifecycle/lock-rows.d.ts.map +1 -1
- package/dist/lifecycle/lock-rows.js +47 -8
- package/dist/lifecycle/query.d.ts.map +1 -1
- package/dist/lifecycle/query.js +4 -5
- package/dist/lifecycle/release-catalog.d.ts.map +1 -1
- package/dist/lifecycle/release-catalog.js +1 -1
- package/dist/lifecycle/release-ledger.d.ts.map +1 -1
- package/dist/lifecycle/release-ledger.js +1 -2
- package/dist/lifecycle/release-status.d.ts +20 -0
- package/dist/lifecycle/release-status.d.ts.map +1 -1
- package/dist/lifecycle/release-status.js +1 -22
- package/dist/lifecycle/resource-lock.d.ts +70 -0
- package/dist/lifecycle/resource-lock.d.ts.map +1 -1
- package/dist/lifecycle/resource-lock.js +241 -5
- package/dist/lifecycle/wave-plans.d.ts +23 -7
- package/dist/lifecycle/wave-plans.d.ts.map +1 -1
- package/dist/lifecycle/wave-plans.js +9 -2
- package/dist/op/approval-status.d.ts +103 -0
- package/dist/op/approval-status.d.ts.map +1 -0
- package/dist/op/approval-status.js +197 -0
- package/dist/op/gate.js +21 -4
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/op-waves-capability-spec.d.ts +8 -0
- package/dist/op/op-waves-capability-spec.d.ts.map +1 -1
- package/dist/op/op-waves-capability-spec.js +21 -0
- package/dist/op/op-waves-release-port.js +1 -1
- package/dist/op/op-waves-release.d.ts +2 -1
- package/dist/op/op-waves-release.d.ts.map +1 -1
- package/dist/op/op-waves-release.js +1 -2
- package/dist/op/op-waves-run.d.ts +15 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +195 -31
- package/dist/op/op-waves-stand-down.d.ts.map +1 -1
- package/dist/op/op-waves-stand-down.js +1 -2
- package/dist/op/op-waves.d.ts +53 -0
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +62 -6
- package/dist/op/runtime.d.ts +4 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/runtime.js +2 -3
- package/dist/otlp.d.ts.map +1 -1
- package/dist/otlp.js +1 -2
- package/dist/parallelism.d.ts +17 -0
- package/dist/parallelism.d.ts.map +1 -0
- package/dist/parallelism.js +33 -0
- package/dist/policy-source.d.ts.map +1 -1
- package/dist/policy-source.js +1 -2
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +56 -39
- package/dist/pr-loop.d.ts +9 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +22 -4
- package/dist/pr-merge.d.ts +64 -0
- package/dist/pr-merge.d.ts.map +1 -0
- package/dist/pr-merge.js +78 -0
- package/dist/pr-post.d.ts +70 -1
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +116 -5
- package/dist/pr-report-url.d.ts.map +1 -1
- package/dist/pr-report-url.js +1 -2
- package/dist/release-floors.d.ts +1 -1
- package/dist/release-floors.js +1 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/run-event.js +1 -2
- package/dist/scheduled-op-cloud.d.ts +32 -0
- package/dist/scheduled-op-cloud.d.ts.map +1 -0
- package/dist/scheduled-op-cloud.js +69 -0
- package/dist/wave-runtime.mjs +351 -328
- package/dist/workspace/ci-lock-grain.d.ts +5 -0
- package/dist/workspace/ci-lock-grain.d.ts.map +1 -1
- package/dist/workspace/ci-lock-grain.js +1 -7
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +5 -1
- package/dist/workspace/pr-report.schema.json +5 -0
- package/package.json +1 -1
- package/src/ci-agent.ts +1 -2
- package/src/ci-audit/__fixtures__/cloudtrail-lookup-bucket.json +37 -0
- package/src/ci-audit/__fixtures__/cloudtrail-writes-window.json +59 -0
- package/src/ci-audit/attribution.ts +260 -0
- package/src/ci-audit/audit-log.ts +220 -0
- package/src/ci-audit/ci-audit.test.ts +175 -0
- package/src/ci-audit/index.ts +14 -0
- package/src/ci-audit/unrecorded.ts +140 -0
- package/src/ci-audit.ts +2 -0
- package/src/ci-control.ts +3 -4
- package/src/ci-estate.ts +1 -2
- package/src/ci-identity-database.test.ts +2 -3
- package/src/ci-identity-targets.test.ts +1 -3
- package/src/ci-identity.ts +2 -3
- package/src/ci-job-guard.test.ts +154 -0
- package/src/ci-job-guard.ts +319 -0
- package/src/ci-jobs.ts +8 -0
- package/src/ci-product-comment-targets.test.ts +45 -0
- package/src/ci-product-words.ts +35 -6
- package/src/ci-product.ts +55 -4
- package/src/ci-respond-run.ts +291 -0
- package/src/ci-respond.test.ts +264 -0
- package/src/ci-respond.ts +412 -0
- package/src/cli/handlers/audit-log.ts +74 -0
- package/src/cli/handlers/build-pr-loop-flags.test.ts +98 -0
- package/src/cli/handlers/build.ts +69 -0
- package/src/cli/handlers/ci-check-job.test.ts +114 -0
- package/src/cli/handlers/ci-check-job.ts +33 -0
- package/src/cli/handlers/ci-check.ts +38 -8
- package/src/cli/handlers/e2e-safe-run.ts +27 -0
- package/src/cli/handlers/lifecycle.ts +13 -0
- package/src/cli/handlers/pr-before-merge.test.ts +1 -1
- package/src/cli/handlers/pr-deploy-inputs.test.ts +1 -1
- package/src/cli/handlers/pr-endpoint.test.ts +1 -1
- package/src/cli/handlers/pr-green.test.ts +1 -1
- package/src/cli/handlers/pr-plan-comment-targets.test.ts +166 -0
- package/src/cli/handlers/pr-plan-flags.test.ts +161 -0
- package/src/cli/handlers/pr-plan-targets.test.ts +1 -1
- package/src/cli/handlers/pr-record.test.ts +34 -2
- package/src/cli/handlers/pr-waves-blocked.test.ts +1 -1
- package/src/cli/handlers/pr-waves.test.ts +1 -1
- package/src/cli/handlers/pr.test.ts +1 -1
- package/src/cli/handlers/pr.ts +311 -32
- package/src/cli/handlers/run-wave.ts +79 -1
- package/src/cli/main.test.ts +1 -1
- package/src/cli/main.ts +56 -2
- package/src/cli/parse-args.ts +77 -0
- package/src/cli/registry.ts +38 -0
- package/src/components/adoption.ts +1 -2
- package/src/components/auto-release.test.ts +4 -2
- package/src/components/auto-release.ts +9 -5
- package/src/components/capability.ts +60 -0
- package/src/components/check-hooks.ts +4 -1
- package/src/components/check-steps.test.ts +70 -0
- package/src/components/check-steps.ts +158 -0
- package/src/components/ci-services.ts +1 -2
- package/src/components/deploy-units.test.ts +18 -1
- package/src/components/deploy-units.ts +26 -1
- package/src/components/driver.ts +35 -1
- package/src/components/groups.ts +4 -2
- package/src/components/plan-flags.test.ts +46 -0
- package/src/components/pr-comment-preview-targets.test.ts +34 -0
- package/src/components/pr-env-ledger.ts +1 -2
- package/src/components/pr-env-run-bundle.test.ts +0 -20
- package/src/components/pr-environment.ts +1 -1
- package/src/components/pr-pipeline-runners.test.ts +80 -0
- package/src/components/pr-pipeline.ts +244 -20
- package/src/components/pr-run.ts +17 -6
- package/src/components/pr-stale-job.test.ts +34 -0
- package/src/components/product-pipeline.ts +50 -8
- package/src/components/row-lease.test.ts +61 -1
- package/src/components/row-lease.ts +48 -7
- package/src/components/wave-plan.ts +18 -2
- package/src/e2e-harness/__project__/chant.config.ts +4 -0
- package/src/e2e-harness/__project__/src/compose.ts +33 -0
- package/src/e2e-harness/bucket.ts +69 -0
- package/src/e2e-harness/claim.test.ts +150 -0
- package/src/e2e-harness/claim.ts +140 -0
- package/src/e2e-harness/driver.test.ts +304 -0
- package/src/e2e-harness/driver.ts +294 -0
- package/src/e2e-harness/forgejo.ts +267 -0
- package/src/e2e-harness/git.ts +96 -0
- package/src/e2e-harness/index.ts +49 -0
- package/src/e2e-harness/jobs.ts +35 -0
- package/src/e2e-harness/pins.ts +52 -0
- package/src/e2e-harness/ports.ts +130 -0
- package/src/e2e-harness/reports.ts +79 -0
- package/src/e2e-harness/safe-run-cli.test.ts +102 -0
- package/src/e2e-harness/safe-run-cli.ts +54 -0
- package/src/e2e-harness/safe-run.ts +198 -0
- package/src/e2e-harness/scenario.ts +89 -0
- package/src/e2e-harness/schemas/README.md +62 -0
- package/src/e2e-harness/schemas/demo-cycle.schema.json +282 -0
- package/src/e2e-harness/schemas/demo-step.schema.json +245 -0
- package/src/e2e-harness/schemas/e2e-claim-row.schema.json +33 -0
- package/src/e2e-harness/schemas/e2e-claims.schema.json +18 -0
- package/src/e2e-harness/schemas/e2e-scenario.schema.json +150 -0
- package/src/e2e-harness/schemas/index.ts +220 -0
- package/src/e2e-harness/schemas.test.ts +145 -0
- package/src/e2e-harness/stack.test.ts +124 -0
- package/src/e2e-harness/stack.ts +306 -0
- package/src/e2e-harness/steps.ts +30 -0
- package/src/e2e-harness.ts +2 -0
- package/src/exit-codes.test.ts +3 -2
- package/src/exit-codes.ts +7 -1
- package/src/gate-decision-bundle.test.ts +0 -2
- package/src/lexicon.ts +57 -0
- package/src/lifecycle/control-entries-ledger.test.ts +2 -3
- package/src/lifecycle/gate-ledger.ts +2 -3
- package/src/lifecycle/gated-request.ts +1 -2
- package/src/lifecycle/git.test.ts +155 -0
- package/src/lifecycle/git.ts +213 -17
- package/src/lifecycle/lock-rows.test.ts +6 -1
- package/src/lifecycle/lock-rows.ts +58 -7
- package/src/lifecycle/query.ts +4 -5
- package/src/lifecycle/release-catalog.test.ts +3 -4
- package/src/lifecycle/release-catalog.ts +1 -1
- package/src/lifecycle/release-ledger.ts +1 -2
- package/src/lifecycle/release-status.test.ts +3 -4
- package/src/lifecycle/release-status.ts +1 -2
- package/src/lifecycle/resource-lock-wait.test.ts +292 -0
- package/src/lifecycle/resource-lock.ts +261 -7
- package/src/lifecycle/wave-plans.ts +33 -5
- package/src/op/approval-status.test.ts +134 -0
- package/src/op/approval-status.ts +235 -0
- package/src/op/gate-review.test.ts +2 -1
- package/src/op/gate.test.ts +7 -5
- package/src/op/gate.ts +20 -4
- package/src/op/index.ts +2 -0
- package/src/op/op-waves-after-plan.test.ts +11 -0
- package/src/op/op-waves-capability-spec.ts +20 -0
- package/src/op/op-waves-ledger-lock.test.ts +208 -0
- package/src/op/op-waves-parallelism.test.ts +89 -0
- package/src/op/op-waves-pull-request.test.ts +78 -1
- package/src/op/op-waves-release-port.ts +1 -1
- package/src/op/op-waves-release.ts +2 -3
- package/src/op/op-waves-run.ts +196 -31
- package/src/op/op-waves-stand-down.ts +1 -2
- package/src/op/op-waves.ts +81 -6
- package/src/op/runtime.ts +6 -3
- package/src/otlp.ts +1 -2
- package/src/parallelism.test.ts +38 -0
- package/src/parallelism.ts +33 -0
- package/src/policy-source.ts +1 -2
- package/src/pr-forge-bundle.test.ts +1 -1
- package/src/pr-forge.ts +54 -35
- package/src/pr-loop-bundle.test.ts +0 -2
- package/src/pr-loop-narrowed.test.ts +63 -0
- package/src/pr-loop.ts +30 -4
- package/src/pr-merge.test.ts +100 -0
- package/src/pr-merge.ts +105 -0
- package/src/pr-post-stale.test.ts +163 -0
- package/src/pr-post.ts +159 -5
- package/src/pr-report-url.ts +1 -2
- package/src/product-subpaths-plain-node.e2e.test.ts +1 -0
- package/src/release-floors.ts +1 -1
- package/src/run-event.ts +1 -2
- package/src/scheduled-op-cloud.ts +68 -0
- package/src/stage-hooks-bundle.test.ts +0 -2
- package/src/workspace/ci-lock-grain.ts +1 -2
- package/src/workspace/ci-run.ts +5 -1
- package/src/workspace/pr-report.schema.json +5 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The harness's one no-real-cloud wrapper (chant#4587), with plunge's rule
|
|
3
|
+
* (scripts/plunge-safe-run.sh, scripts/plunge-races/record.sh:8-11): every
|
|
4
|
+
* process a scenario starts runs with no real cloud credential in reach, its
|
|
5
|
+
* output is logged, and a run whose log shows a real cloud answering is
|
|
6
|
+
* never recorded. A row is written only after a CLEAN scan.
|
|
7
|
+
*
|
|
8
|
+
* What a command runs with: every AWS_*, AZURE_*, ARM_*, GOOGLE_*, CLOUDSDK_*
|
|
9
|
+
* and GCE_* variable unset (GOOGLE_APPLICATION_CREDENTIALS among them), then
|
|
10
|
+
* floci's test credentials, empty AWS config files, an empty CLOUDSDK_CONFIG
|
|
11
|
+
* and AZURE_CONFIG_DIR, a closed loopback GCE metadata host, no
|
|
12
|
+
* PULUMI_ACCESS_TOKEN, and a file:// Pulumi backend in the scratch
|
|
13
|
+
* directory (a backend already set is kept only when it is local).
|
|
14
|
+
*
|
|
15
|
+
* The scan looks for what a real cloud answers to a fake or missing
|
|
16
|
+
* credential, which no emulator says: UnrecognizedClientException,
|
|
17
|
+
* InvalidClientTokenId, invalid_grant, AADSTS, CREDENTIALS_MISSING, and a 401
|
|
18
|
+
* on a line naming googleapis.com, amazonaws.com, azure.com or windows.net.
|
|
19
|
+
*/
|
|
20
|
+
import { spawn } from "node:child_process";
|
|
21
|
+
import { appendFileSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
22
|
+
import { join } from "node:path";
|
|
23
|
+
import type { OpRunRecordInput } from "../op/runtime";
|
|
24
|
+
import type { RunOrigin } from "../lifecycle/release-ledger";
|
|
25
|
+
import { claimRunRecordInput } from "./claim";
|
|
26
|
+
import type { ClaimRun } from "./driver";
|
|
27
|
+
import type { OutOfBand } from "./ports";
|
|
28
|
+
import type { ClaimRow } from "./schemas/index";
|
|
29
|
+
|
|
30
|
+
/** The prefixes of every variable a cloud SDK reads credentials or config from. */
|
|
31
|
+
export const CLOUD_ENV_PREFIXES = ["AWS_", "AZURE_", "ARM_", "GOOGLE_", "CLOUDSDK_", "GCE_"] as const;
|
|
32
|
+
|
|
33
|
+
const MARKERS = /UnrecognizedClientException|InvalidClientTokenId|invalid_grant|AADSTS[0-9]*|CREDENTIALS_MISSING/;
|
|
34
|
+
const CLOUD_HOSTS = /googleapis\.com|amazonaws\.com|azure\.com|windows\.net/;
|
|
35
|
+
const FOUR_OH_ONE = /(^|[^0-9])401([^0-9]|$)/;
|
|
36
|
+
|
|
37
|
+
/** A backend URL a run may keep: local files, or a bucket store on a loopback emulator. */
|
|
38
|
+
export function backendIsLocal(url: string, env: Record<string, string | undefined> = {}): boolean {
|
|
39
|
+
if (url.startsWith("file://") || url.startsWith("plunge+file://")) return true;
|
|
40
|
+
if (url.startsWith("plunge+s3://") || url.startsWith("plunge+azblob://")) {
|
|
41
|
+
return /[?&](endpoint=https?(:\/\/|%3A%2F%2F)(localhost|127\.0\.0\.1)([:/%]|$|&)|metadata_host=(localhost|127\.0\.0\.1)(:|%3A))/.test(url);
|
|
42
|
+
}
|
|
43
|
+
if (url.startsWith("plunge+gs://")) return /^(localhost|127\.0\.0\.1):[0-9]+$/.test(env.STORAGE_EMULATOR_HOST ?? "");
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface SafeEnvOptions {
|
|
48
|
+
/** The scratch directory for the empty config locations and the state. */
|
|
49
|
+
scratch: string;
|
|
50
|
+
/** Variables set after the scrub: an emulator endpoint, BREAK=1. GOOGLE_APPLICATION_CREDENTIALS is refused. */
|
|
51
|
+
extra?: Record<string, string>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The environment a scenario's processes run with, from `base` (default process.env). */
|
|
55
|
+
export function safeRunEnv(o: SafeEnvOptions, base: Record<string, string | undefined> = process.env): Record<string, string> {
|
|
56
|
+
for (const k of Object.keys(o.extra ?? {})) {
|
|
57
|
+
if (k === "GOOGLE_APPLICATION_CREDENTIALS") throw new Error("GOOGLE_APPLICATION_CREDENTIALS is refused: no credentials file may be in reach of a run");
|
|
58
|
+
}
|
|
59
|
+
const backend = base.PULUMI_BACKEND_URL;
|
|
60
|
+
if (backend && !backendIsLocal(backend, base)) {
|
|
61
|
+
throw new Error(`PULUMI_BACKEND_URL=${backend} is not a local backend (file://, plunge+file://, or a plunge store on a loopback emulator)`);
|
|
62
|
+
}
|
|
63
|
+
mkdirSync(o.scratch, { recursive: true });
|
|
64
|
+
const dir = mkdtempSync(join(o.scratch, "env-"));
|
|
65
|
+
for (const d of ["gcloud", "azure", "state"]) mkdirSync(join(dir, d), { recursive: true });
|
|
66
|
+
writeFileSync(join(dir, "aws-config"), "");
|
|
67
|
+
writeFileSync(join(dir, "aws-credentials"), "");
|
|
68
|
+
|
|
69
|
+
const env: Record<string, string> = {};
|
|
70
|
+
for (const [k, v] of Object.entries(base)) {
|
|
71
|
+
if (v === undefined || k === "PULUMI_ACCESS_TOKEN") continue;
|
|
72
|
+
if (CLOUD_ENV_PREFIXES.some((p) => k.startsWith(p))) continue;
|
|
73
|
+
env[k] = v;
|
|
74
|
+
}
|
|
75
|
+
Object.assign(env, {
|
|
76
|
+
AWS_ACCESS_KEY_ID: "test",
|
|
77
|
+
AWS_SECRET_ACCESS_KEY: "test",
|
|
78
|
+
AWS_REGION: "us-east-1",
|
|
79
|
+
AWS_EC2_METADATA_DISABLED: "true",
|
|
80
|
+
AWS_CONFIG_FILE: join(dir, "aws-config"),
|
|
81
|
+
AWS_SHARED_CREDENTIALS_FILE: join(dir, "aws-credentials"),
|
|
82
|
+
CLOUDSDK_CONFIG: join(dir, "gcloud"),
|
|
83
|
+
AZURE_CONFIG_DIR: join(dir, "azure"),
|
|
84
|
+
GCE_METADATA_HOST: "127.0.0.1:9",
|
|
85
|
+
PULUMI_SKIP_UPDATE_CHECK: "true",
|
|
86
|
+
PULUMI_SKIP_CONFIRMATIONS: "true",
|
|
87
|
+
PULUMI_BACKEND_URL: backend ?? `file://${join(dir, "state")}`,
|
|
88
|
+
});
|
|
89
|
+
Object.assign(env, o.extra ?? {});
|
|
90
|
+
return env;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** The lines of `text` a real cloud wrote, as `<where>:<line>:<text>`. */
|
|
94
|
+
export function realCloudHits(text: string, where = "log"): string[] {
|
|
95
|
+
const out: string[] = [];
|
|
96
|
+
text.split("\n").forEach((line, i) => {
|
|
97
|
+
if (MARKERS.test(line) || (FOUR_OH_ONE.test(line) && CLOUD_HOSTS.test(line))) out.push(`${where}:${i + 1}:${line}`);
|
|
98
|
+
});
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export type SafeVerdict = { verdict: "CLEAN" } | { verdict: "REAL-CLOUD"; hits: string[] };
|
|
103
|
+
|
|
104
|
+
function filesUnder(dir: string): string[] {
|
|
105
|
+
const out: string[] = [];
|
|
106
|
+
for (const name of readdirSync(dir)) {
|
|
107
|
+
const p = join(dir, name);
|
|
108
|
+
if (statSync(p).isDirectory()) out.push(...filesUnder(p));
|
|
109
|
+
else out.push(p);
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* One scenario's wrapper: the scrubbed environment, the log every process's
|
|
116
|
+
* output goes to, and the scan at the end. A directory named in `scan` that
|
|
117
|
+
* does not exist when the scan runs is a hit, since it could not be checked.
|
|
118
|
+
*/
|
|
119
|
+
export class SafeRun {
|
|
120
|
+
readonly env: Record<string, string>;
|
|
121
|
+
readonly logFile: string;
|
|
122
|
+
|
|
123
|
+
constructor(private readonly o: SafeEnvOptions & { logFile?: string; scan?: string[]; echo?: boolean }, base: Record<string, string | undefined> = process.env) {
|
|
124
|
+
this.env = safeRunEnv(o, base);
|
|
125
|
+
this.logFile = o.logFile ?? join(o.scratch, "safe-run.log");
|
|
126
|
+
appendFileSync(this.logFile, `e2e-safe-run: ${new Date().toISOString()} PULUMI_BACKEND_URL=${this.env.PULUMI_BACKEND_URL} CLOUDSDK_CONFIG=${this.env.CLOUDSDK_CONFIG}\n`);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
log(line: string): void {
|
|
130
|
+
appendFileSync(this.logFile, line.endsWith("\n") ? line : `${line}\n`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Run a command with the scrubbed environment, its output teed to the log. Resolves with its exit code. */
|
|
134
|
+
run(command: string[], extra: Record<string, string> = {}): Promise<number> {
|
|
135
|
+
const [file, ...args] = command;
|
|
136
|
+
if (!file) return Promise.reject(new Error("no command to run"));
|
|
137
|
+
this.log(`e2e-safe-run: command: ${command.map((a) => JSON.stringify(a)).join(" ")}`);
|
|
138
|
+
return new Promise((resolve, reject) => {
|
|
139
|
+
const child = spawn(file, args, { env: { ...this.env, ...extra }, stdio: ["ignore", "pipe", "pipe"] });
|
|
140
|
+
child.stdout.on("data", (b: Buffer) => {
|
|
141
|
+
appendFileSync(this.logFile, b);
|
|
142
|
+
if (this.o.echo) process.stdout.write(b);
|
|
143
|
+
});
|
|
144
|
+
child.stderr.on("data", (b: Buffer) => {
|
|
145
|
+
appendFileSync(this.logFile, b);
|
|
146
|
+
if (this.o.echo) process.stderr.write(b);
|
|
147
|
+
});
|
|
148
|
+
child.on("error", reject);
|
|
149
|
+
child.on("close", (code) => resolve(code ?? 1));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** Out-of-band steps, run through this wrapper. */
|
|
154
|
+
outOfBand(): OutOfBand {
|
|
155
|
+
return { run: (command) => this.run(command) };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** The scan of the log and every `scan` directory. Writes the verdict line to the log. */
|
|
159
|
+
scan(extraDirs: string[] = []): SafeVerdict {
|
|
160
|
+
const hits = realCloudHits(readFileSync(this.logFile, "utf8"), this.logFile);
|
|
161
|
+
for (const d of [...(this.o.scan ?? []), ...extraDirs]) {
|
|
162
|
+
if (!existsSync(d)) {
|
|
163
|
+
hits.push(`${d}: the scan directory does not exist after the run, so it could not be checked`);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
for (const f of filesUnder(d)) if (f !== this.logFile) hits.push(...realCloudHits(readFileSync(f, "utf8"), f));
|
|
167
|
+
}
|
|
168
|
+
if (hits.length > 0) {
|
|
169
|
+
this.log(`e2e-safe-run: REAL-CLOUD CALL: the output shows a public cloud rejecting a credential, so a call left this machine. This run is not recorded.\n${hits.map((h) => ` ${h}`).join("\n")}`);
|
|
170
|
+
return { verdict: "REAL-CLOUD", hits };
|
|
171
|
+
}
|
|
172
|
+
this.log("e2e-safe-run: CLEAN");
|
|
173
|
+
return { verdict: "CLEAN" };
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface RecordClaimInput {
|
|
178
|
+
row: ClaimRow;
|
|
179
|
+
run: ClaimRun;
|
|
180
|
+
/** The scan of the run. Anything but CLEAN is refused and nothing is written. */
|
|
181
|
+
verdict: SafeVerdict;
|
|
182
|
+
/** Append the run record to the ledger (appendRunRecord, then push chant/lifecycle). */
|
|
183
|
+
append(input: OpRunRecordInput): Promise<void>;
|
|
184
|
+
env?: string;
|
|
185
|
+
gitSha?: string;
|
|
186
|
+
runOrigin?: RunOrigin;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** Record a claim run on the ledger, only after a CLEAN scan. */
|
|
190
|
+
export async function recordClaimRow(i: RecordClaimInput): Promise<OpRunRecordInput> {
|
|
191
|
+
if (i.verdict.verdict !== "CLEAN") {
|
|
192
|
+
throw new Error(`refusing to record ${i.row.scenario}/${i.row.claim}: the no-real-cloud scan found ${i.verdict.hits.length} real-cloud line(s)`);
|
|
193
|
+
}
|
|
194
|
+
if (i.row.safeRun !== "CLEAN") throw new Error(`refusing to record ${i.row.scenario}/${i.row.claim}: its row does not say CLEAN`);
|
|
195
|
+
const input = claimRunRecordInput({ row: i.row, run: i.run, env: i.env, gitSha: i.gitSha, runOrigin: i.runOrigin });
|
|
196
|
+
await i.append(input);
|
|
197
|
+
return input;
|
|
198
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scenario file (e2e-scenario/v1, chant#4587) and its lint. A scenario is
|
|
3
|
+
* a repo tree, an ordered list of pull request steps, and the outcomes each
|
|
4
|
+
* step must show. The lint refuses one that cannot record a row: no claim
|
|
5
|
+
* id, no BREAK arm, nothing to check, or a step that names a pull request or
|
|
6
|
+
* a merge no earlier step made.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { validateScenario, type Scenario, type ScenarioStep } from "./schemas/index";
|
|
10
|
+
|
|
11
|
+
export interface ScenarioFinding {
|
|
12
|
+
/** Where, as a JSON pointer into the file. */
|
|
13
|
+
at: string;
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Every reason `data` is not a scenario the driver can run and record. Empty when it is one. */
|
|
18
|
+
export function lintScenario(data: unknown): ScenarioFinding[] {
|
|
19
|
+
const out: ScenarioFinding[] = [];
|
|
20
|
+
const doc = (data ?? {}) as Partial<Scenario> & Record<string, unknown>;
|
|
21
|
+
// The two refusals the protocol rests on, said plainly before the schema's wording.
|
|
22
|
+
if (typeof doc.claim !== "string" || doc.claim.trim() === "") out.push({ at: "/claim", message: "the scenario has no claim id, so its run would record a row for nothing" });
|
|
23
|
+
if (doc.break === undefined || doc.break === null) out.push({ at: "/break", message: "the scenario has no BREAK arm, so nothing shows its outcomes can fail" });
|
|
24
|
+
else if ((doc.break as { env?: Record<string, string> }).env?.BREAK !== "1") out.push({ at: "/break/env/BREAK", message: 'the BREAK arm must set BREAK to "1"' });
|
|
25
|
+
|
|
26
|
+
const v = validateScenario(data);
|
|
27
|
+
if (!v.ok) {
|
|
28
|
+
for (const e of v.errors) {
|
|
29
|
+
const [at, ...rest] = e.split(" ");
|
|
30
|
+
if ((at === "/" && /claim|break/.test(e)) || at!.startsWith("/break")) continue;
|
|
31
|
+
out.push({ at: at!, message: rest.join(" ") });
|
|
32
|
+
}
|
|
33
|
+
return out;
|
|
34
|
+
}
|
|
35
|
+
const s = v.value;
|
|
36
|
+
|
|
37
|
+
const seen = new Map<string, ScenarioStep>();
|
|
38
|
+
let expectations = 0;
|
|
39
|
+
s.steps.forEach((step, i) => {
|
|
40
|
+
const at = `/steps/${i}`;
|
|
41
|
+
if (seen.has(step.id)) out.push({ at: `${at}/id`, message: `step id ${step.id} is used twice` });
|
|
42
|
+
const opened = (id: string) => {
|
|
43
|
+
const o = seen.get(id);
|
|
44
|
+
return o !== undefined && (o.do === "open" || o.do === "open-concurrent");
|
|
45
|
+
};
|
|
46
|
+
switch (step.do) {
|
|
47
|
+
case "open-concurrent": {
|
|
48
|
+
const prev = s.steps[i - 1];
|
|
49
|
+
if (!prev || (prev.do !== "open" && prev.do !== "open-concurrent")) {
|
|
50
|
+
out.push({ at: `${at}/do`, message: "open-concurrent opens beside the step before it, which must be an open" });
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case "plan":
|
|
55
|
+
case "approve":
|
|
56
|
+
case "merge":
|
|
57
|
+
if (!opened(step.pull)) out.push({ at: `${at}/pull`, message: `${step.do} names ${step.pull}, which is not an earlier open step` });
|
|
58
|
+
break;
|
|
59
|
+
case "apply": {
|
|
60
|
+
const m = seen.get(step.merge);
|
|
61
|
+
if (!m || m.do !== "merge") out.push({ at: `${at}/merge`, message: `apply names ${step.merge}, which is not an earlier merge step` });
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
default:
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
for (const [j, e] of (step.expect ?? []).entries()) {
|
|
68
|
+
expectations++;
|
|
69
|
+
if ("report" in e && step.do !== "plan" && step.do !== "apply") {
|
|
70
|
+
out.push({ at: `${at}/expect/${j}`, message: `a report outcome belongs on a plan or apply step, not ${step.do}` });
|
|
71
|
+
}
|
|
72
|
+
if ("comment" in e && !("pull" in step) && step.do !== "open" && step.do !== "open-concurrent") {
|
|
73
|
+
out.push({ at: `${at}/expect/${j}`, message: "a comment outcome belongs on a step with a pull request" });
|
|
74
|
+
}
|
|
75
|
+
if ("exit" in e && step.do !== "out-of-band") out.push({ at: `${at}/expect/${j}`, message: "an exit outcome belongs on an out-of-band step" });
|
|
76
|
+
}
|
|
77
|
+
seen.set(step.id, step);
|
|
78
|
+
});
|
|
79
|
+
if (expectations === 0) out.push({ at: "/steps", message: "no step expects anything, so the plain run would pass and the BREAK run could never be caught" });
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Read and lint a scenario file. Throws with every finding when it is not one. */
|
|
84
|
+
export function loadScenario(path: string): Scenario {
|
|
85
|
+
const data = JSON.parse(readFileSync(path, "utf8")) as unknown;
|
|
86
|
+
const findings = lintScenario(data);
|
|
87
|
+
if (findings.length > 0) throw new Error(`${path} is not a scenario the harness runs:\n${findings.map((f) => ` ${f.at}: ${f.message}`).join("\n")}`);
|
|
88
|
+
return data as Scenario;
|
|
89
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# e2e harness schemas
|
|
2
|
+
|
|
3
|
+
JSON Schemas (draft 2020-12) of the e2e harness (chant#4587). `index.ts` exports their types and validators. The two demo schemas came from `examples/fan-out-estate/demo/schemas/`, where the fan-out demo's driver (#4091) and its readers (behold) use them; their design is INTENTIUS/chant#4085, section 3.
|
|
4
|
+
|
|
5
|
+
| Schema | Written to | When |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `demo-step.schema.json` (`demo-step/v1`) | a demo's `step.json`, such as `s3://chant-demo/fan-out-estate/step.json` | at every step of a cycle |
|
|
8
|
+
| `demo-cycle.schema.json` (`demo-cycle/v1`) | `cycles/latest.json` and `cycles/<cycle>.json`, newest five | at reset, full cycles only |
|
|
9
|
+
| `e2e-scenario.schema.json` (`e2e-scenario/v1`) | a product's scenario files | by hand; `lintScenario` checks them |
|
|
10
|
+
| `e2e-claim-row.schema.json` (`e2e-claim-row/v1`) | the `claim` outcome of an `e2e-claim` run record on the ledger (#4551) | once per claim run, after a CLEAN scan |
|
|
11
|
+
| `e2e-claims.schema.json` (`e2e-claims/v1`) | the file a product's page reads | rendered from the ledger by `renderClaims` |
|
|
12
|
+
|
|
13
|
+
## demo-step/v1
|
|
14
|
+
|
|
15
|
+
| Field | Required | Meaning |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `$schema` | yes | The schema's `$id`. |
|
|
18
|
+
| `contract` | yes | `1`. |
|
|
19
|
+
| `demo` | yes | `fan-out-estate`. |
|
|
20
|
+
| `cycle` | yes | Cycle number. |
|
|
21
|
+
| `step` | yes | One of pull-request, planned, waiting, approved, merged, applying, failed, resumed, applied, reset, stalled. |
|
|
22
|
+
| `repo` | no | Forge repository, `chant-demo/fan-out-estate`. |
|
|
23
|
+
| `scenario`, `name`, `title`, `label` | no | Scenario id, display name, story title, one line narrating the step. |
|
|
24
|
+
| `highlight` | no | `{title, body}` or null: a call-out a viewer may show as a modal at the step that earns one. Cycle step items carry it too. |
|
|
25
|
+
| `chapter` | no | `{n, of, headline, short}` or null. Null only on the base and on a stall before the first step. |
|
|
26
|
+
| `started_at`, `at` | no | When the cycle started and when this step was written. |
|
|
27
|
+
| `next` | no | `{action, from, at}`: the driver's next action after the hold. |
|
|
28
|
+
| `pull`, `commit` | no | Pull request number and the commit the step concerns. |
|
|
29
|
+
| `reports` | no | `{url, plan?, apply?}`. `plan` and `apply` are `reportKey(pr, commit)` keys (`<pr>/<commit>`) below `url`. |
|
|
30
|
+
| `about` | no | `{changes, watch, shows}` cards. |
|
|
31
|
+
|
|
32
|
+
## demo-cycle/v1
|
|
33
|
+
|
|
34
|
+
| Field | Required | Meaning |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| `$schema`, `contract`, `demo`, `cycle` | yes | As above. |
|
|
37
|
+
| `steps` | yes | The step records as written, each with `at`. `step` and `at` are required in each. |
|
|
38
|
+
| `repo`, `started`, `ended` | no | Repository and the cycle's start and end. |
|
|
39
|
+
| `reports` | no | `[{stage, pr, commit, key}]`, stage `plan` or `apply`, `key` from `reportKey(pr, commit)`. |
|
|
40
|
+
|
|
41
|
+
## e2e-scenario/v1
|
|
42
|
+
|
|
43
|
+
| Field | Required | Meaning |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `$schema`, `contract` | yes | The schema's `$id`, and `1`. |
|
|
46
|
+
| `id`, `product`, `claim` | yes | The scenario id, the product that drives it, and the claim id its row records. |
|
|
47
|
+
| `tree` | yes | `{base, overlays?}`: the repo the forge serves and the overlays steps copy over it, relative to the file. |
|
|
48
|
+
| `reportUrl` | yes | The pipeline's `--report-url`, `s3://<bucket>/<prefix>`. |
|
|
49
|
+
| `env` | no | The chant environment the ledger records runs under. Default `local`. |
|
|
50
|
+
| `limits` | no | Seconds per kind of step, over the defaults in `steps.ts`. |
|
|
51
|
+
| `steps` | yes | In order. `do` is open, open-concurrent, plan, approve, merge, apply, out-of-band or kill-job; each may carry `expect`. |
|
|
52
|
+
| `break` | yes | The BREAK arm: `env` with `BREAK: "1"`, and an optional `overlay` copied over every pull request of the break run. |
|
|
53
|
+
|
|
54
|
+
An outcome in `expect` has one key: `report` (`status`, `components`, `only`) on a plan or apply step, `ledger` (`op`, `status`, `count`), `comment`, `issue` (`title`, `open`), or `exit` on an out-of-band step.
|
|
55
|
+
|
|
56
|
+
## e2e-claim-row/v1 and e2e-claims/v1
|
|
57
|
+
|
|
58
|
+
A row carries `product`, `productCommit` (40 hex), `scenario`, `claim`, `engine` (`binary`, `version`), `floci` (`sha256:` digest), `date` (`YYYY-MM-DD`), `plain` (`pass` or `fail`), `break` (`caught`, `missed` or `stalled`) and `safeRun`, which is always `CLEAN`. `chant` and `runUrl` are optional. e2e-claims/v1 is `{product, rows}`, the newest row per scenario and claim.
|
|
59
|
+
|
|
60
|
+
## Versioning
|
|
61
|
+
|
|
62
|
+
Each contract is versioned like the workspace read contract. Within `contract: 1` a field is only ever added, and a new field is optional. Readers ignore fields they do not know, and a reader treats a step it does not know as one it cannot classify. The `step` enum of demo-step lists what a writer may write in this version; a new step is added to it within contract 1, so a reader never rejects a record for its step. A rename or removal is `contract: 2` with a new `$id` path (`v2`).
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/chant/schemas/demo/demo-cycle/v1/demo-cycle.schema.json",
|
|
4
|
+
"title": "fan-out demo cycle",
|
|
5
|
+
"description": "One finished cycle of the fan-out demo, published at reset to cycles/latest.json and cycles/<cycle>.json, newest five kept. A cycle with a stalled step is never published, so latest is always a full cycle. Version 1 of the demo contract. Required fields are kept to a minimum: a new field is optional within contract 1, readers ignore fields they do not know, and a rename or removal is contract 2.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"$schema",
|
|
9
|
+
"contract",
|
|
10
|
+
"demo",
|
|
11
|
+
"cycle",
|
|
12
|
+
"steps"
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"$schema": {
|
|
16
|
+
"const": "https://intentius.io/chant/schemas/demo/demo-cycle/v1/demo-cycle.schema.json"
|
|
17
|
+
},
|
|
18
|
+
"contract": {
|
|
19
|
+
"const": 1
|
|
20
|
+
},
|
|
21
|
+
"demo": {
|
|
22
|
+
"type": "string"
|
|
23
|
+
},
|
|
24
|
+
"repo": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
"cycle": {
|
|
28
|
+
"type": "integer",
|
|
29
|
+
"minimum": 0
|
|
30
|
+
},
|
|
31
|
+
"started": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "ISO-8601."
|
|
34
|
+
},
|
|
35
|
+
"ended": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "ISO-8601."
|
|
38
|
+
},
|
|
39
|
+
"steps": {
|
|
40
|
+
"type": "array",
|
|
41
|
+
"description": "Each demo-step record as written, with at.",
|
|
42
|
+
"items": {
|
|
43
|
+
"$ref": "#/$defs/cycleStep"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"reports": {
|
|
47
|
+
"type": "array",
|
|
48
|
+
"items": {
|
|
49
|
+
"type": "object",
|
|
50
|
+
"required": [
|
|
51
|
+
"stage",
|
|
52
|
+
"pr",
|
|
53
|
+
"commit",
|
|
54
|
+
"key"
|
|
55
|
+
],
|
|
56
|
+
"properties": {
|
|
57
|
+
"stage": {
|
|
58
|
+
"enum": [
|
|
59
|
+
"plan",
|
|
60
|
+
"apply"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
"pr": {
|
|
64
|
+
"type": "integer",
|
|
65
|
+
"minimum": 1
|
|
66
|
+
},
|
|
67
|
+
"commit": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"pattern": "^[0-9a-f]{40,64}$"
|
|
70
|
+
},
|
|
71
|
+
"key": {
|
|
72
|
+
"type": "string",
|
|
73
|
+
"pattern": "^[0-9]+/[0-9a-f]{40,64}$",
|
|
74
|
+
"description": "reportKey(pr, commit)."
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"description": "Every stage of the cycle, as {stage, pr, commit, key}. In the order the stages ran: a writer appends each stage's key when its report is written, so the first apply of a cycle comes before the fix's."
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"$defs": {
|
|
82
|
+
"cycleStep": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"description": "A demo-step record as written (demo-step/v1), with at. step and at are required here; the rest follows demo-step/v1.",
|
|
85
|
+
"required": [
|
|
86
|
+
"step",
|
|
87
|
+
"at"
|
|
88
|
+
],
|
|
89
|
+
"properties": {
|
|
90
|
+
"demo": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "The demo's name, fan-out-estate."
|
|
93
|
+
},
|
|
94
|
+
"repo": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "The forge repository the demo runs on, <org>/<repo>."
|
|
97
|
+
},
|
|
98
|
+
"cycle": {
|
|
99
|
+
"type": "integer",
|
|
100
|
+
"minimum": 0,
|
|
101
|
+
"description": "The cycle the step belongs to."
|
|
102
|
+
},
|
|
103
|
+
"scenario": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"description": "The scenario the cycle plays, fan-out."
|
|
106
|
+
},
|
|
107
|
+
"name": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "The scenario's display name, for example fifteen stacks."
|
|
110
|
+
},
|
|
111
|
+
"title": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"description": "The story's title, shown on every step."
|
|
114
|
+
},
|
|
115
|
+
"step": {
|
|
116
|
+
"enum": [
|
|
117
|
+
"pull-request",
|
|
118
|
+
"planned",
|
|
119
|
+
"waiting",
|
|
120
|
+
"approved",
|
|
121
|
+
"merged",
|
|
122
|
+
"applying",
|
|
123
|
+
"failed",
|
|
124
|
+
"resumed",
|
|
125
|
+
"applied",
|
|
126
|
+
"reset",
|
|
127
|
+
"stalled"
|
|
128
|
+
],
|
|
129
|
+
"description": "Where the cycle stands. A step set gains a value only as an addition within a version."
|
|
130
|
+
},
|
|
131
|
+
"label": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"description": "One line narrating the step."
|
|
134
|
+
},
|
|
135
|
+
"highlight": {
|
|
136
|
+
"description": "A call-out for the step: the thing that just happened worth stopping on, which a viewer may show as a modal. null or absent when the step has none. Optional within contract 1.",
|
|
137
|
+
"oneOf": [
|
|
138
|
+
{
|
|
139
|
+
"type": "null"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"type": "object",
|
|
143
|
+
"required": [
|
|
144
|
+
"title",
|
|
145
|
+
"body"
|
|
146
|
+
],
|
|
147
|
+
"properties": {
|
|
148
|
+
"title": {
|
|
149
|
+
"type": "string",
|
|
150
|
+
"minLength": 1
|
|
151
|
+
},
|
|
152
|
+
"body": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"minLength": 1
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
"chapter": {
|
|
161
|
+
"oneOf": [
|
|
162
|
+
{
|
|
163
|
+
"type": "null"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"$ref": "#/$defs/chapter"
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
"description": "The chapter the step belongs to. null only on the base and on a stall before the first step; a stall otherwise keeps the chapter before it."
|
|
170
|
+
},
|
|
171
|
+
"started_at": {
|
|
172
|
+
"type": "string",
|
|
173
|
+
"description": "When the cycle started, ISO-8601."
|
|
174
|
+
},
|
|
175
|
+
"at": {
|
|
176
|
+
"type": "string"
|
|
177
|
+
},
|
|
178
|
+
"next": {
|
|
179
|
+
"type": "object",
|
|
180
|
+
"description": "What the driver does after the hold.",
|
|
181
|
+
"properties": {
|
|
182
|
+
"action": {
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
"from": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"description": "When the hold began, ISO-8601."
|
|
188
|
+
},
|
|
189
|
+
"at": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"description": "When the next step is due, ISO-8601."
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"pull": {
|
|
196
|
+
"type": [
|
|
197
|
+
"integer",
|
|
198
|
+
"null"
|
|
199
|
+
],
|
|
200
|
+
"minimum": 1,
|
|
201
|
+
"description": "The pull request number the step concerns, null before one exists."
|
|
202
|
+
},
|
|
203
|
+
"commit": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"pattern": "^[0-9a-f]{40,64}$",
|
|
206
|
+
"description": "The commit the step concerns: the head for a plan, the merge commit for an apply."
|
|
207
|
+
},
|
|
208
|
+
"reports": {
|
|
209
|
+
"$ref": "#/$defs/reports"
|
|
210
|
+
},
|
|
211
|
+
"about": {
|
|
212
|
+
"type": "object",
|
|
213
|
+
"description": "The about cards.",
|
|
214
|
+
"properties": {
|
|
215
|
+
"changes": {
|
|
216
|
+
"type": "string"
|
|
217
|
+
},
|
|
218
|
+
"watch": {
|
|
219
|
+
"type": "string"
|
|
220
|
+
},
|
|
221
|
+
"shows": {
|
|
222
|
+
"type": "string"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"$schema": {
|
|
227
|
+
"const": "https://intentius.io/chant/schemas/demo/demo-step/v1/demo-step.schema.json"
|
|
228
|
+
},
|
|
229
|
+
"contract": {
|
|
230
|
+
"const": 1
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"chapter": {
|
|
235
|
+
"type": "object",
|
|
236
|
+
"required": [
|
|
237
|
+
"n",
|
|
238
|
+
"of",
|
|
239
|
+
"headline",
|
|
240
|
+
"short"
|
|
241
|
+
],
|
|
242
|
+
"properties": {
|
|
243
|
+
"n": {
|
|
244
|
+
"type": "integer",
|
|
245
|
+
"minimum": 1
|
|
246
|
+
},
|
|
247
|
+
"of": {
|
|
248
|
+
"type": "integer",
|
|
249
|
+
"minimum": 1
|
|
250
|
+
},
|
|
251
|
+
"headline": {
|
|
252
|
+
"type": "string"
|
|
253
|
+
},
|
|
254
|
+
"short": {
|
|
255
|
+
"type": "string"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"reports": {
|
|
260
|
+
"type": "object",
|
|
261
|
+
"required": [
|
|
262
|
+
"url"
|
|
263
|
+
],
|
|
264
|
+
"description": "Where chant's own reports for the cycle live. plan and apply are keys in reportKey(pr, commit) form, <pr>/<commit>, below url. The report files are pr-plan.json, pr-apply.json and the matching .events.jsonl.",
|
|
265
|
+
"properties": {
|
|
266
|
+
"url": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"description": "The --report-url the pipeline uploads to, always s3:// or https://.",
|
|
269
|
+
"pattern": "^(s3|https)://"
|
|
270
|
+
},
|
|
271
|
+
"plan": {
|
|
272
|
+
"type": "string",
|
|
273
|
+
"pattern": "^[0-9]+/[0-9a-f]{40,64}$"
|
|
274
|
+
},
|
|
275
|
+
"apply": {
|
|
276
|
+
"type": "string",
|
|
277
|
+
"pattern": "^[0-9]+/[0-9a-f]{40,64}$"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|