@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,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The harness's contracts (chant#4587): e2e-scenario/v1 and its lint, which
|
|
3
|
+
* refuses a scenario with no claim id or no BREAK arm, and e2e-claim-row/v1
|
|
4
|
+
* and e2e-claims/v1. demo-step/v1 and demo-cycle/v1 keep their own tests in
|
|
5
|
+
* examples/fan-out-estate/demo/schemas/index.test.ts.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, test } from "vitest";
|
|
8
|
+
import { lintScenario } from "./scenario";
|
|
9
|
+
import {
|
|
10
|
+
E2E_CLAIMS_SCHEMA,
|
|
11
|
+
E2E_CLAIM_ROW_SCHEMA,
|
|
12
|
+
E2E_SCENARIO_SCHEMA,
|
|
13
|
+
validateClaimRow,
|
|
14
|
+
validateClaims,
|
|
15
|
+
validateDemoStep,
|
|
16
|
+
validateScenario,
|
|
17
|
+
type ClaimRow,
|
|
18
|
+
} from "./schemas/index";
|
|
19
|
+
import { FLOCI_DIGEST } from "./pins";
|
|
20
|
+
|
|
21
|
+
const scenario = (): Record<string, unknown> => ({
|
|
22
|
+
$schema: E2E_SCENARIO_SCHEMA,
|
|
23
|
+
contract: 1,
|
|
24
|
+
id: "tg-estate-overlap",
|
|
25
|
+
product: "terragucci",
|
|
26
|
+
claim: "choudoufu/rows-overlap",
|
|
27
|
+
tree: { base: "trees/estate", overlays: "trees/overlays" },
|
|
28
|
+
reportUrl: "s3://terragucci-e2e/estate/reports",
|
|
29
|
+
steps: [
|
|
30
|
+
{ id: "one", do: "open", branch: "e2e/one", overlay: "one", title: "One" },
|
|
31
|
+
{ id: "two", do: "open-concurrent", branch: "e2e/two", overlay: "two", title: "Two" },
|
|
32
|
+
{ id: "one-plan", do: "plan", pull: "one", expect: [{ report: { status: "planned" } }] },
|
|
33
|
+
{ id: "one-merge", do: "merge", pull: "one" },
|
|
34
|
+
{ id: "one-apply", do: "apply", merge: "one-merge", expect: [{ report: { status: "applied", components: { a: "applied" }, only: true } }] },
|
|
35
|
+
],
|
|
36
|
+
break: { env: { BREAK: "1" }, note: "the second apply takes the first's rows" },
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const at = (findings: { at: string; message: string }[]) => findings.map((f) => f.at);
|
|
40
|
+
|
|
41
|
+
describe("e2e-scenario/v1 and its lint", () => {
|
|
42
|
+
test("a scenario with a claim, steps that expect something and a BREAK arm lints clean", () => {
|
|
43
|
+
expect(validateScenario(scenario()).ok).toBe(true);
|
|
44
|
+
expect(lintScenario(scenario())).toEqual([]);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("refuses a scenario with no claim id", () => {
|
|
48
|
+
const s = scenario();
|
|
49
|
+
delete s.claim;
|
|
50
|
+
expect(lintScenario(s)).toContainEqual({ at: "/claim", message: "the scenario has no claim id, so its run would record a row for nothing" });
|
|
51
|
+
expect(lintScenario({ ...scenario(), claim: " " }).map((f) => f.at)).toContain("/claim");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("refuses a scenario with no BREAK arm, or one that does not set BREAK=1", () => {
|
|
55
|
+
const s = scenario();
|
|
56
|
+
delete s.break;
|
|
57
|
+
expect(lintScenario(s)).toContainEqual({ at: "/break", message: "the scenario has no BREAK arm, so nothing shows its outcomes can fail" });
|
|
58
|
+
expect(at(lintScenario({ ...scenario(), break: { env: { BREAK: "0" } } }))).toContain("/break/env/BREAK");
|
|
59
|
+
expect(at(lintScenario({ ...scenario(), break: { overlay: "broken" } }))).toContain("/break/env/BREAK");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("refuses steps that name a pull request or a merge no earlier step made", () => {
|
|
63
|
+
const s = scenario();
|
|
64
|
+
const steps = s.steps as Array<Record<string, unknown>>;
|
|
65
|
+
steps[2] = { id: "one-plan", do: "plan", pull: "nobody", expect: [{ report: { status: "planned" } }] };
|
|
66
|
+
steps[4] = { id: "one-apply", do: "apply", merge: "one", expect: [{ exit: 0 }] };
|
|
67
|
+
const findings = lintScenario(s);
|
|
68
|
+
expect(findings).toContainEqual({ at: "/steps/2/pull", message: "plan names nobody, which is not an earlier open step" });
|
|
69
|
+
expect(findings).toContainEqual({ at: "/steps/4/merge", message: "apply names one, which is not an earlier merge step" });
|
|
70
|
+
expect(findings).toContainEqual({ at: "/steps/4/expect/0", message: "an exit outcome belongs on an out-of-band step" });
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("refuses a scenario that checks nothing, a repeated id and a lone open-concurrent", () => {
|
|
74
|
+
const s = scenario();
|
|
75
|
+
s.steps = [
|
|
76
|
+
{ id: "x", do: "open-concurrent", branch: "x", overlay: "x", title: "X" },
|
|
77
|
+
{ id: "x", do: "kill-job" },
|
|
78
|
+
];
|
|
79
|
+
expect(lintScenario(s)).toEqual([
|
|
80
|
+
{ at: "/steps/0/do", message: "open-concurrent opens beside the step before it, which must be an open" },
|
|
81
|
+
{ at: "/steps/1/id", message: "step id x is used twice" },
|
|
82
|
+
{ at: "/steps", message: "no step expects anything, so the plain run would pass and the BREAK run could never be caught" },
|
|
83
|
+
]);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("the schema refuses an unknown step, a step missing its fields and an outcome with two keys", () => {
|
|
87
|
+
for (const bad of [
|
|
88
|
+
{ id: "s", do: "deploy" },
|
|
89
|
+
{ id: "s", do: "open", branch: "b", title: "T" },
|
|
90
|
+
{ id: "s", do: "plan", pull: "one", expect: [{ exit: 0, comment: "x" }] },
|
|
91
|
+
]) {
|
|
92
|
+
const s = scenario();
|
|
93
|
+
(s.steps as unknown[]).push(bad);
|
|
94
|
+
expect(validateScenario(s).ok, JSON.stringify(bad)).toBe(false);
|
|
95
|
+
expect(lintScenario(s).length).toBeGreaterThan(0);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const row = (over: Partial<ClaimRow> = {}): ClaimRow => ({
|
|
101
|
+
$schema: E2E_CLAIM_ROW_SCHEMA,
|
|
102
|
+
contract: 1,
|
|
103
|
+
product: "terragucci",
|
|
104
|
+
productCommit: "e962b2c0000000000000000000000000000000aa",
|
|
105
|
+
scenario: "tg-estate-overlap",
|
|
106
|
+
claim: "choudoufu/rows-overlap",
|
|
107
|
+
engine: { binary: "choudoufu", version: "0.31.0" },
|
|
108
|
+
floci: FLOCI_DIGEST,
|
|
109
|
+
date: "2026-10-28",
|
|
110
|
+
plain: "pass",
|
|
111
|
+
break: "caught",
|
|
112
|
+
safeRun: "CLEAN",
|
|
113
|
+
...over,
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe("e2e-claim-row/v1 and e2e-claims/v1", () => {
|
|
117
|
+
test("a row carries the product and its commit, the engine binary and version, the floci digest, the date and both verdicts", () => {
|
|
118
|
+
expect(validateClaimRow(row())).toEqual({ ok: true, value: row() });
|
|
119
|
+
const required = (JSON.parse(JSON.stringify(row())) as Record<string, unknown>);
|
|
120
|
+
for (const k of ["product", "productCommit", "engine", "floci", "date", "plain", "break", "safeRun"]) {
|
|
121
|
+
const r = { ...required };
|
|
122
|
+
delete r[k];
|
|
123
|
+
expect(validateClaimRow(r).ok, k).toBe(false);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test("refuses a short commit, a tag in place of a digest, a verdict it does not know and a scan that was not CLEAN", () => {
|
|
128
|
+
expect(validateClaimRow(row({ productCommit: "e962b2c" })).ok).toBe(false);
|
|
129
|
+
expect(validateClaimRow(row({ floci: "63d8f1ed" })).ok).toBe(false);
|
|
130
|
+
expect(validateClaimRow({ ...row(), plain: "ok" }).ok).toBe(false);
|
|
131
|
+
expect(validateClaimRow({ ...row(), safeRun: "REAL-CLOUD" }).ok).toBe(false);
|
|
132
|
+
expect(validateClaimRow({ ...row(), date: "28 Oct 2026" }).ok).toBe(false);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
test("a product's claims are its rows", () => {
|
|
136
|
+
expect(validateClaims({ $schema: E2E_CLAIMS_SCHEMA, contract: 1, product: "terragucci", rows: [row()] }).ok).toBe(true);
|
|
137
|
+
expect(validateClaims({ $schema: E2E_CLAIMS_SCHEMA, contract: 1, product: "terragucci", rows: [{ ...row(), break: "maybe" }] }).ok).toBe(false);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test("demo-step/v1 validates from the harness as it did from the demo", () => {
|
|
141
|
+
const step = { $schema: "https://intentius.io/chant/schemas/demo/demo-step/v1/demo-step.schema.json", contract: 1, demo: "fan-out-estate", cycle: 1, step: "planned" };
|
|
142
|
+
expect(validateDemoStep(step).ok).toBe(true);
|
|
143
|
+
expect(validateDemoStep({ ...step, step: "exploded" }).ok).toBe(false);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The harness's compose project (chant#4587): the services harnessStack
|
|
3
|
+
* gives, the one pin file they read, the runner's config, and ./project/
|
|
4
|
+
* built with `chant build` on the docker lexicon. Nothing here starts a
|
|
5
|
+
* container.
|
|
6
|
+
*/
|
|
7
|
+
import { mkdtempSync, readFileSync, rmSync } from "node:fs";
|
|
8
|
+
import { tmpdir } from "node:os";
|
|
9
|
+
import { join, resolve } from "node:path";
|
|
10
|
+
import { load } from "js-yaml";
|
|
11
|
+
import { afterAll, beforeAll, describe, expect, test } from "vitest";
|
|
12
|
+
import { runCommandInProcess } from "../cli/main";
|
|
13
|
+
import { harnessProjectDir } from "./index";
|
|
14
|
+
import { pickJobContainer } from "./jobs";
|
|
15
|
+
import { CLICKHOUSE_IMAGE, FLOCI_CHANGE_SET_IMAGE, FLOCI_DIGEST, FLOCI_IMAGE, FORGEJO_IMAGE, FORGEJO_RUNNER_IMAGE, POSTGRES_IMAGE } from "./pins";
|
|
16
|
+
import { forgejoRunnerConfig, harnessStack, harnessUrls } from "./stack";
|
|
17
|
+
|
|
18
|
+
const repo = resolve(import.meta.dirname, "..", "..", "..", "..");
|
|
19
|
+
const tmp = mkdtempSync(join(tmpdir(), "chant-e2e-stack-test-"));
|
|
20
|
+
afterAll(() => rmSync(tmp, { recursive: true, force: true }));
|
|
21
|
+
|
|
22
|
+
describe("the harness's pins", () => {
|
|
23
|
+
test("floci is held at 5ec92ae8, the build choudoufu and plunge pin (lex00/floci#265 for the move)", () => {
|
|
24
|
+
expect(FLOCI_DIGEST).toBe("sha256:5ec92ae8046445d62c0009590dd09f04560886e5a5ef31248cb3fcc09b2961ec");
|
|
25
|
+
expect(FLOCI_IMAGE).toBe(`ghcr.io/lex00/floci@${FLOCI_DIGEST}`);
|
|
26
|
+
expect(FLOCI_CHANGE_SET_IMAGE).toContain("sha256:63d8f1ed");
|
|
27
|
+
expect(readFileSync(join(import.meta.dirname, "pins.ts"), "utf8")).toContain("lex00/floci#265");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test("Forgejo 16.0.5 and forgejo-runner 13.2.0", () => {
|
|
31
|
+
expect(FORGEJO_IMAGE).toBe("codeberg.org/forgejo/forgejo:16.0.5");
|
|
32
|
+
expect(FORGEJO_RUNNER_IMAGE).toBe("data.forgejo.org/forgejo/runner:13.2.0");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("the sql servers are the ones the sql lexicon pins", () => {
|
|
36
|
+
const pin = readFileSync(join(repo, "lexicons", "sql", "src", "spec", "pin.ts"), "utf8");
|
|
37
|
+
const version = /CLICKHOUSE_VERSION = "([^"]+)"/.exec(pin)![1];
|
|
38
|
+
const digest = /CLICKHOUSE_IMAGE_DIGEST = "([^"]+)"/.exec(pin)![1];
|
|
39
|
+
expect(CLICKHOUSE_IMAGE).toBe(`clickhouse/clickhouse-server:${version}@${digest}`);
|
|
40
|
+
const pg = readFileSync(join(repo, "lexicons", "sql", "src", "spec", "postgres-pin.ts"), "utf8");
|
|
41
|
+
const [, pgVersion, pgDigest] = /major: 18, version: "([^"]+)", digest: "([^"]+)"/.exec(pg)!;
|
|
42
|
+
expect(POSTGRES_IMAGE).toBe(`postgres:${pgVersion}@${pgDigest}`);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe("harnessStack", () => {
|
|
47
|
+
const h = harnessStack({ project: "bench-a", envPrefix: "BENCH_A" });
|
|
48
|
+
|
|
49
|
+
test("names the network, the containers and the volumes after the project", () => {
|
|
50
|
+
expect(h.network).toEqual({ name: "bench-a" });
|
|
51
|
+
expect(Object.values(h.services).map((s) => s.container_name)).toEqual(["bench-a-floci", "bench-a-forgejo", "bench-a-forgejo-runner", "bench-a-clickhouse", "bench-a-postgres"]);
|
|
52
|
+
expect(h.volumes).toEqual({ forgejoData: { name: "bench-a-forgejo-data" }, runnerData: { name: "bench-a-runner-data" } });
|
|
53
|
+
for (const s of Object.values(h.services)) expect(Object.keys(s.networks)).toEqual(["harness"]);
|
|
54
|
+
expect(() => harnessStack({ project: "Bench A" })).toThrow(/not a compose project name/);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("binds host ports to 127.0.0.1, moved by the prefix's variables", () => {
|
|
58
|
+
expect(h.services.floci.ports).toEqual(["127.0.0.1:${BENCH_A_FLOCI_PORT:-4591}:4566"]);
|
|
59
|
+
expect(h.services.forgejo.ports).toEqual(["127.0.0.1:${BENCH_A_FORGEJO_PORT:-3391}:3000"]);
|
|
60
|
+
expect(h.services.forgejoRunner.ports).toBeUndefined();
|
|
61
|
+
expect(harnessUrls(h, { BENCH_A_FORGEJO_PORT: "4000" }).forgejo).toBe("http://localhost:4000");
|
|
62
|
+
expect(harnessStack({ project: "demo", bind: null }).services.floci.ports).toEqual(["${CHANT_E2E_FLOCI_PORT:-4591}:4566"]);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("runs forgejo-runner with the docker executor after Forgejo is healthy, and Actions on", () => {
|
|
66
|
+
const r = h.services.forgejoRunner;
|
|
67
|
+
expect(r.image).toBe(FORGEJO_RUNNER_IMAGE);
|
|
68
|
+
expect(r.volumes).toContain("/var/run/docker.sock:/var/run/docker.sock");
|
|
69
|
+
expect(r.depends_on).toEqual({ forgejo: { condition: "service_healthy" } });
|
|
70
|
+
expect(r.command!.at(-1)).toContain("forgejo-runner daemon -c /data/config.yml");
|
|
71
|
+
expect(h.services.forgejo.environment!.FORGEJO__actions__ENABLED).toBe("true");
|
|
72
|
+
expect(harnessStack({ project: "x", forgejoActions: false }).services.forgejo.environment!.FORGEJO__actions__ENABLED).toBe("false");
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test("puts the sql emulator behind the sql profile, and nothing else", () => {
|
|
76
|
+
expect(h.services.clickhouse.profiles).toEqual(["sql"]);
|
|
77
|
+
expect(h.services.postgres.profiles).toEqual(["sql"]);
|
|
78
|
+
for (const k of ["floci", "forgejo", "forgejoRunner"] as const) expect(h.services[k].profiles).toBeUndefined();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test("the runner's config puts every job on the project network, with floci for AWS", () => {
|
|
82
|
+
const text = forgejoRunnerConfig({ network: "bench-a", uuid: "u-1", token: "t-1", jobImage: "node:22-bookworm" });
|
|
83
|
+
const doc = load(text) as { container: { network: string; valid_volumes: string[] }; runner: { envs: Record<string, string>; labels: string[] }; server: { connections: { forgejo: { uuid: string; url: string } } } };
|
|
84
|
+
expect(doc.container.network).toBe("bench-a");
|
|
85
|
+
expect(doc.container.valid_volumes).toEqual([]);
|
|
86
|
+
expect(doc.runner.envs.AWS_ENDPOINT_URL).toBe("http://floci:4566");
|
|
87
|
+
expect(doc.runner.labels).toEqual(["docker:docker://node:22-bookworm", "ubuntu-latest:docker://node:22-bookworm"]);
|
|
88
|
+
expect(doc.server.connections.forgejo).toMatchObject({ uuid: "u-1", url: "http://forgejo:3000/" });
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test("kill-job picks the newest forgejo-runner job container that matches", () => {
|
|
92
|
+
const ps = ["2026-10-28 10:02\tFORGEJO-ACTIONS-TASK-9_WORKFLOW-pr_JOB-pr-apply", "2026-10-28 10:01\tFORGEJO-ACTIONS-TASK-8_WORKFLOW-pr_JOB-pr-plan", "2026-10-28 09:00\tbench-a-floci"];
|
|
93
|
+
expect(pickJobContainer(ps)).toBe("FORGEJO-ACTIONS-TASK-9_WORKFLOW-pr_JOB-pr-apply");
|
|
94
|
+
expect(pickJobContainer(ps, "pr-plan")).toBe("FORGEJO-ACTIONS-TASK-8_WORKFLOW-pr_JOB-pr-plan");
|
|
95
|
+
expect(pickJobContainer(ps, "drift")).toBeNull();
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
interface ComposeDoc {
|
|
100
|
+
services: Record<string, { image: string; ports?: string[]; profiles?: string[]; networks: Record<string, unknown>; container_name: string }>;
|
|
101
|
+
networks: Record<string, { name: string }>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
describe("the harness's chant project", () => {
|
|
105
|
+
let doc: ComposeDoc;
|
|
106
|
+
|
|
107
|
+
beforeAll(async () => {
|
|
108
|
+
const out = join(tmp, "compose.yaml");
|
|
109
|
+
expect(await runCommandInProcess(["build", join(harnessProjectDir(), "src"), "--lexicon", "docker", "-o", out])).toBe(0);
|
|
110
|
+
doc = load(readFileSync(out, "utf8")) as ComposeDoc;
|
|
111
|
+
}, 60_000);
|
|
112
|
+
|
|
113
|
+
test("builds floci, Forgejo and forgejo-runner on one network, the sql emulator behind its profile", () => {
|
|
114
|
+
expect(Object.keys(doc.services).sort()).toEqual(["clickhouse", "floci", "forgejo", "forgejoRunner", "postgres"]);
|
|
115
|
+
expect(doc.networks.harness!.name).toBe("chant-e2e");
|
|
116
|
+
for (const s of Object.values(doc.services)) expect(Object.keys(s.networks)).toEqual(["harness"]);
|
|
117
|
+
expect(doc.services.floci!.image).toBe(FLOCI_IMAGE);
|
|
118
|
+
expect(doc.services.forgejo!.image).toBe(FORGEJO_IMAGE);
|
|
119
|
+
expect(doc.services.forgejoRunner!.image).toBe(FORGEJO_RUNNER_IMAGE);
|
|
120
|
+
expect(doc.services.clickhouse!.profiles).toEqual(["sql"]);
|
|
121
|
+
expect(doc.services.postgres!.profiles).toEqual(["sql"]);
|
|
122
|
+
expect(doc.services.floci!.ports).toEqual(["127.0.0.1:${CHANT_E2E_FLOCI_PORT:-4591}:4566"]);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The e2e harness's compose project (chant#4587), as data a chant
|
|
3
|
+
* docker-lexicon project wraps: floci, Forgejo and forgejo-runner with the
|
|
4
|
+
* docker executor on one network, and the sql emulator's ClickHouse and
|
|
5
|
+
* Postgres behind the `sql` profile. Every image comes from ./pins.ts.
|
|
6
|
+
*
|
|
7
|
+
* Core does not depend on the docker lexicon, so this file returns plain
|
|
8
|
+
* service properties. A product's project hands each to the lexicon's
|
|
9
|
+
* `Service`, under the key named here (compose keys are export names):
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { Network, Service, Volume } from "@intentius/chant-lexicon-docker";
|
|
13
|
+
* import { harnessStack } from "@intentius/chant/e2e-harness";
|
|
14
|
+
* const h = harnessStack({ project: "terragucci-e2e", envPrefix: "TERRAGUCCI_E2E" });
|
|
15
|
+
* export const harness = new Network(h.network);
|
|
16
|
+
* export const floci = new Service(h.services.floci);
|
|
17
|
+
* ...
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* ./project/ is that project for the whole stack, and the fan-out demo's
|
|
21
|
+
* stack/src/compose.ts takes floci and Forgejo from it.
|
|
22
|
+
*
|
|
23
|
+
* Two rules from terragucci's stack hold here. A forge's public URL is its
|
|
24
|
+
* service name (http://forgejo:3000), since inside a job container localhost
|
|
25
|
+
* is the job container. The network has a fixed name, the project's, and the
|
|
26
|
+
* runner puts every job container on it. Host ports bind to 127.0.0.1 and
|
|
27
|
+
* move with `<envPrefix>_<SERVICE>_PORT`, and every name carries the project,
|
|
28
|
+
* so two benches share a host (plywood stack/compose.yml does the same).
|
|
29
|
+
*/
|
|
30
|
+
import { CLICKHOUSE_IMAGE, FLOCI_IMAGE, FORGEJO_IMAGE, FORGEJO_RUNNER_IMAGE, POSTGRES_IMAGE, POSTGRES_PASSWORD } from "./pins";
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The service properties the harness sets, a subset of compose's. A type
|
|
34
|
+
* alias, not an interface: the docker lexicon's ServiceProps has an `x-` index
|
|
35
|
+
* signature, which only an alias's implicit index signature satisfies.
|
|
36
|
+
*/
|
|
37
|
+
export type ComposeServiceSpec = {
|
|
38
|
+
image: string;
|
|
39
|
+
container_name: string;
|
|
40
|
+
profiles?: string[];
|
|
41
|
+
user?: string;
|
|
42
|
+
environment?: Record<string, string>;
|
|
43
|
+
ports?: string[];
|
|
44
|
+
volumes?: string[];
|
|
45
|
+
working_dir?: string;
|
|
46
|
+
command?: string[];
|
|
47
|
+
depends_on?: Record<string, { condition: "service_started" | "service_healthy" }>;
|
|
48
|
+
networks: Record<string, { aliases: string[] }>;
|
|
49
|
+
healthcheck?: { test: string[]; interval: string; timeout: string; retries: number };
|
|
50
|
+
restart?: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export interface HarnessStackOptions {
|
|
54
|
+
/**
|
|
55
|
+
* The compose project, which also names the network, the containers and
|
|
56
|
+
* the volumes. Pass it to `docker compose -p` as well.
|
|
57
|
+
*/
|
|
58
|
+
project: string;
|
|
59
|
+
/** The prefix of the port variables, `<envPrefix>_FLOCI_PORT` and so on. Default `CHANT_E2E`. */
|
|
60
|
+
envPrefix?: string;
|
|
61
|
+
/** The network's export name in the product's project. Default `harness`. */
|
|
62
|
+
networkKey?: string;
|
|
63
|
+
/** Default host ports. */
|
|
64
|
+
ports?: Partial<HarnessPorts>;
|
|
65
|
+
/**
|
|
66
|
+
* The address host ports bind to. Default 127.0.0.1. Null publishes on
|
|
67
|
+
* every interface, for a demo host whose viewers read floci from outside.
|
|
68
|
+
*/
|
|
69
|
+
bind?: string | null;
|
|
70
|
+
/** Forgejo Actions on the instance. Default true; off when nothing on the forge runs workflows. */
|
|
71
|
+
forgejoActions?: boolean;
|
|
72
|
+
/** Another floci image, for a bench that needs the other line (pins.ts). Rows still name the one they ran on. */
|
|
73
|
+
flociImage?: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface HarnessPorts {
|
|
77
|
+
floci: number;
|
|
78
|
+
forgejo: number;
|
|
79
|
+
clickhouse: number;
|
|
80
|
+
postgres: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** The default host ports, off every tool's own default and off terragucci's and plywood's benches. */
|
|
84
|
+
export const HARNESS_PORTS: HarnessPorts = { floci: 4591, forgejo: 3391, clickhouse: 8124, postgres: 5433 };
|
|
85
|
+
|
|
86
|
+
/** The profile the sql emulator's servers are behind. */
|
|
87
|
+
export const SQL_PROFILE = "sql";
|
|
88
|
+
|
|
89
|
+
/** Inside the network: the addresses jobs and the runner use. */
|
|
90
|
+
export const HARNESS_HOSTS = {
|
|
91
|
+
floci: "http://floci:4566",
|
|
92
|
+
forgejo: "http://forgejo:3000",
|
|
93
|
+
clickhouse: "http://clickhouse:8123",
|
|
94
|
+
postgres: "postgres://postgres:chant@postgres:5432/postgres",
|
|
95
|
+
} as const;
|
|
96
|
+
|
|
97
|
+
/** Where forgejo-runner reads its config, which `forgejoRunnerConfig` writes. */
|
|
98
|
+
export const RUNNER_CONFIG_PATH = "/data/config.yml";
|
|
99
|
+
|
|
100
|
+
export interface HarnessStack {
|
|
101
|
+
project: string;
|
|
102
|
+
/** The network's properties, under `networkKey`. */
|
|
103
|
+
network: { name: string };
|
|
104
|
+
networkKey: string;
|
|
105
|
+
/** Volumes by export name. */
|
|
106
|
+
volumes: { forgejoData: { name: string }; runnerData: { name: string } };
|
|
107
|
+
/** Services by export name, which is their compose key. */
|
|
108
|
+
services: {
|
|
109
|
+
floci: ComposeServiceSpec;
|
|
110
|
+
forgejo: ComposeServiceSpec;
|
|
111
|
+
forgejoRunner: ComposeServiceSpec;
|
|
112
|
+
clickhouse: ComposeServiceSpec;
|
|
113
|
+
postgres: ComposeServiceSpec;
|
|
114
|
+
};
|
|
115
|
+
/** The port variables, by service. */
|
|
116
|
+
portVars: Record<keyof HarnessPorts, string>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** A project name compose and the harness accept: lower case, digits, `-` and `_`, starting with a letter or digit. */
|
|
120
|
+
export function assertProjectName(project: string): void {
|
|
121
|
+
if (!/^[a-z0-9][a-z0-9_-]*$/.test(project)) throw new Error(`"${project}" is not a compose project name (lower case, digits, - and _)`);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function harnessStack(o: HarnessStackOptions): HarnessStack {
|
|
125
|
+
assertProjectName(o.project);
|
|
126
|
+
const p = o.project;
|
|
127
|
+
const prefix = o.envPrefix ?? "CHANT_E2E";
|
|
128
|
+
const key = o.networkKey ?? "harness";
|
|
129
|
+
const ports = { ...HARNESS_PORTS, ...o.ports };
|
|
130
|
+
const bind = o.bind === undefined ? "127.0.0.1" : o.bind;
|
|
131
|
+
const portVars: Record<keyof HarnessPorts, string> = {
|
|
132
|
+
floci: `${prefix}_FLOCI_PORT`,
|
|
133
|
+
forgejo: `${prefix}_FORGEJO_PORT`,
|
|
134
|
+
clickhouse: `${prefix}_CLICKHOUSE_PORT`,
|
|
135
|
+
postgres: `${prefix}_POSTGRES_PORT`,
|
|
136
|
+
};
|
|
137
|
+
const publish = (svc: keyof HarnessPorts, inner: number): string =>
|
|
138
|
+
`${bind ? `${bind}:` : ""}\${${portVars[svc]}:-${ports[svc]}}:${inner}`;
|
|
139
|
+
const on = (...aliases: string[]) => ({ [key]: { aliases } });
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
project: p,
|
|
143
|
+
network: { name: p },
|
|
144
|
+
networkKey: key,
|
|
145
|
+
volumes: { forgejoData: { name: `${p}-forgejo-data` }, runnerData: { name: `${p}-runner-data` } },
|
|
146
|
+
portVars,
|
|
147
|
+
services: {
|
|
148
|
+
floci: {
|
|
149
|
+
image: o.flociImage ?? FLOCI_IMAGE,
|
|
150
|
+
container_name: `${p}-floci`,
|
|
151
|
+
ports: [publish("floci", 4566)],
|
|
152
|
+
networks: on("floci", "000000000000.floci"),
|
|
153
|
+
restart: "unless-stopped",
|
|
154
|
+
},
|
|
155
|
+
// sqlite and INSTALL_LOCK skip the web installer; the driver makes the
|
|
156
|
+
// admin and the people with Forgejo's own CLI.
|
|
157
|
+
forgejo: {
|
|
158
|
+
image: FORGEJO_IMAGE,
|
|
159
|
+
container_name: `${p}-forgejo`,
|
|
160
|
+
environment: {
|
|
161
|
+
FORGEJO__database__DB_TYPE: "sqlite3",
|
|
162
|
+
FORGEJO__security__INSTALL_LOCK: "true",
|
|
163
|
+
FORGEJO__server__DOMAIN: "forgejo",
|
|
164
|
+
FORGEJO__server__ROOT_URL: "http://forgejo:3000/",
|
|
165
|
+
FORGEJO__server__HTTP_PORT: "3000",
|
|
166
|
+
FORGEJO__server__DISABLE_SSH: "true",
|
|
167
|
+
FORGEJO__service__DISABLE_REGISTRATION: "true",
|
|
168
|
+
FORGEJO__actions__ENABLED: o.forgejoActions === false ? "false" : "true",
|
|
169
|
+
FORGEJO__repository__DEFAULT_BRANCH: "main",
|
|
170
|
+
FORGEJO__log__LEVEL: "warn",
|
|
171
|
+
},
|
|
172
|
+
ports: [publish("forgejo", 3000)],
|
|
173
|
+
volumes: ["forgejoData:/data"],
|
|
174
|
+
networks: on("forgejo"),
|
|
175
|
+
healthcheck: {
|
|
176
|
+
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3000/api/v1/version"],
|
|
177
|
+
interval: "3s",
|
|
178
|
+
timeout: "3s",
|
|
179
|
+
retries: 40,
|
|
180
|
+
},
|
|
181
|
+
restart: "unless-stopped",
|
|
182
|
+
},
|
|
183
|
+
// The docker executor: one job container per job through the host's
|
|
184
|
+
// socket, on the project network (container.network in the config
|
|
185
|
+
// registerForgejoRunner writes). It waits for that config, since the
|
|
186
|
+
// runner's credentials come from Forgejo after it boots. Root, for the
|
|
187
|
+
// socket Docker Desktop mounts as root:root.
|
|
188
|
+
forgejoRunner: {
|
|
189
|
+
image: FORGEJO_RUNNER_IMAGE,
|
|
190
|
+
container_name: `${p}-forgejo-runner`,
|
|
191
|
+
user: "0:0",
|
|
192
|
+
depends_on: { forgejo: { condition: "service_healthy" } },
|
|
193
|
+
volumes: ["/var/run/docker.sock:/var/run/docker.sock", "runnerData:/data"],
|
|
194
|
+
working_dir: "/data",
|
|
195
|
+
command: [
|
|
196
|
+
"sh",
|
|
197
|
+
"-c",
|
|
198
|
+
`while [ ! -s ${RUNNER_CONFIG_PATH} ]; do sleep 1; done; exec forgejo-runner daemon -c ${RUNNER_CONFIG_PATH}`,
|
|
199
|
+
],
|
|
200
|
+
networks: on("forgejo-runner"),
|
|
201
|
+
restart: "unless-stopped",
|
|
202
|
+
},
|
|
203
|
+
clickhouse: {
|
|
204
|
+
image: CLICKHOUSE_IMAGE,
|
|
205
|
+
container_name: `${p}-clickhouse`,
|
|
206
|
+
profiles: [SQL_PROFILE],
|
|
207
|
+
environment: { CLICKHOUSE_SKIP_USER_SETUP: "1" },
|
|
208
|
+
ports: [publish("clickhouse", 8123)],
|
|
209
|
+
networks: on("clickhouse"),
|
|
210
|
+
healthcheck: { test: ["CMD", "wget", "--spider", "-q", "http://localhost:8123/ping"], interval: "2s", timeout: "3s", retries: 60 },
|
|
211
|
+
restart: "unless-stopped",
|
|
212
|
+
},
|
|
213
|
+
postgres: {
|
|
214
|
+
image: POSTGRES_IMAGE,
|
|
215
|
+
container_name: `${p}-postgres`,
|
|
216
|
+
profiles: [SQL_PROFILE],
|
|
217
|
+
environment: { POSTGRES_PASSWORD },
|
|
218
|
+
ports: [publish("postgres", 5432)],
|
|
219
|
+
networks: on("postgres"),
|
|
220
|
+
healthcheck: { test: ["CMD", "pg_isready", "-h", "127.0.0.1", "-U", "postgres"], interval: "2s", timeout: "3s", retries: 60 },
|
|
221
|
+
restart: "unless-stopped",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** The host URLs of a stack's services, from its port variables in `env` or the defaults. */
|
|
228
|
+
export function harnessUrls(
|
|
229
|
+
s: Pick<HarnessStack, "portVars">,
|
|
230
|
+
env: Record<string, string | undefined> = process.env,
|
|
231
|
+
defaults: HarnessPorts = HARNESS_PORTS,
|
|
232
|
+
): Record<keyof HarnessPorts, string> {
|
|
233
|
+
const port = (k: keyof HarnessPorts) => Number(env[s.portVars[k]] ?? defaults[k]);
|
|
234
|
+
return {
|
|
235
|
+
floci: `http://localhost:${port("floci")}`,
|
|
236
|
+
forgejo: `http://localhost:${port("forgejo")}`,
|
|
237
|
+
clickhouse: `http://localhost:${port("clickhouse")}`,
|
|
238
|
+
postgres: `postgres://postgres:${POSTGRES_PASSWORD}@localhost:${port("postgres")}/postgres`,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface RunnerConfigOptions {
|
|
243
|
+
/** The project network every job container joins. */
|
|
244
|
+
network: string;
|
|
245
|
+
/** The runner's uuid and token, from POST /admin/actions/runners. */
|
|
246
|
+
uuid: string;
|
|
247
|
+
token: string;
|
|
248
|
+
/** The image the `docker` and `ubuntu-latest` labels run. */
|
|
249
|
+
jobImage: string;
|
|
250
|
+
/** Jobs at once. Default 4. */
|
|
251
|
+
capacity?: number;
|
|
252
|
+
/** Environment every job gets. Default floci's endpoint and test credentials. */
|
|
253
|
+
envs?: Record<string, string>;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/** What every job gets by default: AWS is floci, as a CI runner in a real account carries that account's credentials. */
|
|
257
|
+
export const RUNNER_JOB_ENV: Record<string, string> = {
|
|
258
|
+
AWS_ENDPOINT_URL: HARNESS_HOSTS.floci,
|
|
259
|
+
AWS_ACCESS_KEY_ID: "test",
|
|
260
|
+
AWS_SECRET_ACCESS_KEY: "test",
|
|
261
|
+
AWS_REGION: "us-east-1",
|
|
262
|
+
AWS_EC2_METADATA_DISABLED: "true",
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
const q = (s: string): string => JSON.stringify(s);
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* forgejo-runner's config (Forgejo 16, runner 13): the server connection by
|
|
269
|
+
* uuid and token, the job containers on the project network, no host
|
|
270
|
+
* mounts, and floci for AWS.
|
|
271
|
+
*/
|
|
272
|
+
export function forgejoRunnerConfig(o: RunnerConfigOptions): string {
|
|
273
|
+
const envs = o.envs ?? RUNNER_JOB_ENV;
|
|
274
|
+
return [
|
|
275
|
+
"log:",
|
|
276
|
+
" level: info",
|
|
277
|
+
" job_level: info",
|
|
278
|
+
"runner:",
|
|
279
|
+
" file: /data/.runner",
|
|
280
|
+
` capacity: ${o.capacity ?? 4}`,
|
|
281
|
+
" timeout: 30m",
|
|
282
|
+
" shutdown_timeout: 0s",
|
|
283
|
+
" fetch_interval: 1s",
|
|
284
|
+
" report_interval: 1s",
|
|
285
|
+
" envs:",
|
|
286
|
+
...Object.entries(envs).map(([k, v]) => ` ${k}: ${q(v)}`),
|
|
287
|
+
" labels:",
|
|
288
|
+
` - ${q(`docker:docker://${o.jobImage}`)}`,
|
|
289
|
+
` - ${q(`ubuntu-latest:docker://${o.jobImage}`)}`,
|
|
290
|
+
"cache:",
|
|
291
|
+
" enabled: false",
|
|
292
|
+
"container:",
|
|
293
|
+
` network: ${q(o.network)}`,
|
|
294
|
+
" privileged: false",
|
|
295
|
+
" valid_volumes: []",
|
|
296
|
+
' docker_host: "-"',
|
|
297
|
+
" force_pull: false",
|
|
298
|
+
"server:",
|
|
299
|
+
" connections:",
|
|
300
|
+
" forgejo:",
|
|
301
|
+
" url: http://forgejo:3000/",
|
|
302
|
+
` uuid: ${q(o.uuid)}`,
|
|
303
|
+
` token: ${q(o.token)}`,
|
|
304
|
+
"",
|
|
305
|
+
].join("\n");
|
|
306
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-step time limits of the harness's driver (chant#4587), from the fan-out
|
|
3
|
+
* demo's steps.ts LIMITS. Past its limit a step stalls the run, and a stalled
|
|
4
|
+
* run is neither a pass nor a caught break.
|
|
5
|
+
*/
|
|
6
|
+
import type { ScenarioStepKind } from "./schemas/index";
|
|
7
|
+
|
|
8
|
+
/** Seconds each kind of step may take by default. */
|
|
9
|
+
export const HARNESS_LIMITS: Record<ScenarioStepKind, number> = {
|
|
10
|
+
/** The branch push and the pull request open. */
|
|
11
|
+
open: 60,
|
|
12
|
+
"open-concurrent": 60,
|
|
13
|
+
/** pr-plan.json at the head, from the push. */
|
|
14
|
+
plan: 600,
|
|
15
|
+
/** The forge review and chant approve. */
|
|
16
|
+
approve: 120,
|
|
17
|
+
/** The merge and its merge commit. */
|
|
18
|
+
merge: 60,
|
|
19
|
+
/** pr-apply.json at the merge commit, from the merge. */
|
|
20
|
+
apply: 900,
|
|
21
|
+
/** A command run out of band. */
|
|
22
|
+
"out-of-band": 600,
|
|
23
|
+
/** Finding and killing a running job. */
|
|
24
|
+
"kill-job": 120,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** A scenario's limits over the defaults. */
|
|
28
|
+
export function limitsFor(over: Partial<Record<ScenarioStepKind, number>> = {}): Record<ScenarioStepKind, number> {
|
|
29
|
+
return { ...HARNESS_LIMITS, ...over };
|
|
30
|
+
}
|
package/src/exit-codes.test.ts
CHANGED
|
@@ -6,8 +6,9 @@ import { DRIFT_EXIT_CODE } from "./op/types";
|
|
|
6
6
|
import { PR_ENV_EXIT } from "./components/pr-environment";
|
|
7
7
|
|
|
8
8
|
describe("the exit-code table (#4553)", () => {
|
|
9
|
-
test("has one name per code, 0 to
|
|
10
|
-
expect(Object.values(CHANT_EXIT)).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8]);
|
|
9
|
+
test("has one name per code, 0 to 9", () => {
|
|
10
|
+
expect(Object.values(CHANT_EXIT)).toEqual([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
|
|
11
|
+
expect(chantExitName(9)).toBe("misplaced");
|
|
11
12
|
expect(chantExitName(4)).toBe("moved");
|
|
12
13
|
expect(chantExitName(40)).toBeUndefined();
|
|
13
14
|
});
|
package/src/exit-codes.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* the code through unchanged.
|
|
9
9
|
*
|
|
10
10
|
* The numbers are the ones op waves already used, so a pipeline reading op
|
|
11
|
-
* waves' 3 to 8 sees no change. A moved plan is 4 and a waiting run 3; before
|
|
11
|
+
* waves' 3 to 8 sees no change. 9 is the apply-job guard's (#4624). A moved plan is 4 and a waiting run 3; before
|
|
12
12
|
* this table both were 3 outside op waves.
|
|
13
13
|
*
|
|
14
14
|
* A usage or config error has no code of its own: it is `failed`, 1.
|
|
@@ -38,6 +38,12 @@ export const CHANT_EXIT = {
|
|
|
38
38
|
denied: 7,
|
|
39
39
|
/** A decision point answered with an answer the gate does not pass on. */
|
|
40
40
|
declined: 8,
|
|
41
|
+
/**
|
|
42
|
+
* The apply-job guard stopped the job (#4624): it runs somewhere its spec
|
|
43
|
+
* did not set it to run, or it carries no spec the guard can read. Outside
|
|
44
|
+
* the GitLab op-wave jobs' allowed failure (1), so the waves after it stop.
|
|
45
|
+
*/
|
|
46
|
+
misplaced: 9,
|
|
41
47
|
} as const;
|
|
42
48
|
|
|
43
49
|
/** A name in {@link CHANT_EXIT}. */
|
|
@@ -60,8 +60,6 @@ describe("the gate-decision bundle", () => {
|
|
|
60
60
|
// The release names a wave writes (#4615), checked with the spec.
|
|
61
61
|
"packages/core/src/op/op-waves-release.ts",
|
|
62
62
|
"packages/core/src/op/op-waves.ts",
|
|
63
|
-
// The next-release floor constant (#4480): no imports.
|
|
64
|
-
"packages/core/src/release-floors.ts",
|
|
65
63
|
"packages/core/src/sorted-json.ts",
|
|
66
64
|
"packages/core/src/wave-blocked.ts",
|
|
67
65
|
"packages/core/src/wave-layout.ts",
|