@intentius/chant 0.124.46 → 0.124.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__golden__/wave-loop/op-by-apply-after-fails.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-hold.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-ignored.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-pass.json +10 -0
- package/dist/__golden__/wave-loop/op-by-apply-skip.json +10 -0
- package/dist/__golden__/wave-loop/op-cost-member-clash.json +6 -0
- package/dist/__golden__/wave-loop/op-cost-member.json +13 -0
- package/dist/__golden__/wave-loop/op-denied-source.json +16 -0
- package/dist/__golden__/wave-loop/op-denied.json +16 -0
- package/dist/__golden__/wave-loop/op-discover-rest-short.json +6 -0
- package/dist/__golden__/wave-loop/op-discover-rest-stops.json +13 -0
- package/dist/__golden__/wave-loop/op-discover-rest.json +26 -0
- package/dist/__golden__/wave-loop/op-discover-wide.json +26 -0
- package/dist/__golden__/wave-loop/op-held-on-again.json +16 -0
- package/dist/__golden__/wave-loop/op-held-on-before-apply.json +16 -0
- package/dist/__golden__/wave-loop/op-held-on.json +16 -0
- package/dist/__golden__/wave-loop/op-hooks-apply-fails.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-fail-after-apply.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-fail-before-apply.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-fail-before-plan.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-held.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-hold-before-apply.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-pass.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-refused-at-base.json +13 -0
- package/dist/__golden__/wave-loop/op-hooks-share.json +33 -0
- package/dist/__golden__/wave-loop/op-outcome-held.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-replan-approved.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-replan-forever.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-replan.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-stood-down.json +10 -0
- package/dist/__golden__/wave-loop/op-outcome-unreadable.json +10 -0
- package/dist/__golden__/wave-loop/op-overridden.json +16 -0
- package/dist/__golden__/wave-loop/op-per-run.json +20 -0
- package/dist/__golden__/wave-loop/op-point.json +13 -0
- package/dist/__golden__/wave-loop/op-pr-review.json +10 -0
- package/dist/__golden__/wave-loop/op-sealed.json +10 -0
- package/dist/__golden__/wave-loop/op-spend-change-only.json +10 -0
- package/dist/__golden__/wave-loop/op-spend.json +10 -0
- package/dist/__golden__/wave-loop/op-wave-commands.json +55 -0
- package/dist/__golden__/wave-loop/op-wide-refused.json +26 -0
- package/dist/__golden__/wave-loop/op-wide-waiting.json +29 -0
- package/dist/__golden__/wave-loop/op-wide.json +39 -0
- package/dist/action-pins.d.ts +61 -0
- package/dist/action-pins.d.ts.map +1 -0
- package/dist/action-pins.js +77 -0
- package/dist/cli/commands/carve.d.ts +3 -0
- package/dist/cli/commands/carve.d.ts.map +1 -1
- package/dist/cli/commands/carve.js +36 -7
- package/dist/cli/commands/import-report.d.ts +26 -0
- package/dist/cli/commands/import-report.d.ts.map +1 -0
- package/dist/cli/commands/import-report.js +65 -0
- package/dist/cli/commands/import.d.ts +11 -1
- package/dist/cli/commands/import.d.ts.map +1 -1
- package/dist/cli/commands/import.js +22 -3
- package/dist/cli/commands/migrate.d.ts +13 -1
- package/dist/cli/commands/migrate.d.ts.map +1 -1
- package/dist/cli/commands/migrate.js +134 -10
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +41 -14
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +6 -1
- package/dist/cli/handlers/graph-reader.d.ts +26 -0
- package/dist/cli/handlers/graph-reader.d.ts.map +1 -0
- package/dist/cli/handlers/graph-reader.js +41 -0
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/graph.js +14 -0
- package/dist/cli/handlers/ledger.d.ts +3 -0
- package/dist/cli/handlers/ledger.d.ts.map +1 -0
- package/dist/cli/handlers/ledger.js +55 -0
- package/dist/cli/handlers/migrate.d.ts.map +1 -1
- package/dist/cli/handlers/migrate.js +18 -11
- package/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/misc.js +12 -1
- package/dist/cli/handlers/pr-env.js +2 -2
- package/dist/cli/handlers/pr.d.ts +15 -1
- package/dist/cli/handlers/pr.d.ts.map +1 -1
- package/dist/cli/handlers/pr.js +183 -40
- package/dist/cli/handlers/query.d.ts +7 -2
- package/dist/cli/handlers/query.d.ts.map +1 -1
- package/dist/cli/handlers/query.js +16 -4
- package/dist/cli/handlers/release.d.ts.map +1 -1
- package/dist/cli/handlers/release.js +6 -3
- package/dist/cli/handlers/search.d.ts +2 -4
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/handlers/search.js +13 -39
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +87 -14
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +47 -2
- package/dist/cli/registry.d.ts +22 -4
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/builders.d.ts +5 -1
- package/dist/components/builders.d.ts.map +1 -1
- package/dist/components/builders.js +5 -0
- package/dist/components/capability-plugin-loader.d.ts.map +1 -1
- package/dist/components/capability-plugin-loader.js +16 -1
- package/dist/components/capability-plugin.d.ts +14 -0
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/pr-hooks.d.ts +21 -1
- package/dist/components/pr-hooks.d.ts.map +1 -1
- package/dist/components/pr-hooks.js +72 -4
- package/dist/components/pr-pipeline.d.ts +45 -10
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +47 -14
- package/dist/components/pr-policy.d.ts +36 -0
- package/dist/components/pr-policy.d.ts.map +1 -1
- package/dist/components/pr-policy.js +36 -0
- package/dist/components/pr-run.d.ts +3 -0
- package/dist/components/pr-run.d.ts.map +1 -1
- package/dist/components/pr-run.js +1 -0
- package/dist/components/starter-plugin.d.ts +1 -0
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/components/starter-plugin.js +5 -1
- package/dist/components/verbs/index.d.ts +2 -0
- package/dist/components/verbs/index.d.ts.map +1 -1
- package/dist/components/verbs/index.js +2 -0
- package/dist/components/verbs/publish-artifact.d.ts +65 -0
- package/dist/components/verbs/publish-artifact.d.ts.map +1 -0
- package/dist/components/verbs/publish-artifact.js +74 -0
- package/dist/components/verbs/publish-image.d.ts +129 -0
- package/dist/components/verbs/publish-image.d.ts.map +1 -0
- package/dist/components/verbs/publish-image.js +145 -0
- package/dist/config-environments.d.ts +20 -0
- package/dist/config-environments.d.ts.map +1 -1
- package/dist/config-environments.js +12 -0
- package/dist/config.d.ts +25 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -2
- package/dist/gate-decision.d.ts +20 -2
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +30 -3
- package/dist/graph-ir.d.ts +25 -0
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-walk.d.ts +66 -0
- package/dist/graph-walk.d.ts.map +1 -0
- package/dist/graph-walk.js +70 -0
- package/dist/import/parser.d.ts +19 -0
- package/dist/import/parser.d.ts.map +1 -1
- package/dist/lexicon.d.ts +94 -6
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +11 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/git.d.ts +2 -5
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/ledger-read.d.ts +65 -0
- package/dist/lifecycle/ledger-read.d.ts.map +1 -0
- package/dist/lifecycle/ledger-read.js +160 -0
- package/dist/lifecycle/release-workstation.d.ts +7 -0
- package/dist/lifecycle/release-workstation.d.ts.map +1 -1
- package/dist/lifecycle/release-workstation.js +25 -0
- package/dist/lifecycle/run-ledger.d.ts +4 -3
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.js +1 -0
- package/dist/lint/discover.js +3 -1
- package/dist/lint/post-synth.d.ts +127 -1
- package/dist/lint/post-synth.d.ts.map +1 -1
- package/dist/lint/post-synth.js +84 -2
- package/dist/lint/rules/op/index.d.ts +1 -0
- package/dist/lint/rules/op/index.d.ts.map +1 -1
- package/dist/lint/rules/op/index.js +2 -0
- package/dist/lint/rules/op/ops019-workspace-op-target.d.ts +32 -0
- package/dist/lint/rules/op/ops019-workspace-op-target.d.ts.map +1 -0
- package/dist/lint/rules/op/ops019-workspace-op-target.js +63 -0
- package/dist/op/activities/activity-contracts.d.ts +9 -6
- package/dist/op/activities/activity-contracts.d.ts.map +1 -1
- package/dist/op/activities/activity-contracts.js +5 -2
- package/dist/op/activities/index.d.ts +2 -2
- package/dist/op/activities/index.d.ts.map +1 -1
- package/dist/op/activities/index.js +1 -1
- package/dist/op/activities/review-agent.d.ts +90 -4
- package/dist/op/activities/review-agent.d.ts.map +1 -1
- package/dist/op/activities/review-agent.js +217 -19
- package/dist/op/activities/work-evidence.d.ts +8 -1
- package/dist/op/activities/work-evidence.d.ts.map +1 -1
- package/dist/op/activities/work-evidence.js +1 -0
- package/dist/op/builders.d.ts +9 -5
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +9 -5
- package/dist/op/composites/apply-op.d.ts +29 -2
- package/dist/op/composites/apply-op.d.ts.map +1 -1
- package/dist/op/composites/apply-op.js +20 -1
- package/dist/op/gate-approval-base.d.ts +25 -0
- package/dist/op/gate-approval-base.d.ts.map +1 -0
- package/dist/op/gate-approval-base.js +71 -0
- package/dist/op/gate-approval.d.ts +18 -9
- package/dist/op/gate-approval.d.ts.map +1 -1
- package/dist/op/gate-approval.js +13 -31
- package/dist/op/gate-name.d.ts +13 -0
- package/dist/op/gate-name.d.ts.map +1 -1
- package/dist/op/gate-name.js +14 -1
- package/dist/op/gate-quorum.d.ts +100 -3
- package/dist/op/gate-quorum.d.ts.map +1 -1
- package/dist/op/gate-quorum.js +108 -6
- package/dist/op/gate-review.d.ts +9 -0
- package/dist/op/gate-review.d.ts.map +1 -1
- package/dist/op/gate-review.js +13 -0
- package/dist/op/gate.d.ts +47 -5
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +25 -4
- package/dist/op/index.d.ts +3 -3
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/local-executor.d.ts +45 -3
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +68 -7
- package/dist/op/op-waves-run.d.ts +26 -1
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +259 -13
- package/dist/op/op-waves.d.ts +72 -5
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +110 -15
- package/dist/op/runtime.d.ts +11 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/op/schedule-overdue.d.ts +16 -0
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +36 -0
- package/dist/op/stage-hooks.d.ts +9 -2
- package/dist/op/stage-hooks.d.ts.map +1 -1
- package/dist/op/stage-hooks.js +7 -5
- package/dist/op/workspace-run-env.d.ts +22 -0
- package/dist/op/workspace-run-env.d.ts.map +1 -0
- package/dist/op/workspace-run-env.js +21 -0
- package/dist/pr-forge.d.ts +24 -0
- package/dist/pr-forge.d.ts.map +1 -1
- package/dist/pr-forge.js +47 -0
- package/dist/pr-loop.d.ts +10 -0
- package/dist/pr-loop.d.ts.map +1 -1
- package/dist/pr-loop.js +4 -0
- package/dist/pr-migrations.d.ts +62 -0
- package/dist/pr-migrations.d.ts.map +1 -0
- package/dist/pr-migrations.js +50 -0
- package/dist/pr-post.d.ts +42 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +68 -2
- package/dist/read-filter.d.ts +65 -0
- package/dist/read-filter.d.ts.map +1 -0
- package/dist/read-filter.js +179 -0
- package/dist/run-event.d.ts +1 -1
- package/dist/run-event.d.ts.map +1 -1
- package/dist/terraform/carve.d.ts +24 -3
- package/dist/terraform/carve.d.ts.map +1 -1
- package/dist/terraform/carve.js +32 -14
- package/dist/terraform/cuts.d.ts +97 -0
- package/dist/terraform/cuts.d.ts.map +1 -0
- package/dist/terraform/cuts.js +138 -0
- package/dist/terraform/folds.d.ts +26 -0
- package/dist/terraform/folds.d.ts.map +1 -0
- package/dist/terraform/folds.js +38 -0
- package/dist/terraform/graph.d.ts.map +1 -1
- package/dist/terraform/graph.js +10 -0
- package/dist/terraform/reach.d.ts +140 -0
- package/dist/terraform/reach.d.ts.map +1 -0
- package/dist/terraform/reach.js +170 -0
- package/dist/terraform/score.d.ts +14 -0
- package/dist/terraform/score.d.ts.map +1 -1
- package/dist/terraform/score.js +14 -31
- package/dist/terraform/state.d.ts.map +1 -1
- package/dist/terraform/state.js +4 -2
- package/dist/terraform/types.d.ts +8 -0
- package/dist/terraform/types.d.ts.map +1 -1
- package/dist/wave-blocked.d.ts +10 -1
- package/dist/wave-blocked.d.ts.map +1 -1
- package/dist/wave-blocked.js +31 -3
- package/dist/wave-runtime.mjs +264 -254
- package/dist/workspace/check.schema.json +13 -2
- package/dist/workspace/checks/ci-branch.d.ts +44 -0
- package/dist/workspace/checks/ci-branch.d.ts.map +1 -0
- package/dist/workspace/checks/ci-branch.js +133 -0
- package/dist/workspace/checks/gate-approval.d.ts +58 -0
- package/dist/workspace/checks/gate-approval.d.ts.map +1 -0
- package/dist/workspace/checks/gate-approval.js +103 -0
- package/dist/workspace/checks/links.d.ts +3 -0
- package/dist/workspace/checks/links.d.ts.map +1 -1
- package/dist/workspace/checks/links.js +12 -1
- package/dist/workspace/checks/org.d.ts +48 -0
- package/dist/workspace/checks/org.d.ts.map +1 -0
- package/dist/workspace/checks/org.js +156 -0
- package/dist/workspace/checks.d.ts +12 -1
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/checks.js +63 -7
- package/dist/workspace/ci-branches.d.ts +16 -0
- package/dist/workspace/ci-branches.d.ts.map +1 -1
- package/dist/workspace/ci-branches.js +27 -0
- package/dist/workspace/ci-green-cli.js +7 -7
- package/dist/workspace/ci-green-workflow.d.ts +1 -1
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +13 -8
- package/dist/workspace/ci-green.d.ts +14 -0
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +44 -11
- package/dist/workspace/ci-run.d.ts +9 -1
- package/dist/workspace/ci-run.d.ts.map +1 -1
- package/dist/workspace/ci-run.js +67 -6
- package/dist/workspace/ci-serve.d.ts +9 -0
- package/dist/workspace/ci-serve.d.ts.map +1 -1
- package/dist/workspace/ci-serve.js +114 -76
- package/dist/workspace/compose-graph.d.ts +14 -0
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/composites.d.ts +4 -1
- package/dist/workspace/composites.d.ts.map +1 -1
- package/dist/workspace/composites.js +5 -2
- package/dist/workspace/composites.schema.json +22 -0
- package/dist/workspace/conformance/__writer_fixture__/work/work.schema.json +105 -1
- package/dist/workspace/cross-root-lint.d.ts +56 -0
- package/dist/workspace/cross-root-lint.d.ts.map +1 -0
- package/dist/workspace/cross-root-lint.js +111 -0
- package/dist/workspace/dbt-models-reader.d.ts +44 -0
- package/dist/workspace/dbt-models-reader.d.ts.map +1 -0
- package/dist/workspace/dbt-models-reader.js +356 -0
- package/dist/workspace/dbt-project-common.d.ts +40 -0
- package/dist/workspace/dbt-project-common.d.ts.map +1 -0
- package/dist/workspace/dbt-project-common.js +106 -0
- package/dist/workspace/dbt-project-reader.d.ts +4 -3
- package/dist/workspace/dbt-project-reader.d.ts.map +1 -1
- package/dist/workspace/dbt-project-reader.js +14 -108
- package/dist/workspace/decision-rank.d.ts +26 -0
- package/dist/workspace/decision-rank.d.ts.map +1 -0
- package/dist/workspace/decision-rank.js +16 -0
- package/dist/workspace/declaration.d.ts +50 -2
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +57 -11
- package/dist/workspace/declaration.schema.json +166 -24
- package/dist/workspace/environments.d.ts +26 -2
- package/dist/workspace/environments.d.ts.map +1 -1
- package/dist/workspace/environments.js +26 -2
- package/dist/workspace/exit-cli.d.ts +44 -0
- package/dist/workspace/exit-cli.d.ts.map +1 -0
- package/dist/workspace/exit-cli.js +198 -0
- package/dist/workspace/exit.d.ts +159 -0
- package/dist/workspace/exit.d.ts.map +1 -0
- package/dist/workspace/exit.js +480 -0
- package/dist/workspace/exit.schema.json +257 -0
- package/dist/workspace/flyway-dir.d.ts +39 -0
- package/dist/workspace/flyway-dir.d.ts.map +1 -0
- package/dist/workspace/flyway-dir.js +104 -0
- package/dist/workspace/flyway-layout.d.ts +96 -0
- package/dist/workspace/flyway-layout.d.ts.map +1 -0
- package/dist/workspace/flyway-layout.js +308 -0
- package/dist/workspace/graph-cache.d.ts +3 -1
- package/dist/workspace/graph-cache.d.ts.map +1 -1
- package/dist/workspace/graph-cache.js +12 -1
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/graph-cli.js +26 -8
- package/dist/workspace/graph.schema.json +34 -0
- package/dist/workspace/import-fetch.d.ts +38 -0
- package/dist/workspace/import-fetch.d.ts.map +1 -0
- package/dist/workspace/import-fetch.js +99 -0
- package/dist/workspace/import-init.d.ts +26 -0
- package/dist/workspace/import-init.d.ts.map +1 -0
- package/dist/workspace/import-init.js +130 -0
- package/dist/workspace/import-source.d.ts +147 -0
- package/dist/workspace/import-source.d.ts.map +1 -0
- package/dist/workspace/import-source.js +370 -0
- package/dist/workspace/init.d.ts +4 -0
- package/dist/workspace/init.d.ts.map +1 -1
- package/dist/workspace/init.js +70 -3
- package/dist/workspace/intent.d.ts +2 -3
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/intent.js +5 -9
- package/dist/workspace/kind-link-readers.d.ts +59 -2
- package/dist/workspace/kind-link-readers.d.ts.map +1 -1
- package/dist/workspace/kind-link-readers.js +17 -1
- package/dist/workspace/kind-readers.d.ts +6 -0
- package/dist/workspace/kind-readers.d.ts.map +1 -1
- package/dist/workspace/kind-readers.js +18 -0
- package/dist/workspace/kinds.d.ts +90 -3
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +161 -7
- package/dist/workspace/ledger.schema.json +158 -0
- package/dist/workspace/lexicon-outputs.d.ts +20 -1
- package/dist/workspace/lexicon-outputs.d.ts.map +1 -1
- package/dist/workspace/lexicon-outputs.js +102 -10
- package/dist/workspace/lineage-check.d.ts +3 -0
- package/dist/workspace/lineage-check.d.ts.map +1 -1
- package/dist/workspace/lineage-check.js +23 -4
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.js +13 -4
- package/dist/workspace/links.d.ts +8 -1
- package/dist/workspace/links.d.ts.map +1 -1
- package/dist/workspace/links.js +25 -1
- package/dist/workspace/ls.d.ts +8 -0
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/ls.js +7 -1
- package/dist/workspace/ls.schema.json +7 -0
- package/dist/workspace/member-commands.d.ts.map +1 -1
- package/dist/workspace/member-commands.js +54 -5
- package/dist/workspace/migrate-links.d.ts +45 -0
- package/dist/workspace/migrate-links.d.ts.map +1 -0
- package/dist/workspace/migrate-links.js +100 -0
- package/dist/workspace/migration-dirs.d.ts +74 -0
- package/dist/workspace/migration-dirs.d.ts.map +1 -0
- package/dist/workspace/migration-dirs.js +254 -0
- package/dist/workspace/new-migrations.d.ts +47 -0
- package/dist/workspace/new-migrations.d.ts.map +1 -0
- package/dist/workspace/new-migrations.js +91 -0
- package/dist/workspace/pr-report.schema.json +46 -0
- package/dist/workspace/promote.d.ts +96 -0
- package/dist/workspace/promote.d.ts.map +1 -0
- package/dist/workspace/promote.js +263 -0
- package/dist/workspace/reason-codes.d.ts +21 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +25 -0
- package/dist/workspace/records-cli.d.ts +11 -0
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-cli.js +57 -5
- package/dist/workspace/records.schema.json +5 -0
- package/dist/workspace/release-candidates.d.ts +2 -0
- package/dist/workspace/release-candidates.d.ts.map +1 -1
- package/dist/workspace/release-candidates.js +5 -2
- package/dist/workspace/release-train.d.ts +53 -0
- package/dist/workspace/release-train.d.ts.map +1 -0
- package/dist/workspace/release-train.js +134 -0
- package/dist/workspace/release-workflow.d.ts.map +1 -1
- package/dist/workspace/release-workflow.js +4 -3
- package/dist/workspace/repo-ref.d.ts +45 -0
- package/dist/workspace/repo-ref.d.ts.map +1 -0
- package/dist/workspace/repo-ref.js +114 -0
- package/dist/workspace/run-event.schema.json +2 -2
- package/dist/workspace/runs-cli.d.ts +9 -0
- package/dist/workspace/runs-cli.d.ts.map +1 -1
- package/dist/workspace/runs-cli.js +48 -3
- package/dist/workspace/runs.schema.json +7 -0
- package/dist/workspace/search-contract.d.ts +1 -1
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/status-decisions.d.ts +37 -0
- package/dist/workspace/status-decisions.d.ts.map +1 -0
- package/dist/workspace/status-decisions.js +147 -0
- package/dist/workspace/status-gates.d.ts +9 -0
- package/dist/workspace/status-gates.d.ts.map +1 -1
- package/dist/workspace/status.d.ts +4 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/status.js +14 -2
- package/dist/workspace/status.schema.json +6 -0
- package/dist/workspace/work-cli.d.ts.map +1 -1
- package/dist/workspace/work-cli.js +5 -3
- package/dist/workspace/work-evidence-ops.d.ts +83 -0
- package/dist/workspace/work-evidence-ops.d.ts.map +1 -0
- package/dist/workspace/work-evidence-ops.js +169 -0
- package/dist/workspace/work-evidence.d.ts +12 -2
- package/dist/workspace/work-evidence.d.ts.map +1 -1
- package/dist/workspace/work-evidence.js +21 -3
- package/dist/workspace/work-evidence.schema.json +49 -2
- package/dist/workspace/workspace-gates.d.ts +110 -0
- package/dist/workspace/workspace-gates.d.ts.map +1 -0
- package/dist/workspace/workspace-gates.js +140 -0
- package/dist/workspace/workspace-kinds.schema.json +108 -10
- package/dist/workspace/workspace-ledger.d.ts +76 -0
- package/dist/workspace/workspace-ledger.d.ts.map +1 -0
- package/dist/workspace/workspace-ledger.js +91 -0
- package/dist/workspace/workspace-run.d.ts +112 -0
- package/dist/workspace/workspace-run.d.ts.map +1 -0
- package/dist/workspace/workspace-run.js +432 -0
- package/package.json +1 -1
- package/src/__golden__/wave-loop/op-by-apply-after-fails.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-hold.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-ignored.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-pass.json +10 -0
- package/src/__golden__/wave-loop/op-by-apply-skip.json +10 -0
- package/src/__golden__/wave-loop/op-cost-member-clash.json +6 -0
- package/src/__golden__/wave-loop/op-cost-member.json +13 -0
- package/src/__golden__/wave-loop/op-denied-source.json +16 -0
- package/src/__golden__/wave-loop/op-denied.json +16 -0
- package/src/__golden__/wave-loop/op-discover-rest-short.json +6 -0
- package/src/__golden__/wave-loop/op-discover-rest-stops.json +13 -0
- package/src/__golden__/wave-loop/op-discover-rest.json +26 -0
- package/src/__golden__/wave-loop/op-discover-wide.json +26 -0
- package/src/__golden__/wave-loop/op-held-on-again.json +16 -0
- package/src/__golden__/wave-loop/op-held-on-before-apply.json +16 -0
- package/src/__golden__/wave-loop/op-held-on.json +16 -0
- package/src/__golden__/wave-loop/op-hooks-apply-fails.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-fail-after-apply.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-fail-before-apply.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-fail-before-plan.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-held.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-hold-before-apply.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-pass.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-refused-at-base.json +13 -0
- package/src/__golden__/wave-loop/op-hooks-share.json +33 -0
- package/src/__golden__/wave-loop/op-outcome-held.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-replan-approved.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-replan-forever.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-replan.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-stood-down.json +10 -0
- package/src/__golden__/wave-loop/op-outcome-unreadable.json +10 -0
- package/src/__golden__/wave-loop/op-overridden.json +16 -0
- package/src/__golden__/wave-loop/op-per-run.json +20 -0
- package/src/__golden__/wave-loop/op-point.json +13 -0
- package/src/__golden__/wave-loop/op-pr-review.json +10 -0
- package/src/__golden__/wave-loop/op-sealed.json +10 -0
- package/src/__golden__/wave-loop/op-spend-change-only.json +10 -0
- package/src/__golden__/wave-loop/op-spend.json +10 -0
- package/src/__golden__/wave-loop/op-wave-commands.json +55 -0
- package/src/__golden__/wave-loop/op-wide-refused.json +26 -0
- package/src/__golden__/wave-loop/op-wide-waiting.json +29 -0
- package/src/__golden__/wave-loop/op-wide.json +39 -0
- package/src/action-pins.test.ts +78 -0
- package/src/action-pins.ts +92 -0
- package/src/cli/commands/carve-score-once.test.ts +99 -0
- package/src/cli/commands/carve.ts +37 -6
- package/src/cli/commands/check-lexicon.test.ts +2 -2
- package/src/cli/commands/import-report.ts +71 -0
- package/src/cli/commands/import.ts +33 -3
- package/src/cli/commands/migrate-dialect.test.ts +145 -0
- package/src/cli/commands/migrate.ts +132 -11
- package/src/cli/handlers/__snapshots__/build-member.test.ts.snap +4 -4
- package/src/cli/handlers/approve.ts +33 -4
- package/src/cli/handlers/build.ts +7 -1
- package/src/cli/handlers/graph-reader.test.ts +31 -0
- package/src/cli/handlers/graph-reader.ts +51 -0
- package/src/cli/handlers/graph.ts +14 -0
- package/src/cli/handlers/ledger.ts +54 -0
- package/src/cli/handlers/migrate.ts +21 -12
- package/src/cli/handlers/misc.ts +10 -1
- package/src/cli/handlers/pr-env.ts +2 -2
- package/src/cli/handlers/pr.ts +176 -37
- package/src/cli/handlers/query.ts +16 -4
- package/src/cli/handlers/release.ts +6 -3
- package/src/cli/handlers/search.ts +13 -34
- package/src/cli/main.test.ts +17 -0
- package/src/cli/main.ts +87 -14
- package/src/cli/parse-args.ts +35 -2
- package/src/cli/registry.ts +22 -4
- package/src/components/builders.ts +8 -0
- package/src/components/capability-plugin-loader.ts +13 -1
- package/src/components/capability-plugin.ts +16 -0
- package/src/components/pr-env-run-bundle.test.ts +1 -0
- package/src/components/pr-hooks.test.ts +73 -5
- package/src/components/pr-hooks.ts +95 -5
- package/src/components/pr-pipeline.ts +64 -16
- package/src/components/pr-policy.test.ts +64 -1
- package/src/components/pr-policy.ts +53 -0
- package/src/components/pr-run.ts +4 -0
- package/src/components/registry.test.ts +1 -1
- package/src/components/starter-plugin.ts +6 -0
- package/src/components/verbs/index.ts +2 -0
- package/src/components/verbs/publish-artifact.test.ts +60 -0
- package/src/components/verbs/publish-artifact.ts +122 -0
- package/src/components/verbs/publish-image.test.ts +101 -0
- package/src/components/verbs/publish-image.ts +265 -0
- package/src/config-environments.ts +28 -1
- package/src/config.ts +24 -1
- package/src/gate-decision-bundle.test.ts +5 -2
- package/src/gate-decision-identity.test.ts +20 -0
- package/src/gate-decision.ts +46 -3
- package/src/graph-ir.ts +27 -0
- package/src/graph-walk.test.ts +44 -0
- package/src/graph-walk.ts +102 -0
- package/src/import/parser.ts +20 -0
- package/src/lexicon.ts +98 -6
- package/src/lifecycle/gate-ledger.ts +8 -0
- package/src/lifecycle/git.ts +2 -2
- package/src/lifecycle/ledger-read.test.ts +107 -0
- package/src/lifecycle/ledger-read.ts +195 -0
- package/src/lifecycle/release-workstation.ts +24 -0
- package/src/lifecycle/run-ledger.ts +5 -2
- package/src/lint/cross-root.test.ts +122 -0
- package/src/lint/discover.ts +3 -1
- package/src/lint/post-synth.ts +212 -2
- package/src/lint/rules/op/index.ts +2 -0
- package/src/lint/rules/op/ops019-workspace-op-target.ts +89 -0
- package/src/op/activities/activity-contracts.ts +5 -2
- package/src/op/activities/index.ts +2 -2
- package/src/op/activities/review-agent.test.ts +221 -4
- package/src/op/activities/review-agent.ts +265 -22
- package/src/op/activities/work-evidence.ts +9 -1
- package/src/op/builders.ts +9 -5
- package/src/op/composites/apply-op.test.ts +108 -0
- package/src/op/composites/apply-op.ts +37 -2
- package/src/op/gate-approval-at-base.test.ts +97 -0
- package/src/op/gate-approval-base.ts +72 -0
- package/src/op/gate-approval.test.ts +6 -1
- package/src/op/gate-approval.ts +22 -27
- package/src/op/gate-name.ts +16 -1
- package/src/op/gate-quorum-at-base.test.ts +211 -0
- package/src/op/gate-quorum.ts +156 -8
- package/src/op/gate-review.ts +14 -0
- package/src/op/gate.ts +69 -9
- package/src/op/index.ts +3 -2
- package/src/op/local-executor.ts +91 -11
- package/src/op/op-waves-depends-on.test.ts +81 -0
- package/src/op/op-waves-hook-targets.test.ts +4 -2
- package/src/op/op-waves-quorum-product.test.ts +158 -0
- package/src/op/op-waves-run.ts +288 -14
- package/src/op/op-waves.ts +143 -14
- package/src/op/runtime.ts +8 -0
- package/src/op/schedule-overdue.ts +33 -0
- package/src/op/stage-hooks.ts +13 -5
- package/src/op/workspace-run-env.ts +29 -0
- package/src/pr-forge-bundle.test.ts +2 -2
- package/src/pr-forge.test.ts +47 -0
- package/src/pr-forge.ts +68 -0
- package/src/pr-loop-bundle.test.ts +3 -2
- package/src/pr-loop.test.ts +52 -0
- package/src/pr-loop.ts +12 -0
- package/src/pr-migrations.ts +97 -0
- package/src/pr-post-open.e2e.test.ts +36 -0
- package/src/pr-post.test.ts +102 -3
- package/src/pr-post.ts +90 -2
- package/src/read-filter.test.ts +54 -0
- package/src/read-filter.ts +193 -0
- package/src/run-event.ts +1 -1
- package/src/stage-hooks-bundle.test.ts +1 -0
- package/src/terraform/carve.ts +52 -15
- package/src/terraform/cuts.test.ts +173 -0
- package/src/terraform/cuts.ts +188 -0
- package/src/terraform/folds.ts +44 -0
- package/src/terraform/graph.ts +9 -0
- package/src/terraform/radius.test.ts +90 -0
- package/src/terraform/reach.test.ts +146 -0
- package/src/terraform/reach.ts +247 -0
- package/src/terraform/score.ts +27 -29
- package/src/terraform/state.ts +3 -1
- package/src/terraform/types.ts +8 -0
- package/src/wave-blocked.ts +28 -3
- package/src/wave-loop-golden.test.ts +4 -3
- package/src/workspace/__fixtures__/import/spacelift.json +9 -0
- package/src/workspace/__fixtures__/import/tfc.json +13 -0
- package/src/workspace/behold-kinds.test.ts +2 -1
- package/src/workspace/check-contract.test.ts +8 -6
- package/src/workspace/check.schema.json +13 -2
- package/src/workspace/checks/ci-branch.test.ts +128 -0
- package/src/workspace/checks/ci-branch.ts +141 -0
- package/src/workspace/checks/gate-approval.test.ts +77 -0
- package/src/workspace/checks/gate-approval.ts +121 -0
- package/src/workspace/checks/links.ts +12 -1
- package/src/workspace/checks/org.ts +169 -0
- package/src/workspace/checks.ts +68 -7
- package/src/workspace/ci-branches.ts +31 -0
- package/src/workspace/ci-green-branches.test.ts +153 -0
- package/src/workspace/ci-green-cli.ts +7 -7
- package/src/workspace/ci-green-workflow.test.ts +4 -3
- package/src/workspace/ci-green-workflow.ts +13 -9
- package/src/workspace/ci-green.ts +49 -12
- package/src/workspace/ci-run.test.ts +72 -1
- package/src/workspace/ci-run.ts +68 -8
- package/src/workspace/ci-serve.test.ts +95 -0
- package/src/workspace/ci-serve.ts +106 -65
- package/src/workspace/component-environments.test.ts +25 -2
- package/src/workspace/compose-graph.ts +9 -2
- package/src/workspace/composites.schema.json +22 -0
- package/src/workspace/composites.test.ts +39 -8
- package/src/workspace/composites.ts +6 -2
- package/src/workspace/conformance/__writer_fixture__/work/work.schema.json +105 -1
- package/src/workspace/cross-root-lint.test.ts +90 -0
- package/src/workspace/cross-root-lint.ts +126 -0
- package/src/workspace/dbt-kind.test.ts +3 -2
- package/src/workspace/dbt-models-reader.ts +362 -0
- package/src/workspace/dbt-models.test.ts +248 -0
- package/src/workspace/dbt-project-common.ts +113 -0
- package/src/workspace/dbt-project-reader.ts +29 -112
- package/src/workspace/decision-rank.ts +40 -0
- package/src/workspace/declaration.schema.json +166 -24
- package/src/workspace/declaration.ts +101 -15
- package/src/workspace/environments.ts +40 -4
- package/src/workspace/exit-cli.ts +219 -0
- package/src/workspace/exit.schema.json +257 -0
- package/src/workspace/exit.test.ts +185 -0
- package/src/workspace/exit.ts +560 -0
- package/src/workspace/flyway-dir.ts +113 -0
- package/src/workspace/flyway-layout.ts +337 -0
- package/src/workspace/graph-cache.ts +12 -2
- package/src/workspace/graph-cli.ts +25 -10
- package/src/workspace/graph-contract.test.ts +4 -2
- package/src/workspace/graph.schema.json +34 -0
- package/src/workspace/identity.test.ts +29 -2
- package/src/workspace/import-fetch.ts +151 -0
- package/src/workspace/import-init.ts +147 -0
- package/src/workspace/import-source.test.ts +183 -0
- package/src/workspace/import-source.ts +462 -0
- package/src/workspace/init.test.ts +55 -1
- package/src/workspace/init.ts +66 -4
- package/src/workspace/intent.ts +6 -14
- package/src/workspace/kind-link-readers.ts +68 -3
- package/src/workspace/kind-readers.test.ts +36 -0
- package/src/workspace/kind-readers.ts +18 -1
- package/src/workspace/kinds.test.ts +35 -7
- package/src/workspace/kinds.ts +212 -11
- package/src/workspace/ledger.schema.json +158 -0
- package/src/workspace/lexicon-outputs.ts +132 -13
- package/src/workspace/lineage-check.ts +30 -7
- package/src/workspace/lineage-upgrade.test.ts +20 -0
- package/src/workspace/lineage-upgrade.ts +16 -7
- package/src/workspace/links.ts +24 -1
- package/src/workspace/ls-contract.test.ts +1 -1
- package/src/workspace/ls.schema.json +7 -0
- package/src/workspace/ls.ts +10 -1
- package/src/workspace/member-commands.ts +60 -2
- package/src/workspace/member-file-schema.test.ts +124 -0
- package/src/workspace/migrate-links.test.ts +99 -0
- package/src/workspace/migrate-links.ts +108 -0
- package/src/workspace/migration-dirs.test.ts +272 -0
- package/src/workspace/migration-dirs.ts +267 -0
- package/src/workspace/new-migrations.test.ts +98 -0
- package/src/workspace/new-migrations.ts +109 -0
- package/src/workspace/org-scope.test.ts +238 -0
- package/src/workspace/pr-report.schema.json +46 -0
- package/src/workspace/promote.test.ts +114 -0
- package/src/workspace/promote.ts +302 -0
- package/src/workspace/reason-codes.test.ts +10 -1
- package/src/workspace/reason-codes.ts +25 -0
- package/src/workspace/records-cli.ts +58 -5
- package/src/workspace/records.schema.json +5 -0
- package/src/workspace/release-candidates.ts +7 -2
- package/src/workspace/release-train.ts +157 -0
- package/src/workspace/release-workflow.ts +4 -3
- package/src/workspace/repo-ref.ts +113 -0
- package/src/workspace/run-event.schema.json +2 -2
- package/src/workspace/runs-cli.ts +48 -4
- package/src/workspace/runs.schema.json +7 -0
- package/src/workspace/status-contract.test.ts +46 -1
- package/src/workspace/status-decisions.test.ts +100 -0
- package/src/workspace/status-decisions.ts +151 -0
- package/src/workspace/status-gates.ts +9 -0
- package/src/workspace/status.schema.json +6 -0
- package/src/workspace/status.ts +17 -3
- package/src/workspace/where-filters.test.ts +39 -0
- package/src/workspace/work-cli.ts +5 -3
- package/src/workspace/work-evidence-ops.test.ts +176 -0
- package/src/workspace/work-evidence-ops.ts +189 -0
- package/src/workspace/work-evidence.schema.json +49 -2
- package/src/workspace/work-evidence.ts +22 -3
- package/src/workspace/workspace-gates.ts +200 -0
- package/src/workspace/workspace-kinds.schema.json +108 -10
- package/src/workspace/workspace-ledger.ts +130 -0
- package/src/workspace/workspace-run.test.ts +322 -0
- package/src/workspace/workspace-run.ts +461 -0
|
@@ -65,6 +65,13 @@
|
|
|
65
65
|
],
|
|
66
66
|
"description": "The declared name, or null when the declaration can't be read."
|
|
67
67
|
},
|
|
68
|
+
"repo": {
|
|
69
|
+
"type": [
|
|
70
|
+
"string",
|
|
71
|
+
"null"
|
|
72
|
+
],
|
|
73
|
+
"description": "Added in contract 1 by #3168. The repository the document came from: the URL of the remote origin of the git repository that holds the workspace, with any user name or password removed, or null when there is no origin or the workspace is outside git. With name, root and the revision, it says which repository's workspace a document describes, so a reader that gathers several repositories' documents, such as an org workspace's repo members, tells them apart."
|
|
74
|
+
},
|
|
68
75
|
"root": {
|
|
69
76
|
"type": "string",
|
|
70
77
|
"description": "The workspace root relative to the git root, with / separators, \".\" for the git root itself. An absolute path outside a git repository."
|
|
@@ -341,7 +348,9 @@
|
|
|
341
348
|
"ci-workflow-ungated-env",
|
|
342
349
|
"ci-workflow-pipeline-missing",
|
|
343
350
|
"ci-workflow-pipeline-differs",
|
|
344
|
-
"ci-workflow-publish-missing"
|
|
351
|
+
"ci-workflow-publish-missing",
|
|
352
|
+
"ci-branch-route-differs",
|
|
353
|
+
"gate-approval-unbased"
|
|
345
354
|
],
|
|
346
355
|
"description": "For WSP001: why the declaration can't be read. For WSP121 to WSP127, the box finding (#2726, #2727, #2780, #2850). For WSP117, work-acceptance-unmet (#2772). For WSP118, flag-stale (#4024). For WSP131 to WSP133, the diagram finding (#2764)."
|
|
347
356
|
}
|
|
@@ -463,7 +472,9 @@
|
|
|
463
472
|
"ci-workflow-ungated-env",
|
|
464
473
|
"ci-workflow-pipeline-missing",
|
|
465
474
|
"ci-workflow-pipeline-differs",
|
|
466
|
-
"ci-workflow-publish-missing"
|
|
475
|
+
"ci-workflow-publish-missing",
|
|
476
|
+
"ci-branch-route-differs",
|
|
477
|
+
"gate-approval-unbased"
|
|
467
478
|
],
|
|
468
479
|
"description": "For WSP001: why the declaration can't be read. For WSP121 to WSP127, the box finding (#2726, #2727, #2780, #2850). For WSP117, work-acceptance-unmet (#2772). For WSP118, flag-stale (#4024). For WSP131 to WSP133, the diagram finding (#2764)."
|
|
469
480
|
},
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WSP152 (#4325): a member's generated pull-request pipeline targets the
|
|
3
|
+
* branch `ci.branches` routes the member to.
|
|
4
|
+
*
|
|
5
|
+
* `chant build --pr-loop` refuses a branch that disagrees with the route
|
|
6
|
+
* (../member-pipeline.ts), but only when it writes the file. A route changed
|
|
7
|
+
* after the pipeline was generated, or a pipeline edited by hand, goes
|
|
8
|
+
* unnoticed until a push to the wrong branch applies nothing. This check
|
|
9
|
+
* reads the files each member's generated-file record lists and compares what
|
|
10
|
+
* they target with the route. It reads files and never runs them.
|
|
11
|
+
*
|
|
12
|
+
* A pipeline names its target in two places: the `--branch` its record and
|
|
13
|
+
* apply commands carry, and the `branches` of its `push` and `pull_request`
|
|
14
|
+
* triggers. A routed member's pipeline names the route in both. A member with
|
|
15
|
+
* no route may name a branch `ci.branches` does not list, and not one it
|
|
16
|
+
* lists, since that branch applies only the members its globs match.
|
|
17
|
+
*/
|
|
18
|
+
import type { WorkspaceCheck } from "../checks.js";
|
|
19
|
+
export declare const WSP_CI_BRANCH_ROUTE = "WSP152";
|
|
20
|
+
/** The finding code WSP152 reports. */
|
|
21
|
+
export declare const CI_BRANCH_FINDING_CODES: readonly ["ci-branch-route-differs"];
|
|
22
|
+
/** What a pipeline file says it targets. */
|
|
23
|
+
export interface PipelineTargets {
|
|
24
|
+
/** The `--branch` of each record or apply command, by line; null for a command with none. */
|
|
25
|
+
jobs: {
|
|
26
|
+
line: number;
|
|
27
|
+
branch: string | null;
|
|
28
|
+
}[];
|
|
29
|
+
/** The branches its `push` and `pull_request` triggers list, by trigger. Absent for a trigger with no list. */
|
|
30
|
+
triggers: {
|
|
31
|
+
trigger: "push" | "pull_request";
|
|
32
|
+
branches: string[];
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
/** The branches a pipeline file targets, read from its text. */
|
|
36
|
+
export declare function pipelineTargets(text: string): PipelineTargets;
|
|
37
|
+
/**
|
|
38
|
+
* What differs between `targets` and the branch `own` the member is routed to
|
|
39
|
+
* (null when it has no route), as sentences. `listed` is every branch
|
|
40
|
+
* `ci.branches` names.
|
|
41
|
+
*/
|
|
42
|
+
export declare function routeDifferences(targets: PipelineTargets, own: string | null, listed: readonly string[], member: string): string[];
|
|
43
|
+
export declare const CI_BRANCH_CHECKS: readonly WorkspaceCheck[];
|
|
44
|
+
//# sourceMappingURL=ci-branch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-branch.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/ci-branch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,WAAW,CAAC;AAQrE,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,uCAAuC;AACvC,eAAO,MAAM,uBAAuB,YAAI,yBAAyB,CAAU,CAAC;AAQ5E,4CAA4C;AAC5C,MAAM,WAAW,eAAe;IAC9B,6FAA6F;IAC7F,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,CAAC;IAChD,+GAA+G;IAC/G,QAAQ,EAAE;QAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC;QAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,EAAE,CAAC;CACtE;AAED,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAuB7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAelI;AAcD,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAmCrD,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WSP152 (#4325): a member's generated pull-request pipeline targets the
|
|
3
|
+
* branch `ci.branches` routes the member to.
|
|
4
|
+
*
|
|
5
|
+
* `chant build --pr-loop` refuses a branch that disagrees with the route
|
|
6
|
+
* (../member-pipeline.ts), but only when it writes the file. A route changed
|
|
7
|
+
* after the pipeline was generated, or a pipeline edited by hand, goes
|
|
8
|
+
* unnoticed until a push to the wrong branch applies nothing. This check
|
|
9
|
+
* reads the files each member's generated-file record lists and compares what
|
|
10
|
+
* they target with the route. It reads files and never runs them.
|
|
11
|
+
*
|
|
12
|
+
* A pipeline names its target in two places: the `--branch` its record and
|
|
13
|
+
* apply commands carry, and the `branches` of its `push` and `pull_request`
|
|
14
|
+
* triggers. A routed member's pipeline names the route in both. A member with
|
|
15
|
+
* no route may name a branch `ci.branches` does not list, and not one it
|
|
16
|
+
* lists, since that branch applies only the members its globs match.
|
|
17
|
+
*/
|
|
18
|
+
import { routedBranch } from "../ci-branches.js";
|
|
19
|
+
import { GENERATED_RECORD_FILE } from "../member-pipeline.js";
|
|
20
|
+
import { joinPath } from "../tree.js";
|
|
21
|
+
import { parseYAMLDocument } from "../../yaml.js";
|
|
22
|
+
import { read } from "./security.js";
|
|
23
|
+
export const WSP_CI_BRANCH_ROUTE = "WSP152";
|
|
24
|
+
/** The finding code WSP152 reports. */
|
|
25
|
+
export const CI_BRANCH_FINDING_CODES = ["ci-branch-route-differs"];
|
|
26
|
+
const memberDir = (dir) => (dir === "." ? "" : dir);
|
|
27
|
+
/** A record or apply command of the pull-request loop: `ci run record|apply`, or `components pr-record|pr-apply`. */
|
|
28
|
+
const JOB = /\bci\s+run\s+(?:record|apply)\b|\bcomponents\s+pr-(?:record|apply)\b/;
|
|
29
|
+
const BRANCH_FLAG = /--branch(?:\s+|=)(?:"([^"]+)"|'([^']+)'|(\S+))/;
|
|
30
|
+
/** The branches a pipeline file targets, read from its text. */
|
|
31
|
+
export function pipelineTargets(text) {
|
|
32
|
+
const jobs = [];
|
|
33
|
+
text.split("\n").forEach((line, i) => {
|
|
34
|
+
if (!JOB.test(line))
|
|
35
|
+
return;
|
|
36
|
+
const m = BRANCH_FLAG.exec(line);
|
|
37
|
+
jobs.push({ line: i + 1, branch: m ? (m[1] ?? m[2] ?? m[3] ?? null) : null });
|
|
38
|
+
});
|
|
39
|
+
const triggers = [];
|
|
40
|
+
try {
|
|
41
|
+
const doc = parseYAMLDocument(text);
|
|
42
|
+
// YAML 1.1 reads a bare `on` key as true.
|
|
43
|
+
const on = doc && typeof doc === "object" ? (doc.on ?? doc.true) : undefined;
|
|
44
|
+
if (on && typeof on === "object" && !Array.isArray(on)) {
|
|
45
|
+
for (const trigger of ["push", "pull_request"]) {
|
|
46
|
+
const t = on[trigger];
|
|
47
|
+
const branches = t && typeof t === "object" ? t.branches : undefined;
|
|
48
|
+
if (Array.isArray(branches))
|
|
49
|
+
triggers.push({ trigger, branches: branches.filter((b) => typeof b === "string") });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// A file that is not YAML has no triggers to compare; its commands still are.
|
|
55
|
+
}
|
|
56
|
+
return { jobs, triggers };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* What differs between `targets` and the branch `own` the member is routed to
|
|
60
|
+
* (null when it has no route), as sentences. `listed` is every branch
|
|
61
|
+
* `ci.branches` names.
|
|
62
|
+
*/
|
|
63
|
+
export function routeDifferences(targets, own, listed, member) {
|
|
64
|
+
const out = [];
|
|
65
|
+
const said = (b) => (b === null ? "the default branch (it passes no --branch)" : b);
|
|
66
|
+
for (const j of targets.jobs) {
|
|
67
|
+
if (own !== null && j.branch !== own)
|
|
68
|
+
out.push(`line ${j.line} targets ${said(j.branch)}, and ci.branches routes member ${member} to ${own}`);
|
|
69
|
+
else if (own === null && j.branch !== null && listed.includes(j.branch))
|
|
70
|
+
out.push(`line ${j.line} targets ${j.branch}, which ci.branches reserves for the members its globs match, and member ${member} is not one`);
|
|
71
|
+
}
|
|
72
|
+
for (const t of targets.triggers) {
|
|
73
|
+
if (own !== null && !(t.branches.length === 1 && t.branches[0] === own))
|
|
74
|
+
out.push(`its ${t.trigger} trigger lists ${t.branches.join(", ") || "no branch"}, and ci.branches routes member ${member} to ${own}`);
|
|
75
|
+
else if (own === null) {
|
|
76
|
+
const reserved = t.branches.filter((b) => listed.includes(b));
|
|
77
|
+
if (reserved.length > 0)
|
|
78
|
+
out.push(`its ${t.trigger} trigger lists ${reserved.join(", ")}, which ci.branches reserves for the members its globs match, and member ${member} is not one`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
/** The files a member's generated-file record lists, which are pipelines the check can read. */
|
|
84
|
+
function recordedFiles(ctx, member) {
|
|
85
|
+
const text = read(ctx.tree, joinPath(memberDir(member.dir), GENERATED_RECORD_FILE));
|
|
86
|
+
if (text === null)
|
|
87
|
+
return [];
|
|
88
|
+
try {
|
|
89
|
+
const parsed = JSON.parse(text);
|
|
90
|
+
return (parsed.files ?? []).flatMap((f) => (typeof f.path === "string" && /\.ya?ml$/.test(f.path) ? [f.path] : []));
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export const CI_BRANCH_CHECKS = [
|
|
97
|
+
{
|
|
98
|
+
id: WSP_CI_BRANCH_ROUTE,
|
|
99
|
+
name: "ci-branch-route",
|
|
100
|
+
description: "A member's generated pull-request pipeline targets the branch ci.branches routes the member to, in its record and apply commands and its push and pull_request triggers.",
|
|
101
|
+
severity: "error",
|
|
102
|
+
configurable: true,
|
|
103
|
+
check(ctx) {
|
|
104
|
+
const branches = ctx.declaration.ci?.branches;
|
|
105
|
+
if (!branches || Object.keys(branches).length === 0)
|
|
106
|
+
return [];
|
|
107
|
+
const listed = Object.keys(branches);
|
|
108
|
+
const out = [];
|
|
109
|
+
for (const member of ctx.declaration.members) {
|
|
110
|
+
const own = routedBranch(branches, member.name);
|
|
111
|
+
for (const path of recordedFiles(ctx, member)) {
|
|
112
|
+
const text = read(ctx.tree, path);
|
|
113
|
+
if (text === null)
|
|
114
|
+
continue;
|
|
115
|
+
for (const why of routeDifferences(pipelineTargets(text), own, listed, member.name)) {
|
|
116
|
+
out.push({
|
|
117
|
+
checkId: this.id,
|
|
118
|
+
severity: this.severity,
|
|
119
|
+
code: CI_BRANCH_FINDING_CODES[0],
|
|
120
|
+
message: `WSP152: ${path}: ${why}; regenerate it with chant build --components --generate <forge> --pr-loop`,
|
|
121
|
+
pointer: "/ci/branches",
|
|
122
|
+
entity: member.name,
|
|
123
|
+
treeFile: path,
|
|
124
|
+
line: 1,
|
|
125
|
+
column: 1,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return out;
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WSP153 (#4404): an Op gate's `approval` block that `identity.gates` does
|
|
3
|
+
* not back at base.
|
|
4
|
+
*
|
|
5
|
+
* A run reads a gate's `quorum`, `policy`, `mode` and `context` from
|
|
6
|
+
* `identity.gates.<gate>` in the declaration at base (#4324, #4404). A field
|
|
7
|
+
* the entry leaves out is read from the Op being run, which the change under
|
|
8
|
+
* review can edit, so a pull request can lower a quorum or switch a policy to
|
|
9
|
+
* `log-only` and be judged by its own edit. The Op-side fallback stays so an
|
|
10
|
+
* existing Op does not drop to one approval overnight. This check names each
|
|
11
|
+
* gate that still leans on it, and the fields it leans on.
|
|
12
|
+
*
|
|
13
|
+
* It reads each member's built Ops (`dist/ops/<name>/op.json`) and runs
|
|
14
|
+
* nothing. An Op that has not been built is not seen.
|
|
15
|
+
*/
|
|
16
|
+
import type { WorkspaceCheck } from "../checks.js";
|
|
17
|
+
export declare const WSP_GATE_APPROVAL_UNBASED = "WSP153";
|
|
18
|
+
/** The finding code WSP153 reports. */
|
|
19
|
+
export declare const GATE_APPROVAL_FINDING_CODES: readonly ["gate-approval-unbased"];
|
|
20
|
+
interface GateUse {
|
|
21
|
+
gate: string;
|
|
22
|
+
/** What the Op's `approval` block sets. Context is the keys it sets. */
|
|
23
|
+
quorum: boolean;
|
|
24
|
+
policy: boolean;
|
|
25
|
+
mode: boolean;
|
|
26
|
+
context: string[];
|
|
27
|
+
}
|
|
28
|
+
interface StepJson {
|
|
29
|
+
kind?: string;
|
|
30
|
+
gate?: string;
|
|
31
|
+
signalName?: string;
|
|
32
|
+
approval?: {
|
|
33
|
+
quorum?: unknown;
|
|
34
|
+
policy?: unknown;
|
|
35
|
+
mode?: unknown;
|
|
36
|
+
context?: Record<string, unknown>;
|
|
37
|
+
};
|
|
38
|
+
steps?: StepJson[];
|
|
39
|
+
}
|
|
40
|
+
/** The gates of a built Op that declare an `approval` block, with the fields it sets. A gate that asks a decision point has none. */
|
|
41
|
+
export declare function gateUses(op: {
|
|
42
|
+
phases?: {
|
|
43
|
+
steps?: StepJson[];
|
|
44
|
+
}[];
|
|
45
|
+
onFailure?: {
|
|
46
|
+
steps?: StepJson[];
|
|
47
|
+
}[];
|
|
48
|
+
}): GateUse[];
|
|
49
|
+
/** The fields of `use` that `entry` (the gate's `identity.gates` entry, or undefined) does not set, as phrases. Empty when base backs every one. */
|
|
50
|
+
export declare function unbasedFields(use: GateUse, entry: {
|
|
51
|
+
quorum: unknown;
|
|
52
|
+
policy: unknown;
|
|
53
|
+
mode: unknown;
|
|
54
|
+
context: Record<string, unknown> | null;
|
|
55
|
+
} | undefined): string[];
|
|
56
|
+
export declare const GATE_APPROVAL_CHECKS: readonly WorkspaceCheck[];
|
|
57
|
+
export {};
|
|
58
|
+
//# sourceMappingURL=gate-approval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate-approval.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/gate-approval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,WAAW,CAAC;AAIrE,eAAO,MAAM,yBAAyB,WAAW,CAAC;AAElD,uCAAuC;AACvC,eAAO,MAAM,2BAA2B,YAAI,uBAAuB,CAAU,CAAC;AAM9E,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,QAAQ;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IACrG,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED,qIAAqI;AACrI,wBAAgB,QAAQ,CAAC,EAAE,EAAE;IAAE,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;KAAE,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;KAAE,EAAE,CAAA;CAAE,GAAG,OAAO,EAAE,CAiBnH;AAED,oJAAoJ;AACpJ,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAOrK;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,cAAc,EA4CzD,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WSP153 (#4404): an Op gate's `approval` block that `identity.gates` does
|
|
3
|
+
* not back at base.
|
|
4
|
+
*
|
|
5
|
+
* A run reads a gate's `quorum`, `policy`, `mode` and `context` from
|
|
6
|
+
* `identity.gates.<gate>` in the declaration at base (#4324, #4404). A field
|
|
7
|
+
* the entry leaves out is read from the Op being run, which the change under
|
|
8
|
+
* review can edit, so a pull request can lower a quorum or switch a policy to
|
|
9
|
+
* `log-only` and be judged by its own edit. The Op-side fallback stays so an
|
|
10
|
+
* existing Op does not drop to one approval overnight. This check names each
|
|
11
|
+
* gate that still leans on it, and the fields it leans on.
|
|
12
|
+
*
|
|
13
|
+
* It reads each member's built Ops (`dist/ops/<name>/op.json`) and runs
|
|
14
|
+
* nothing. An Op that has not been built is not seen.
|
|
15
|
+
*/
|
|
16
|
+
import { joinPath } from "../tree.js";
|
|
17
|
+
import { read } from "./security.js";
|
|
18
|
+
export const WSP_GATE_APPROVAL_UNBASED = "WSP153";
|
|
19
|
+
/** The finding code WSP153 reports. */
|
|
20
|
+
export const GATE_APPROVAL_FINDING_CODES = ["gate-approval-unbased"];
|
|
21
|
+
const memberDir = (dir) => (dir === "." ? "" : dir);
|
|
22
|
+
/** The gates of a built Op that declare an `approval` block, with the fields it sets. A gate that asks a decision point has none. */
|
|
23
|
+
export function gateUses(op) {
|
|
24
|
+
const out = [];
|
|
25
|
+
const visit = (step) => {
|
|
26
|
+
if (step.kind === "gate" && step.approval && typeof step.approval === "object") {
|
|
27
|
+
const a = step.approval;
|
|
28
|
+
out.push({
|
|
29
|
+
gate: step.gate ?? step.signalName ?? "",
|
|
30
|
+
quorum: a.quorum !== undefined,
|
|
31
|
+
policy: a.policy !== undefined,
|
|
32
|
+
mode: a.mode !== undefined,
|
|
33
|
+
context: a.context && typeof a.context === "object" ? Object.keys(a.context) : [],
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
if (step.kind === "effect")
|
|
37
|
+
(step.steps ?? []).forEach(visit);
|
|
38
|
+
};
|
|
39
|
+
for (const p of [...(op.phases ?? []), ...(op.onFailure ?? [])])
|
|
40
|
+
(p.steps ?? []).forEach(visit);
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
/** The fields of `use` that `entry` (the gate's `identity.gates` entry, or undefined) does not set, as phrases. Empty when base backs every one. */
|
|
44
|
+
export function unbasedFields(use, entry) {
|
|
45
|
+
const out = [];
|
|
46
|
+
const has = (f) => entry?.[f] !== null && entry?.[f] !== undefined;
|
|
47
|
+
for (const f of ["quorum", "policy", "mode"])
|
|
48
|
+
if (use[f] && !has(f))
|
|
49
|
+
out.push(f);
|
|
50
|
+
const loose = use.context.filter((k) => !(k in (entry?.context ?? {})));
|
|
51
|
+
if (loose.length > 0)
|
|
52
|
+
out.push(`context (${loose.join(", ")})`);
|
|
53
|
+
return out;
|
|
54
|
+
}
|
|
55
|
+
export const GATE_APPROVAL_CHECKS = [
|
|
56
|
+
{
|
|
57
|
+
id: WSP_GATE_APPROVAL_UNBASED,
|
|
58
|
+
name: "gate-approval-unbased",
|
|
59
|
+
description: "An Op gate declares an approval block whose quorum, policy, mode or context identity.gates does not set at base, so the change being run can edit it.",
|
|
60
|
+
severity: "warning",
|
|
61
|
+
configurable: true,
|
|
62
|
+
check(ctx) {
|
|
63
|
+
const out = [];
|
|
64
|
+
const gates = ctx.declaration.identity?.gates ?? {};
|
|
65
|
+
for (const member of ctx.declaration.members) {
|
|
66
|
+
const opsDir = joinPath(memberDir(member.dir), "dist", "ops");
|
|
67
|
+
for (const entry of ctx.tree.list(opsDir) ?? []) {
|
|
68
|
+
if (entry.type !== "dir")
|
|
69
|
+
continue;
|
|
70
|
+
const path = joinPath(opsDir, entry.name, "op.json");
|
|
71
|
+
const text = read(ctx.tree, path);
|
|
72
|
+
if (text === null)
|
|
73
|
+
continue;
|
|
74
|
+
let op;
|
|
75
|
+
try {
|
|
76
|
+
op = JSON.parse(text);
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
for (const use of gateUses(op)) {
|
|
82
|
+
const base = gates[use.gate];
|
|
83
|
+
const missing = unbasedFields(use, base);
|
|
84
|
+
if (missing.length === 0)
|
|
85
|
+
continue;
|
|
86
|
+
out.push({
|
|
87
|
+
checkId: this.id,
|
|
88
|
+
severity: this.severity,
|
|
89
|
+
code: GATE_APPROVAL_FINDING_CODES[0],
|
|
90
|
+
message: `WSP153: gate "${use.gate}" in Op ${op.name ?? entry.name} sets ${missing.join(", ")} in its approval block, and ${base ? `identity.gates.${use.gate}` : "identity.gates"} sets ${base ? "none of them" : `no entry for it`} at base, so a change can edit ${missing.length === 1 ? "it" : "them"} for its own run; declare ${base ? "them" : `identity.gates.${use.gate}`} in chant.workspace.json`,
|
|
91
|
+
pointer: base ? base.pointer : "/identity",
|
|
92
|
+
entity: use.gate,
|
|
93
|
+
treeFile: path,
|
|
94
|
+
line: 1,
|
|
95
|
+
column: 1,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
];
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
* Links a kind's reader finds in a member's own files (#3932), such as a dbt
|
|
23
23
|
* project's sources, are checked by WSP093 to WSP095 like declared ones, and
|
|
24
24
|
* their findings name the member's file and line instead of the declaration.
|
|
25
|
+
* Links a member's lexicon reads from its declarations (#4397), such as the
|
|
26
|
+
* tables an otel `clickhouse` exporter writes, are checked the same way, with
|
|
27
|
+
* the reader named `lexicon <name>`.
|
|
25
28
|
*/
|
|
26
29
|
import type { WorkspaceCheck, WorkspaceCheckContext } from "../checks.js";
|
|
27
30
|
import { type LinkTableRow } from "../links.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/links.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/links.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAuB,MAAM,WAAW,CAAC;AAI5F,OAAO,EAAwH,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAuBnK,mFAAmF;AACnF,wBAAgB,SAAS,CAAC,GAAG,EAAE,qBAAqB,GAAG,YAAY,EAAE,CAOpE;AAoBD,eAAO,MAAM,WAAW,EAAE,SAAS,cAAc,EAmLhD,CAAC"}
|
|
@@ -22,17 +22,28 @@
|
|
|
22
22
|
* Links a kind's reader finds in a member's own files (#3932), such as a dbt
|
|
23
23
|
* project's sources, are checked by WSP093 to WSP095 like declared ones, and
|
|
24
24
|
* their findings name the member's file and line instead of the declaration.
|
|
25
|
+
* Links a member's lexicon reads from its declarations (#4397), such as the
|
|
26
|
+
* tables an otel `clickhouse` exporter writes, are checked the same way, with
|
|
27
|
+
* the reader named `lexicon <name>`.
|
|
25
28
|
*/
|
|
26
29
|
import { sourceMemberHandles } from "../member-handles.js";
|
|
27
30
|
import { readKindLinks } from "../kind-link-readers.js";
|
|
28
31
|
import { DEFAULT_LINK_KIND, LINK_KINDS, TELEMETRY_LINK_KIND, linkTargetProblem, resolveLinks } from "../links.js";
|
|
29
32
|
const tables = new WeakMap();
|
|
30
33
|
const reads = new WeakMap();
|
|
31
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* What each member's kind reader found (#3932), and the links its lexicons
|
|
36
|
+
* read from its declarations (#4397), read once per check run.
|
|
37
|
+
*/
|
|
32
38
|
function kindReads(ctx) {
|
|
33
39
|
let read = reads.get(ctx);
|
|
34
40
|
if (!read) {
|
|
35
41
|
read = readKindLinks(ctx.declaration, ctx.tree, ctx.kinds);
|
|
42
|
+
for (const [member, lexicon] of ctx.facts?.lexiconLinks ?? []) {
|
|
43
|
+
const prev = read.get(member);
|
|
44
|
+
// resolveLinks names one reader per member; the lexicon's links keep their file and line.
|
|
45
|
+
read.set(member, prev ? { ...prev, links: [...prev.links, ...lexicon.links], gaps: [...prev.gaps, ...lexicon.gaps] } : lexicon);
|
|
46
|
+
}
|
|
36
47
|
reads.set(ctx, read);
|
|
37
48
|
}
|
|
38
49
|
return read;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Org scope (#3168): members of kind `repo`, which name another repository's
|
|
3
|
+
* workspace by URL and pinned revision, and the org-level workspace that
|
|
4
|
+
* holds only such members.
|
|
5
|
+
*
|
|
6
|
+
* | Id | Check |
|
|
7
|
+
* |---|---|
|
|
8
|
+
* | WSP013 | an org workspace holds only repo members |
|
|
9
|
+
* | WSP014 | every repository the forge lists is declared (with `--forge-repos`) |
|
|
10
|
+
* | WSP015 | every declared repository is one the forge lists (with `--forge-repos`) |
|
|
11
|
+
* | WSP016 | no repo member's URL carries a password or token |
|
|
12
|
+
*
|
|
13
|
+
* The forge's list is input, never fetched here: a warden enumerates the
|
|
14
|
+
* org's repositories from its own API and hands the list to
|
|
15
|
+
* `chant workspace check --forge-repos <file>`, so the check stays offline.
|
|
16
|
+
*/
|
|
17
|
+
import type { WorkspaceCheck } from "../checks.js";
|
|
18
|
+
/** One repository the forge lists. */
|
|
19
|
+
export interface ForgeRepo {
|
|
20
|
+
url: string;
|
|
21
|
+
/** An archived repository need not be declared, and declaring one is not a drop. */
|
|
22
|
+
archived: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** The forge's repository list for `--forge-repos` (#3168), as a warden writes it. */
|
|
25
|
+
export interface ForgeRepoList {
|
|
26
|
+
/** The file it was read from, for messages. */
|
|
27
|
+
source: string;
|
|
28
|
+
repos: ForgeRepo[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse a forge repository list. Three shapes are read: `{ "repos": [...] }`
|
|
32
|
+
* (a warden may add `forge` and `org` beside it), a bare array, and, for each
|
|
33
|
+
* repository, a URL string or `{ "url", "archived"? }`. Throws an Error that
|
|
34
|
+
* says what is wrong.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseForgeRepos(text: string, source: string): ForgeRepoList;
|
|
37
|
+
/**
|
|
38
|
+
* A repository URL reduced to what names the repository, so the forge's
|
|
39
|
+
* https URL and a declaration's ssh or scp-style URL compare equal:
|
|
40
|
+
* `host/owner/repo`, lowercased, with no scheme, user, port, `.git` or
|
|
41
|
+
* trailing slash. A local path or file URL becomes its absolute path,
|
|
42
|
+
* resolved from `base`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function repoKey(url: string, base?: string): string;
|
|
45
|
+
/** Whether a URL carries a password or token, which a declaration must never hold. */
|
|
46
|
+
export declare function urlCredential(url: string): boolean;
|
|
47
|
+
export declare const ORG_CHECKS: readonly WorkspaceCheck[];
|
|
48
|
+
//# sourceMappingURL=org.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org.d.ts","sourceRoot":"","sources":["../../../src/workspace/checks/org.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,WAAW,CAAC;AAErE,sCAAsC;AACtC,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,oFAAoF;IACpF,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,+CAA+C;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa,CAiB3E;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,MAAsB,GAAG,MAAM,CAmBzE;AAMD,sFAAsF;AACtF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CASlD;AAQD,eAAO,MAAM,UAAU,EAAE,SAAS,cAAc,EA0D/C,CAAC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Org scope (#3168): members of kind `repo`, which name another repository's
|
|
3
|
+
* workspace by URL and pinned revision, and the org-level workspace that
|
|
4
|
+
* holds only such members.
|
|
5
|
+
*
|
|
6
|
+
* | Id | Check |
|
|
7
|
+
* |---|---|
|
|
8
|
+
* | WSP013 | an org workspace holds only repo members |
|
|
9
|
+
* | WSP014 | every repository the forge lists is declared (with `--forge-repos`) |
|
|
10
|
+
* | WSP015 | every declared repository is one the forge lists (with `--forge-repos`) |
|
|
11
|
+
* | WSP016 | no repo member's URL carries a password or token |
|
|
12
|
+
*
|
|
13
|
+
* The forge's list is input, never fetched here: a warden enumerates the
|
|
14
|
+
* org's repositories from its own API and hands the list to
|
|
15
|
+
* `chant workspace check --forge-repos <file>`, so the check stays offline.
|
|
16
|
+
*/
|
|
17
|
+
import { isAbsolute, resolve } from "node:path";
|
|
18
|
+
import { REPO_KIND } from "../kinds.js";
|
|
19
|
+
/**
|
|
20
|
+
* Parse a forge repository list. Three shapes are read: `{ "repos": [...] }`
|
|
21
|
+
* (a warden may add `forge` and `org` beside it), a bare array, and, for each
|
|
22
|
+
* repository, a URL string or `{ "url", "archived"? }`. Throws an Error that
|
|
23
|
+
* says what is wrong.
|
|
24
|
+
*/
|
|
25
|
+
export function parseForgeRepos(text, source) {
|
|
26
|
+
let raw;
|
|
27
|
+
try {
|
|
28
|
+
raw = JSON.parse(text);
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
throw new Error(`${source} is not JSON (${err.message})`);
|
|
32
|
+
}
|
|
33
|
+
const list = Array.isArray(raw) ? raw : raw !== null && typeof raw === "object" && Array.isArray(raw.repos) ? raw.repos : undefined;
|
|
34
|
+
if (!list)
|
|
35
|
+
throw new Error(`${source} is neither an array of repositories nor an object with a repos array`);
|
|
36
|
+
const repos = list.map((r, i) => {
|
|
37
|
+
if (typeof r === "string" && r.length > 0)
|
|
38
|
+
return { url: r, archived: false };
|
|
39
|
+
if (r !== null && typeof r === "object" && typeof r.url === "string") {
|
|
40
|
+
return { url: r.url, archived: r.archived === true };
|
|
41
|
+
}
|
|
42
|
+
throw new Error(`${source}: repos[${i}] is neither a URL nor an object with a url`);
|
|
43
|
+
});
|
|
44
|
+
return { source, repos };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A repository URL reduced to what names the repository, so the forge's
|
|
48
|
+
* https URL and a declaration's ssh or scp-style URL compare equal:
|
|
49
|
+
* `host/owner/repo`, lowercased, with no scheme, user, port, `.git` or
|
|
50
|
+
* trailing slash. A local path or file URL becomes its absolute path,
|
|
51
|
+
* resolved from `base`.
|
|
52
|
+
*/
|
|
53
|
+
export function repoKey(url, base = process.cwd()) {
|
|
54
|
+
const trimmed = url.trim();
|
|
55
|
+
const scp = /^(?:[^@/\s]+@)?([^:/\s]+):(?!\/\/)(.+)$/.exec(trimmed);
|
|
56
|
+
let hostPath;
|
|
57
|
+
if (/^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed)) {
|
|
58
|
+
let u;
|
|
59
|
+
try {
|
|
60
|
+
u = new URL(trimmed);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return trimmed.toLowerCase();
|
|
64
|
+
}
|
|
65
|
+
if (u.protocol === "file:")
|
|
66
|
+
return stripGit(decodeURIComponent(u.pathname));
|
|
67
|
+
hostPath = `${u.hostname}${u.pathname}`;
|
|
68
|
+
}
|
|
69
|
+
else if (scp && !isAbsolute(trimmed) && !/^[a-z]:[\\/]/i.test(trimmed)) {
|
|
70
|
+
hostPath = `${scp[1]}/${scp[2]}`;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return stripGit(resolve(base, trimmed));
|
|
74
|
+
}
|
|
75
|
+
return stripGit(hostPath.replace(/\/+/g, "/")).toLowerCase();
|
|
76
|
+
}
|
|
77
|
+
function stripGit(path) {
|
|
78
|
+
return path.replace(/\/+$/, "").replace(/\.git$/, "");
|
|
79
|
+
}
|
|
80
|
+
/** Whether a URL carries a password or token, which a declaration must never hold. */
|
|
81
|
+
export function urlCredential(url) {
|
|
82
|
+
if (!/^[a-z][a-z0-9+.-]*:\/\//i.test(url))
|
|
83
|
+
return false;
|
|
84
|
+
try {
|
|
85
|
+
const u = new URL(url);
|
|
86
|
+
// ssh://git@host is a user name, not a secret; a password, or any user on http(s), is one.
|
|
87
|
+
return u.password !== "" || (u.username !== "" && /^https?:$/.test(u.protocol));
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const repoMembers = (ctx) => ctx.declaration.members.filter((m) => m.kind === REPO_KIND && m.repo !== null);
|
|
94
|
+
function finding(check, message, pointer, entity) {
|
|
95
|
+
return { checkId: check.id, severity: check.severity, message, pointer, ...(entity !== undefined ? { entity } : {}) };
|
|
96
|
+
}
|
|
97
|
+
export const ORG_CHECKS = [
|
|
98
|
+
{
|
|
99
|
+
id: "WSP013",
|
|
100
|
+
name: "org-member-local",
|
|
101
|
+
description: "An org workspace (scope org) holds only members of kind repo, each a reference to another repository's workspace (#3168).",
|
|
102
|
+
severity: "error",
|
|
103
|
+
configurable: false,
|
|
104
|
+
check(ctx) {
|
|
105
|
+
if (ctx.declaration.scope !== "org")
|
|
106
|
+
return [];
|
|
107
|
+
return ctx.declaration.entries
|
|
108
|
+
.filter((e) => e.kind !== REPO_KIND)
|
|
109
|
+
.map((e) => finding(this, `${e.type === "group" ? "example group" : "member"} ${e.name} is kind ${e.kind}, and an org workspace holds only repo members; move it into a repository's own workspace and reference that`, `${e.pointer}/kind`, e.name));
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "WSP014",
|
|
114
|
+
name: "org-repo-undeclared",
|
|
115
|
+
description: "With --forge-repos, every repository the forge lists, archived ones aside, is named by a repo member (#3168).",
|
|
116
|
+
severity: "error",
|
|
117
|
+
configurable: true,
|
|
118
|
+
check(ctx) {
|
|
119
|
+
const forge = ctx.facts?.forgeRepos;
|
|
120
|
+
if (!forge)
|
|
121
|
+
return [];
|
|
122
|
+
const declared = new Set(repoMembers(ctx).map((m) => repoKey(m.repo.url)));
|
|
123
|
+
return forge.repos
|
|
124
|
+
.filter((r) => !r.archived && !declared.has(repoKey(r.url)))
|
|
125
|
+
.map((r) => finding(this, `the forge lists ${r.url} (${forge.source}), and no repo member names it; add a member of kind repo with its url and pinned rev`, "/members"));
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "WSP015",
|
|
130
|
+
name: "org-repo-dropped",
|
|
131
|
+
description: "With --forge-repos, every repository a repo member names is one the forge still lists (#3168).",
|
|
132
|
+
severity: "warning",
|
|
133
|
+
configurable: true,
|
|
134
|
+
check(ctx) {
|
|
135
|
+
const forge = ctx.facts?.forgeRepos;
|
|
136
|
+
if (!forge)
|
|
137
|
+
return [];
|
|
138
|
+
const listed = new Set(forge.repos.map((r) => repoKey(r.url)));
|
|
139
|
+
return repoMembers(ctx)
|
|
140
|
+
.filter((m) => !listed.has(repoKey(m.repo.url)))
|
|
141
|
+
.map((m) => finding(this, `member ${m.name} names ${m.repo.url}, which the forge no longer lists (${forge.source}); remove the member or say why it stays`, `${m.pointer}/repo/url`, m.name));
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "WSP016",
|
|
146
|
+
name: "repo-url-credential",
|
|
147
|
+
description: "No repo member's URL carries a password or token: the declaration is committed, and git's own credential helpers supply access (#3168).",
|
|
148
|
+
severity: "error",
|
|
149
|
+
configurable: false,
|
|
150
|
+
check(ctx) {
|
|
151
|
+
return repoMembers(ctx)
|
|
152
|
+
.filter((m) => urlCredential(m.repo.url))
|
|
153
|
+
.map((m) => finding(this, `member ${m.name}'s repo url carries a credential; name the repository without one and let git's credential helper supply access`, `${m.pointer}/repo/url`, m.name));
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
];
|