@intentius/chant 0.124.85 → 0.124.87
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/bundle-check.d.ts +102 -0
- package/dist/bundle-check.d.ts.map +1 -0
- package/dist/bundle-check.js +310 -0
- package/dist/chant-install.d.ts +100 -0
- package/dist/chant-install.d.ts.map +1 -0
- package/dist/chant-install.js +158 -0
- package/dist/ci-commit.d.ts +19 -6
- package/dist/ci-commit.d.ts.map +1 -1
- package/dist/ci-commit.js +23 -4
- package/dist/ci-evidence-jobs.d.ts +78 -0
- package/dist/ci-evidence-jobs.d.ts.map +1 -0
- package/dist/ci-evidence-jobs.js +85 -0
- package/dist/ci-image.d.ts +274 -0
- package/dist/ci-image.d.ts.map +1 -0
- package/dist/ci-image.js +635 -0
- package/dist/ci-login.d.ts +150 -0
- package/dist/ci-login.d.ts.map +1 -0
- package/dist/ci-login.js +240 -0
- package/dist/ci-product.d.ts +16 -0
- package/dist/ci-product.d.ts.map +1 -1
- package/dist/ci-product.js +17 -0
- package/dist/cli/commands/import-index.js +2 -2
- package/dist/cli/handlers/build.d.ts +8 -0
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/build.js +22 -4
- package/dist/cli/handlers/ci-check.d.ts.map +1 -1
- package/dist/cli/handlers/ci-check.js +61 -2
- package/dist/cli/handlers/ci-evidence.d.ts +3 -0
- package/dist/cli/handlers/ci-evidence.d.ts.map +1 -0
- package/dist/cli/handlers/ci-evidence.js +174 -0
- package/dist/cli/handlers/components.js +3 -3
- package/dist/cli/handlers/dead-guards.d.ts +3 -0
- package/dist/cli/handlers/dead-guards.d.ts.map +1 -0
- package/dist/cli/handlers/dead-guards.js +35 -0
- package/dist/cli/handlers/graph.js +4 -4
- package/dist/cli/handlers/lifecycle.d.ts +2 -1
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.js +5 -4
- package/dist/cli/handlers/local-chant.d.ts +16 -0
- package/dist/cli/handlers/local-chant.d.ts.map +1 -0
- package/dist/cli/handlers/local-chant.js +109 -0
- package/dist/cli/handlers/operator.js +2 -2
- package/dist/cli/handlers/search.js +5 -5
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +38 -0
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +28 -0
- package/dist/cli/registry.d.ts +16 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/check-hooks.d.ts +49 -0
- package/dist/components/check-hooks.d.ts.map +1 -1
- package/dist/components/check-hooks.js +64 -4
- package/dist/components/check-steps.d.ts +17 -0
- package/dist/components/check-steps.d.ts.map +1 -1
- package/dist/components/check-steps.js +37 -5
- package/dist/components/product-pipeline.d.ts +23 -0
- package/dist/components/product-pipeline.d.ts.map +1 -1
- package/dist/components/product-pipeline.js +6 -2
- package/dist/components/product-plan.d.ts +143 -0
- package/dist/components/product-plan.d.ts.map +1 -0
- package/dist/components/product-plan.js +145 -0
- package/dist/components/release-compile.d.ts.map +1 -1
- package/dist/components/release-compile.js +2 -2
- package/dist/config.d.ts +39 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +35 -3
- package/dist/dead-guards.d.ts +82 -0
- package/dist/dead-guards.d.ts.map +1 -0
- package/dist/dead-guards.js +436 -0
- package/dist/discovery/files.d.ts +3 -1
- package/dist/discovery/files.d.ts.map +1 -1
- package/dist/discovery/files.js +5 -3
- package/dist/drift-issue.d.ts +152 -0
- package/dist/drift-issue.d.ts.map +1 -0
- package/dist/drift-issue.js +167 -0
- package/dist/floor-table.d.ts +30 -0
- package/dist/floor-table.d.ts.map +1 -0
- package/dist/floor-table.data.d.ts +3 -0
- package/dist/floor-table.data.d.ts.map +1 -0
- package/dist/floor-table.data.js +179 -0
- package/dist/floor-table.js +56 -0
- package/dist/forge-flags.d.ts +90 -0
- package/dist/forge-flags.d.ts.map +1 -0
- package/dist/forge-flags.js +184 -0
- package/dist/lexicon.d.ts +69 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gated-op.d.ts +7 -1
- package/dist/lifecycle/gated-op.d.ts.map +1 -1
- package/dist/lifecycle/gated-op.js +7 -4
- package/dist/local-chant.d.ts +98 -0
- package/dist/local-chant.d.ts.map +1 -0
- package/dist/local-chant.js +307 -0
- package/dist/op/activities/predict-behaviour.js +2 -2
- package/dist/op/op-waves-evidence-spec.d.ts +13 -0
- package/dist/op/op-waves-evidence-spec.d.ts.map +1 -0
- package/dist/op/op-waves-evidence-spec.js +21 -0
- package/dist/op/op-waves-evidence.d.ts +40 -0
- package/dist/op/op-waves-evidence.d.ts.map +1 -0
- package/dist/op/op-waves-evidence.js +58 -0
- package/dist/op/op-waves-run.d.ts +4 -0
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +24 -1
- package/dist/op/op-waves.d.ts +17 -1
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +23 -0
- package/dist/op/schedule-overdue.d.ts +41 -9
- package/dist/op/schedule-overdue.d.ts.map +1 -1
- package/dist/op/schedule-overdue.js +154 -25
- package/dist/plan-summary.d.ts +25 -0
- package/dist/plan-summary.d.ts.map +1 -1
- package/dist/plan-summary.js +31 -0
- package/dist/pr-plan-note.d.ts +35 -0
- package/dist/pr-plan-note.d.ts.map +1 -1
- package/dist/pr-plan-note.js +10 -0
- package/dist/pr-post.d.ts +23 -0
- package/dist/pr-post.d.ts.map +1 -1
- package/dist/pr-post.js +125 -3
- package/dist/release-floors.d.ts +33 -1
- package/dist/release-floors.d.ts.map +1 -1
- package/dist/release-floors.js +33 -1
- package/dist/state-migration.d.ts +24 -0
- package/dist/state-migration.d.ts.map +1 -1
- package/dist/state-migration.js +100 -5
- package/dist/wave-runtime.mjs +309 -302
- package/dist/workspace/ci-green.d.ts.map +1 -1
- package/dist/workspace/ci-green.js +4 -3
- package/dist/workspace/lexicon-outputs.d.ts.map +1 -1
- package/dist/workspace/lexicon-outputs.js +21 -7
- package/dist/workspace/reason-codes.d.ts +3 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/reason-codes.js +4 -0
- package/dist/workspace/ref-gate.schema.json +85 -0
- package/dist/workspace/search-contract.d.ts +1 -1
- package/dist/workspace/search-contract.d.ts.map +1 -1
- package/dist/workspace/trust/check-evidence-report.d.ts +58 -0
- package/dist/workspace/trust/check-evidence-report.d.ts.map +1 -0
- package/dist/workspace/trust/check-evidence-report.js +109 -0
- package/dist/workspace/trust/check-evidence.d.ts +160 -0
- package/dist/workspace/trust/check-evidence.d.ts.map +1 -0
- package/dist/workspace/trust/check-evidence.js +309 -0
- package/dist/workspace/trust/ci-tag-statement.d.ts +2 -2
- package/dist/workspace/trust/ci-tag-statement.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.d.ts +40 -2
- package/dist/workspace/trust/dsse.d.ts.map +1 -1
- package/dist/workspace/trust/dsse.js +34 -2
- package/dist/workspace/trust/evidence.d.ts +2 -2
- package/dist/workspace/trust/evidence.d.ts.map +1 -1
- package/dist/workspace/trust/keyless-fixture.d.ts +41 -0
- package/dist/workspace/trust/keyless-fixture.d.ts.map +1 -0
- package/dist/workspace/trust/keyless-fixture.js +161 -0
- package/dist/workspace/trust/keyless.d.ts +202 -0
- package/dist/workspace/trust/keyless.d.ts.map +1 -0
- package/dist/workspace/trust/keyless.js +488 -0
- package/dist/workspace/trust/local-evidence.d.ts +123 -0
- package/dist/workspace/trust/local-evidence.d.ts.map +1 -0
- package/dist/workspace/trust/local-evidence.js +259 -0
- package/dist/workspace/trust/op-run-statement.d.ts +2 -2
- package/dist/workspace/trust/op-run-statement.d.ts.map +1 -1
- package/dist/workspace/trust/policy.d.ts +140 -1
- package/dist/workspace/trust/policy.d.ts.map +1 -1
- package/dist/workspace/trust/policy.js +197 -3
- package/dist/workspace/trust/ref-gate-cli.d.ts +33 -0
- package/dist/workspace/trust/ref-gate-cli.d.ts.map +1 -0
- package/dist/workspace/trust/ref-gate-cli.js +234 -0
- package/dist/workspace/trust/ref-gate-fixture.d.ts +38 -0
- package/dist/workspace/trust/ref-gate-fixture.d.ts.map +1 -0
- package/dist/workspace/trust/ref-gate-fixture.js +97 -0
- package/dist/workspace/trust/ref-gate.d.ts +187 -0
- package/dist/workspace/trust/ref-gate.d.ts.map +1 -0
- package/dist/workspace/trust/ref-gate.js +432 -0
- package/dist/workspace/trust/run-statement.d.ts +3 -3
- package/dist/workspace/trust/run-statement.d.ts.map +1 -1
- package/dist/workspace/trust/runner-identity.d.ts +56 -0
- package/dist/workspace/trust/runner-identity.d.ts.map +1 -0
- package/dist/workspace/trust/runner-identity.js +65 -0
- package/dist/workspace/trust/trust-files.d.ts.map +1 -1
- package/dist/workspace/trust/trust-files.js +25 -1
- package/package.json +1 -1
- package/src/bundle-check.test.ts +140 -0
- package/src/bundle-check.ts +352 -0
- package/src/chant-install.test.ts +112 -0
- package/src/chant-install.ts +179 -0
- package/src/ci-commit.test.ts +45 -0
- package/src/ci-commit.ts +38 -4
- package/src/ci-evidence-jobs.ts +105 -0
- package/src/ci-image.test.ts +506 -0
- package/src/ci-image.ts +822 -0
- package/src/ci-login.test.ts +235 -0
- package/src/ci-login.ts +307 -0
- package/src/ci-product.ts +18 -0
- package/src/cli/commands/__fixtures__/source-dir-include/chant.config.json +1 -0
- package/src/cli/commands/__fixtures__/source-dir-include/infra.ts +1 -0
- package/src/cli/commands/__fixtures__/source-dir-include/scripts/run-on-load.ts +3 -0
- package/src/cli/commands/__fixtures__/source-dir-root/chant.config.json +1 -0
- package/src/cli/commands/__fixtures__/source-dir-root/infra.test.ts +1 -0
- package/src/cli/commands/__fixtures__/source-dir-root/infra.ts +1 -0
- package/src/cli/commands/__fixtures__/source-dir-root/scripts/run-on-load.ts +3 -0
- package/src/cli/commands/__fixtures__/source-dir-scoped/app.ts +3 -0
- package/src/cli/commands/__fixtures__/source-dir-scoped/chant.config.json +1 -0
- package/src/cli/commands/__fixtures__/source-dir-scoped/infra/net.ts +1 -0
- package/src/cli/commands/__fixtures__/source-dir-scoped/scripts/run-on-load.ts +3 -0
- package/src/cli/commands/import-index.ts +2 -2
- package/src/cli/handlers/build-source-dir.test.ts +64 -0
- package/src/cli/handlers/build.ts +21 -4
- package/src/cli/handlers/ci-check.ts +60 -3
- package/src/cli/handlers/ci-evidence.ts +167 -0
- package/src/cli/handlers/components.ts +3 -3
- package/src/cli/handlers/dead-guards.ts +37 -0
- package/src/cli/handlers/graph.ts +4 -4
- package/src/cli/handlers/lifecycle.ts +5 -4
- package/src/cli/handlers/local-chant.ts +106 -0
- package/src/cli/handlers/operator.ts +2 -2
- package/src/cli/handlers/search.ts +5 -5
- package/src/cli/main.test.ts +7 -0
- package/src/cli/main.ts +38 -0
- package/src/cli/parse-args.ts +21 -0
- package/src/cli/registry.ts +16 -0
- package/src/components/check-evidence-stage.test.ts +80 -0
- package/src/components/check-hooks.ts +84 -4
- package/src/components/check-local-evidence-stage.test.ts +141 -0
- package/src/components/check-steps.ts +56 -6
- package/src/components/product-pipeline.ts +28 -3
- package/src/components/product-plan.test.ts +87 -0
- package/src/components/product-plan.ts +230 -0
- package/src/components/release-compile.ts +2 -2
- package/src/config.ts +44 -3
- package/src/dead-guards.test.ts +206 -0
- package/src/dead-guards.ts +446 -0
- package/src/discovery/files.ts +5 -3
- package/src/drift-issue-bundle.test.ts +31 -0
- package/src/drift-issue.test.ts +206 -0
- package/src/drift-issue.ts +274 -0
- package/src/fit-note.test.ts +44 -0
- package/src/floor-table.data.ts +181 -0
- package/src/floor-table.ts +77 -0
- package/src/forge-flags.test.ts +110 -0
- package/src/forge-flags.ts +208 -0
- package/src/gate-decision-bundle.test.ts +1 -0
- package/src/lexicon.ts +68 -0
- package/src/lifecycle/gated-op.ts +10 -5
- package/src/local-chant.e2e.test.ts +94 -0
- package/src/local-chant.test.ts +162 -0
- package/src/local-chant.ts +341 -0
- package/src/op/activities/predict-behaviour.ts +2 -2
- package/src/op/op-waves-evidence-spec.ts +24 -0
- package/src/op/op-waves-evidence.test.ts +130 -0
- package/src/op/op-waves-evidence.ts +58 -0
- package/src/op/op-waves-run.ts +25 -1
- package/src/op/op-waves.ts +31 -1
- package/src/op/schedule-overdue.test.ts +85 -0
- package/src/op/schedule-overdue.ts +162 -26
- package/src/plan-summary.ts +40 -0
- package/src/pr-plan-note.ts +34 -0
- package/src/pr-post-plan-note.test.ts +146 -0
- package/src/pr-post.ts +127 -3
- package/src/release-floors.ts +47 -1
- package/src/stage-hooks-bundle.test.ts +1 -0
- package/src/state-migration.test.ts +52 -1
- package/src/state-migration.ts +107 -5
- package/src/workspace/ci-green.ts +4 -3
- package/src/workspace/lexicon-outputs.ts +23 -6
- package/src/workspace/reason-codes.test.ts +3 -0
- package/src/workspace/reason-codes.ts +4 -0
- package/src/workspace/ref-gate.schema.json +85 -0
- package/src/workspace/trust/check-evidence-report.ts +115 -0
- package/src/workspace/trust/check-evidence.test.ts +133 -0
- package/src/workspace/trust/check-evidence.ts +327 -0
- package/src/workspace/trust/ci-tag-statement.ts +2 -2
- package/src/workspace/trust/dsse.ts +48 -4
- package/src/workspace/trust/evidence.ts +2 -2
- package/src/workspace/trust/keyless-fixture.ts +214 -0
- package/src/workspace/trust/keyless.test.ts +220 -0
- package/src/workspace/trust/keyless.ts +557 -0
- package/src/workspace/trust/local-evidence.test.ts +127 -0
- package/src/workspace/trust/local-evidence.ts +268 -0
- package/src/workspace/trust/op-run-statement.ts +2 -2
- package/src/workspace/trust/policy.ts +263 -3
- package/src/workspace/trust/ref-gate-cli.ts +244 -0
- package/src/workspace/trust/ref-gate-fixture.ts +125 -0
- package/src/workspace/trust/ref-gate.e2e.test.ts +76 -0
- package/src/workspace/trust/ref-gate.test.ts +247 -0
- package/src/workspace/trust/ref-gate.ts +539 -0
- package/src/workspace/trust/run-statement.ts +3 -3
- package/src/workspace/trust/runner-identity.ts +92 -0
- package/src/workspace/trust/trust-files.test.ts +22 -0
- package/src/workspace/trust/trust-files.ts +54 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-pipeline.d.ts","sourceRoot":"","sources":["../../src/components/product-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAgE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChI,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA+I,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3R,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"product-pipeline.d.ts","sourceRoot":"","sources":["../../src/components/product-pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAgE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAChI,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAKL,KAAK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kB,EACzB,OAAO,GAAE,yBAA8B,GACtC,WAAW,CAuBb;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1E"}
|
|
@@ -27,6 +27,7 @@ import { assertProductWords, CHANT_WORDS, commentLine, } from "../ci-product-wor
|
|
|
27
27
|
import { prActionJob, prCommentLockJobs, prCommentPreviewJob, prLoopJobs, prLoopPostJob, prLoopRunner, prNoteCommandsJob, prStaleJob, withProductBin } from "./pr-pipeline.js";
|
|
28
28
|
import { resolveAgentSpec } from "../ci-agent.js";
|
|
29
29
|
import { resolveCommitSpec } from "../ci-commit.js";
|
|
30
|
+
import { planEvidenceOf, productPlanJobs } from "./product-plan.js";
|
|
30
31
|
/** Where the generator writes a product's waves spec, which chant reads at base (#4550). */
|
|
31
32
|
export const PRODUCT_WAVES_SPEC_DIR = ".chant/op-waves";
|
|
32
33
|
/** The waves spec file of op `name`: `.chant/op-waves/<name>.spec.json`. */
|
|
@@ -117,7 +118,7 @@ export function productPipelineJobs(forge, env, options) {
|
|
|
117
118
|
const built = options.waves || options.componentWaves ? "on-merge" : options.applyBeforeMerge ? "before-merge" : "release";
|
|
118
119
|
const applyMode = options.words.applyMode === "before-merge" && options.applyBeforeMerge ? "before-merge" : built;
|
|
119
120
|
const words = assertProductWords({ ...options.words, applyMode }, { jobs });
|
|
120
|
-
const { waves: given, wavesSpecFile, member, agent: _agent, commits: _commits, actions: _actions, componentWaves, ...loop } = options;
|
|
121
|
+
const { waves: given, wavesSpecFile, member, agent: _agent, commits: _commits, actions: _actions, componentWaves, productPlan, evidence, ...loop } = options;
|
|
121
122
|
const { respond } = options;
|
|
122
123
|
// #4629: the pull request loop puts the responses on the apply and note jobs, as `chant build --pr-loop --respond` does.
|
|
123
124
|
const prLoop = { ...loop, words, gate: options.gate ?? words.prGate };
|
|
@@ -137,9 +138,12 @@ export function productPipelineJobs(forge, env, options) {
|
|
|
137
138
|
const out = {
|
|
138
139
|
words,
|
|
139
140
|
plan: plan,
|
|
140
|
-
|
|
141
|
+
// #4870: the note job signs the plan job's plan and policy checks before it posts.
|
|
142
|
+
post: { ...post, ...(controlTarget ? { control: controlNoteCheckout(forge, controlTarget, words) } : {}), ...defaultRunner, ...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, plan.jobName) } : {}) },
|
|
141
143
|
comments,
|
|
142
144
|
...(options.applyBeforeMerge ? { applyBeforeMerge: apply } : {}),
|
|
145
|
+
// #4799: the product's plan verb, a plan job and a note job per target.
|
|
146
|
+
...(productPlan ? { productPlan: productPlanJobs(forge, env, { ...prLoop, plan: productPlan }, words, evidence) } : {}),
|
|
143
147
|
};
|
|
144
148
|
const locks = prCommentLockJobs(forge, { locks: options.locks, words });
|
|
145
149
|
if (locks.length > 0)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product plan (#4799): the pull request plan jobs of a product whose
|
|
3
|
+
* plan step runs its own plan verb, in place of `chant components pr-plan`.
|
|
4
|
+
*
|
|
5
|
+
* #4550 ruling A put the plan side of a product's pipeline on the pull
|
|
6
|
+
* request loop. The 2026-11-09 amendment (#4799) reads it as "pr-plan or the
|
|
7
|
+
* product's plan verb": sql-yodeler plans an environment with `yodel plan`
|
|
8
|
+
* and terragucci its roots with `terragucci plan`, and neither has a
|
|
9
|
+
* component graph for `pr-plan` to plan. Each keeps its plan verb, and chant
|
|
10
|
+
* writes the jobs around it, as it does for `pr-plan`:
|
|
11
|
+
*
|
|
12
|
+
* - the plan job checks the change out with the token given to its fetches
|
|
13
|
+
* alone, starts every later step without the forge tokens (#4295), and
|
|
14
|
+
* runs the plan verb last, which writes a `PrReport` (`pr-plan.json`) or
|
|
15
|
+
* a product's plan note hand-off (`pr-plan-note.json`, ../pr-plan-note.ts)
|
|
16
|
+
* into {@link PR_LOOP_REPORT_DIR}. The job hands the directory on.
|
|
17
|
+
* - the plan-note job checks out the target branch's commit, takes the
|
|
18
|
+
* directory back, keeps it as the run's artifact, and posts the note and
|
|
19
|
+
* the plan status with `chant components pr-post` (../pr-post.ts), which
|
|
20
|
+
* renders either file. On GitLab it is the target-branch job `pr-post
|
|
21
|
+
* --open`, as for `pr-plan` (#4328).
|
|
22
|
+
*
|
|
23
|
+
* With `targets`, one plan job and one plan-note job per target (an
|
|
24
|
+
* environment, for sql-yodeler) in the one workflow, each with only that
|
|
25
|
+
* target's own variables and secrets, and an optional write probe before the
|
|
26
|
+
* plan. A target is the note's and the status's member: `pr-post --member
|
|
27
|
+
* <target>`, so each target has its note and its `<product>/plan/<target>`.
|
|
28
|
+
*
|
|
29
|
+
* The forge lexicons render these descriptors
|
|
30
|
+
* (`generateProductPlanPipeline` in each): the products call them in
|
|
31
|
+
* process, with no component graph.
|
|
32
|
+
*/
|
|
33
|
+
import type { ForgeKind } from "../pr-forge.js";
|
|
34
|
+
import type { CiRunner } from "../ci-jobs.js";
|
|
35
|
+
import type { CiProductWords } from "../ci-product-words.js";
|
|
36
|
+
import type { PrPlanNoteWords } from "../pr-plan-note.js";
|
|
37
|
+
import { type PipelineEvidence } from "../ci-evidence-jobs.js";
|
|
38
|
+
import { type PrLoopPipelineOptions } from "./pr-pipeline.js";
|
|
39
|
+
/** The variable the plan-note job reads the product's note words from (#4799), as JSON. Set from the pipeline, never from the report. */
|
|
40
|
+
export declare const PR_PLAN_NOTE_WORDS_ENV = "CHANT_PLAN_NOTE_WORDS";
|
|
41
|
+
/** One target the product plans in a job of its own (#4799): an environment, for sql-yodeler. */
|
|
42
|
+
export interface ProductPlanTarget {
|
|
43
|
+
/** The target's name: `{target}` in the command, the job names, and the note's member. Letters, digits, `-` and `_`. */
|
|
44
|
+
name: string;
|
|
45
|
+
/** Variables for this target's plan job alone, as the forge reads them. A forge token's name is refused. */
|
|
46
|
+
variables?: Record<string, string>;
|
|
47
|
+
/** Secrets for this target's plan job alone, as `{ <variable>: <secret> }`, mapped as the pull request loop's `secrets` are. */
|
|
48
|
+
secrets?: Record<string, string>;
|
|
49
|
+
/**
|
|
50
|
+
* A shell line run before the plan that fails the job when the target's
|
|
51
|
+
* credentials can write, such as sql-yodeler's `yodel config check <env>
|
|
52
|
+
* --write-probe`. It runs with the target's variables, after the forge
|
|
53
|
+
* tokens are dropped.
|
|
54
|
+
*/
|
|
55
|
+
writeProbe?: string;
|
|
56
|
+
}
|
|
57
|
+
/** The product plan (#4799): {@link ProductPipelineOptions.plan}. */
|
|
58
|
+
export interface ProductPlanOptions {
|
|
59
|
+
/**
|
|
60
|
+
* The product's plan verb, as one shell line: `{target}` is the target's
|
|
61
|
+
* name and `{output}` the directory the plan-note job takes back
|
|
62
|
+
* ({@link PR_LOOP_REPORT_DIR}). It reads `$BASE_SHA` and `$PR_NUMBER`, and
|
|
63
|
+
* writes `pr-plan.json` or `pr-plan-note.json` there. It runs as given,
|
|
64
|
+
* not through the words' `bin`: it is the product's command, not chant's.
|
|
65
|
+
*/
|
|
66
|
+
command: string;
|
|
67
|
+
/** One plan job per target. Absent: one plan job, named as the pull request loop's. */
|
|
68
|
+
targets?: ProductPlanTarget[];
|
|
69
|
+
/**
|
|
70
|
+
* `skip`: a pull request from a fork runs no plan and no note job (on
|
|
71
|
+
* GitHub and Forgejo it carries no token and no OIDC; on GitLab, a fork's
|
|
72
|
+
* merge request pipeline runs in the fork). The product's check job,
|
|
73
|
+
* which holds no credentials, still runs for it. Default: every pull
|
|
74
|
+
* request plans.
|
|
75
|
+
*/
|
|
76
|
+
forks?: "skip";
|
|
77
|
+
/** The artifact the plan-note job keeps the directory as. Default `chant-pr-plan`, or `chant-pr-plan-<target>`. */
|
|
78
|
+
artifact?: string;
|
|
79
|
+
/** The words a plan note hand-off renders with (`renderPlanNote`'s `note`), passed to the note job as {@link PR_PLAN_NOTE_WORDS_ENV}. */
|
|
80
|
+
noteWords?: PrPlanNoteWords;
|
|
81
|
+
/** The workflow's name (GitHub and Forgejo) or the pipeline's (GitLab). Default `chant-pr-<env>`. */
|
|
82
|
+
workflow?: string;
|
|
83
|
+
}
|
|
84
|
+
/** One plan job and its note job, for one target or for the whole pipeline (#4799). */
|
|
85
|
+
export interface ProductPlanJob {
|
|
86
|
+
/** The target, when the plan has targets. Also the note's and the status's member. */
|
|
87
|
+
target?: string;
|
|
88
|
+
/** The plan job: `plan` or `plan-<target>` on GitHub and Forgejo, `plan` or `<target>-plan` on GitLab, where `pr-post --open` finds it by that name. */
|
|
89
|
+
jobName: string;
|
|
90
|
+
/** The note job: `plan-note` or `plan-note-<target>`, `<target>-plan-note` on GitLab. */
|
|
91
|
+
noteJobName: string;
|
|
92
|
+
/** The plan verb's line, `{target}` and `{output}` filled. */
|
|
93
|
+
command: string;
|
|
94
|
+
/** The plan step's variables: `BASE_SHA`, `PR_NUMBER`, the pipeline's passed variables and secrets, then the target's. No forge token. */
|
|
95
|
+
env: Record<string, string>;
|
|
96
|
+
/** The target's write probe. */
|
|
97
|
+
writeProbe?: string;
|
|
98
|
+
/** The note job's command and variables. */
|
|
99
|
+
post: {
|
|
100
|
+
command: string;
|
|
101
|
+
env: Record<string, string>;
|
|
102
|
+
};
|
|
103
|
+
/** The artifact the note job (GitHub, Forgejo) or the plan job (GitLab) keeps the directory as. */
|
|
104
|
+
artifact: string;
|
|
105
|
+
/** Where the plan job runs: the loop's `plan` runner. */
|
|
106
|
+
runner?: CiRunner;
|
|
107
|
+
/** Where the note job runs: the loop's `default` runner. */
|
|
108
|
+
noteRunner?: CiRunner;
|
|
109
|
+
/**
|
|
110
|
+
* With the pipeline's `evidence` (#4870): the lines that sign the plan
|
|
111
|
+
* job's `plan` and `policy` checks from its report, and their variables
|
|
112
|
+
* (the runner key from its secret). GitHub and Forgejo run them in the
|
|
113
|
+
* note job before `pr-post`; GitLab in a job of their own after the plan
|
|
114
|
+
* job, `evidenceJobName`. Signing keyless (#4869), the job asks for an
|
|
115
|
+
* OIDC token: `idToken` (GitHub's `id-token: write`, Forgejo's
|
|
116
|
+
* `enable-openid-connect`) or GitLab's `idTokens`.
|
|
117
|
+
*/
|
|
118
|
+
evidence?: {
|
|
119
|
+
lines: string[];
|
|
120
|
+
env: Record<string, string>;
|
|
121
|
+
jobName?: string;
|
|
122
|
+
idToken?: true;
|
|
123
|
+
idTokens?: Record<string, {
|
|
124
|
+
aud: string;
|
|
125
|
+
}>;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The product plan's jobs for `forge` (#4799). `words` are the pipeline's,
|
|
130
|
+
* already checked. Throws on a target name that is not one, a name given
|
|
131
|
+
* twice, a target variable that is a forge token, and a pull request loop
|
|
132
|
+
* option the product plan does not carry.
|
|
133
|
+
*/
|
|
134
|
+
export declare function productPlanJobs(forge: ForgeKind, env: string, loop: PrLoopPipelineOptions & {
|
|
135
|
+
plan: ProductPlanOptions;
|
|
136
|
+
}, words: CiProductWords, evidence?: PipelineEvidence): ProductPlanJob[];
|
|
137
|
+
/** The evidence step of one plan job (#4870), as {@link ProductPlanJob.evidence}. */
|
|
138
|
+
export declare function planEvidenceOf(forge: ForgeKind, evidence: PipelineEvidence, words: CiProductWords, planJob: string): NonNullable<ProductPlanJob["evidence"]>;
|
|
139
|
+
/** The GitHub and Forgejo condition that a pull request is from this repository, not a fork (#4799). */
|
|
140
|
+
export declare const SAME_REPOSITORY_IF = "github.event.pull_request.head.repo.full_name == github.repository";
|
|
141
|
+
/** The GitLab rule condition that a merge request's source project is the project itself (#4799). */
|
|
142
|
+
export declare const GITLAB_SAME_PROJECT_IF = "$CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_MERGE_REQUEST_PROJECT_ID";
|
|
143
|
+
//# sourceMappingURL=product-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-plan.d.ts","sourceRoot":"","sources":["../../src/components/product-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;A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;AAEvG,qGAAqG;AACrG,eAAO,MAAM,sBAAsB,wEAAwE,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product plan (#4799): the pull request plan jobs of a product whose
|
|
3
|
+
* plan step runs its own plan verb, in place of `chant components pr-plan`.
|
|
4
|
+
*
|
|
5
|
+
* #4550 ruling A put the plan side of a product's pipeline on the pull
|
|
6
|
+
* request loop. The 2026-11-09 amendment (#4799) reads it as "pr-plan or the
|
|
7
|
+
* product's plan verb": sql-yodeler plans an environment with `yodel plan`
|
|
8
|
+
* and terragucci its roots with `terragucci plan`, and neither has a
|
|
9
|
+
* component graph for `pr-plan` to plan. Each keeps its plan verb, and chant
|
|
10
|
+
* writes the jobs around it, as it does for `pr-plan`:
|
|
11
|
+
*
|
|
12
|
+
* - the plan job checks the change out with the token given to its fetches
|
|
13
|
+
* alone, starts every later step without the forge tokens (#4295), and
|
|
14
|
+
* runs the plan verb last, which writes a `PrReport` (`pr-plan.json`) or
|
|
15
|
+
* a product's plan note hand-off (`pr-plan-note.json`, ../pr-plan-note.ts)
|
|
16
|
+
* into {@link PR_LOOP_REPORT_DIR}. The job hands the directory on.
|
|
17
|
+
* - the plan-note job checks out the target branch's commit, takes the
|
|
18
|
+
* directory back, keeps it as the run's artifact, and posts the note and
|
|
19
|
+
* the plan status with `chant components pr-post` (../pr-post.ts), which
|
|
20
|
+
* renders either file. On GitLab it is the target-branch job `pr-post
|
|
21
|
+
* --open`, as for `pr-plan` (#4328).
|
|
22
|
+
*
|
|
23
|
+
* With `targets`, one plan job and one plan-note job per target (an
|
|
24
|
+
* environment, for sql-yodeler) in the one workflow, each with only that
|
|
25
|
+
* target's own variables and secrets, and an optional write probe before the
|
|
26
|
+
* plan. A target is the note's and the status's member: `pr-post --member
|
|
27
|
+
* <target>`, so each target has its note and its `<product>/plan/<target>`.
|
|
28
|
+
*
|
|
29
|
+
* The forge lexicons render these descriptors
|
|
30
|
+
* (`generateProductPlanPipeline` in each): the products call them in
|
|
31
|
+
* process, with no component graph.
|
|
32
|
+
*/
|
|
33
|
+
import { assertPipelineEvidence, evidenceIdTokens, evidenceKeyEnv, evidenceKeyless, planEvidenceLines } from "../ci-evidence-jobs.js";
|
|
34
|
+
import { gitlabPlanJobName, PR_LOOP_REPORT_DIR, PR_PLAN_NOTE_JOB, prLoopPassedEnv, prLoopPostJob, prLoopRunner } from "./pr-pipeline.js";
|
|
35
|
+
/** The variable the plan-note job reads the product's note words from (#4799), as JSON. Set from the pipeline, never from the report. */
|
|
36
|
+
export const PR_PLAN_NOTE_WORDS_ENV = "CHANT_PLAN_NOTE_WORDS";
|
|
37
|
+
const TARGET_NAME = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
|
|
38
|
+
/** The pull request loop's options the product plan's jobs do not carry, and what each needs. Each is refused with `plan` (#4799). */
|
|
39
|
+
const NOT_WITH_PLAN = [
|
|
40
|
+
["applyBeforeMerge", "the apply before merge runs pr-apply on pr-plan's report"],
|
|
41
|
+
["applyOnMerge", "the apply on merge runs on op waves, from the waves spec"],
|
|
42
|
+
["waveGate", "the apply on merge runs on op waves, from the waves spec"],
|
|
43
|
+
["locks", "the lock job reads pr-plan's report"],
|
|
44
|
+
["previewComment", "the comment preview re-runs pr-plan"],
|
|
45
|
+
["staleNotes", "the stale marking names one note per pipeline"],
|
|
46
|
+
["identity", "a target's cloud login is the product's, through its variables"],
|
|
47
|
+
["build", "the plan verb builds what it plans"],
|
|
48
|
+
["buildCommand", "the plan verb builds what it plans"],
|
|
49
|
+
["refresh", "--refresh is a pr-plan flag"],
|
|
50
|
+
["parallelism", "--parallelism is a pr-plan flag"],
|
|
51
|
+
["commentTargets", "--comment-targets is a pr-plan flag"],
|
|
52
|
+
["events", "--events-json is a pr-plan flag"],
|
|
53
|
+
["reportUrl", "--report-url is a pr-plan flag"],
|
|
54
|
+
["prEnvironment", "the pull request environment jobs run pr-env"],
|
|
55
|
+
["noteCommands", "the note-commands job starts pr-plan's comment jobs"],
|
|
56
|
+
["actionJob", "the action job is in chant build --pr-loop's workflow"],
|
|
57
|
+
["control", "the control read is the pr-plan report's cross-stack edges"],
|
|
58
|
+
["decide", "the description check reads pr-plan's report"],
|
|
59
|
+
];
|
|
60
|
+
/**
|
|
61
|
+
* The product plan's jobs for `forge` (#4799). `words` are the pipeline's,
|
|
62
|
+
* already checked. Throws on a target name that is not one, a name given
|
|
63
|
+
* twice, a target variable that is a forge token, and a pull request loop
|
|
64
|
+
* option the product plan does not carry.
|
|
65
|
+
*/
|
|
66
|
+
export function productPlanJobs(forge, env, loop, words, evidence) {
|
|
67
|
+
const plan = loop.plan;
|
|
68
|
+
for (const [key, why] of NOT_WITH_PLAN) {
|
|
69
|
+
const value = loop[key];
|
|
70
|
+
if (value !== undefined && value !== false)
|
|
71
|
+
throw new Error(`the product plan (plan) takes no ${key}: ${why}`);
|
|
72
|
+
}
|
|
73
|
+
if (!plan.command.trim())
|
|
74
|
+
throw new Error("the product plan's command is empty; give the product's plan verb");
|
|
75
|
+
const targets = plan.targets;
|
|
76
|
+
if (targets !== undefined && targets.length === 0)
|
|
77
|
+
throw new Error("the product plan's targets are empty; leave targets out for one plan job");
|
|
78
|
+
const seen = new Set();
|
|
79
|
+
for (const t of targets ?? []) {
|
|
80
|
+
if (!TARGET_NAME.test(t.name))
|
|
81
|
+
throw new Error(`the product plan's target ${JSON.stringify(t.name)} is not a name of letters, digits, - and _`);
|
|
82
|
+
if (seen.has(t.name))
|
|
83
|
+
throw new Error(`the product plan names target ${t.name} twice`);
|
|
84
|
+
seen.add(t.name);
|
|
85
|
+
}
|
|
86
|
+
const github = forge !== "gitlab";
|
|
87
|
+
const shared = prLoopPassedEnv(forge, loop);
|
|
88
|
+
const planRunner = prLoopRunner(loop, "plan");
|
|
89
|
+
const noteRunner = prLoopRunner(loop, "default");
|
|
90
|
+
const base = github
|
|
91
|
+
? { BASE_SHA: "${{ github.event.pull_request.base.sha }}", PR_NUMBER: "${{ github.event.pull_request.number }}" }
|
|
92
|
+
: { BASE_SHA: "$CI_MERGE_REQUEST_DIFF_BASE_SHA", PR_NUMBER: "$CI_MERGE_REQUEST_IID" };
|
|
93
|
+
const noteWords = plan.noteWords ? { [PR_PLAN_NOTE_WORDS_ENV]: JSON.stringify(plan.noteWords) } : {};
|
|
94
|
+
const one = (target) => {
|
|
95
|
+
const name = target?.name;
|
|
96
|
+
const jobName = github ? (name ? `plan-${name}` : "plan") : gitlabPlanJobName(name);
|
|
97
|
+
const noteJobName = github ? (name ? `${PR_PLAN_NOTE_JOB}-${name}` : PR_PLAN_NOTE_JOB) : name ? `${name}-${PR_PLAN_NOTE_JOB}` : PR_PLAN_NOTE_JOB;
|
|
98
|
+
const own = target ? prLoopPassedEnv(forge, { ...(target.variables ? { variables: target.variables } : {}), ...(target.secrets ? { secrets: target.secrets } : {}) }) : {};
|
|
99
|
+
for (const key of Object.keys(own)) {
|
|
100
|
+
if (key in shared)
|
|
101
|
+
throw new Error(`target ${name}'s ${key} is the pipeline's too; give it on the target or on the pipeline`);
|
|
102
|
+
}
|
|
103
|
+
const post = prLoopPostJob(forge, env, name, words);
|
|
104
|
+
// The note job reads its own plan job's result, by that job's name.
|
|
105
|
+
const postEnv = github ? { ...post.env, PLAN_RESULT: `\${{ needs.${jobName}.result }}`, ...noteWords } : { ...post.env, ...noteWords };
|
|
106
|
+
return {
|
|
107
|
+
...(name ? { target: name } : {}),
|
|
108
|
+
jobName,
|
|
109
|
+
noteJobName,
|
|
110
|
+
command: plan.command.replaceAll("{target}", name ?? env).replaceAll("{output}", PR_LOOP_REPORT_DIR),
|
|
111
|
+
env: { ...base, ...shared, ...own },
|
|
112
|
+
...(target?.writeProbe ? { writeProbe: target.writeProbe } : {}),
|
|
113
|
+
post: { command: post.command, env: postEnv },
|
|
114
|
+
artifact: plan.artifact ? (name ? `${plan.artifact}-${name}` : plan.artifact) : name ? `chant-pr-plan-${name}` : "chant-pr-plan",
|
|
115
|
+
...(planRunner !== undefined ? { runner: planRunner } : {}),
|
|
116
|
+
...(noteRunner !== undefined ? { noteRunner } : {}),
|
|
117
|
+
...(evidence ? { evidence: planEvidenceOf(forge, evidence, words, jobName) } : {}),
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
return targets ? targets.map(one) : [one()];
|
|
121
|
+
}
|
|
122
|
+
/** The evidence step of one plan job (#4870), as {@link ProductPlanJob.evidence}. */
|
|
123
|
+
export function planEvidenceOf(forge, evidence, words, planJob) {
|
|
124
|
+
assertPipelineEvidence(evidence);
|
|
125
|
+
const key = evidenceKeyEnv(forge, evidence);
|
|
126
|
+
const bin = words.bin;
|
|
127
|
+
if (forge === "gitlab") {
|
|
128
|
+
// The job runs only once the plan job succeeded, on the merge request's commit.
|
|
129
|
+
return {
|
|
130
|
+
jobName: `${planJob}-evidence`,
|
|
131
|
+
lines: planEvidenceLines({ dir: PR_LOOP_REPORT_DIR, at: '"$CI_COMMIT_SHA"', base: '"$CI_MERGE_REQUEST_DIFF_BASE_SHA"', result: "success", ...(bin ? { bin } : {}) }),
|
|
132
|
+
env: key,
|
|
133
|
+
...(evidenceKeyless(evidence) ? { idTokens: evidenceIdTokens(evidence) } : {}),
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
lines: planEvidenceLines({ dir: PR_LOOP_REPORT_DIR, at: '"$HEAD_SHA"', base: '"$BASE_SHA"', result: '"$PLAN_RESULT"', ...(bin ? { bin } : {}) }),
|
|
138
|
+
env: { HEAD_SHA: "${{ github.sha }}", BASE_SHA: "${{ github.event.pull_request.base.sha }}", PLAN_RESULT: `\${{ needs.${planJob}.result }}`, ...key },
|
|
139
|
+
...(evidenceKeyless(evidence) ? { idToken: true } : {}),
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/** The GitHub and Forgejo condition that a pull request is from this repository, not a fork (#4799). */
|
|
143
|
+
export const SAME_REPOSITORY_IF = "github.event.pull_request.head.repo.full_name == github.repository";
|
|
144
|
+
/** The GitLab rule condition that a merge request's source project is the project itself (#4799). */
|
|
145
|
+
export const GITLAB_SAME_PROJECT_IF = "$CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_MERGE_REQUEST_PROJECT_ID";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"release-compile.d.ts","sourceRoot":"","sources":["../../src/components/release-compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAOH,OAAO,
|
|
1
|
+
{"version":3,"file":"release-compile.d.ts","sourceRoot":"","sources":["../../src/components/release-compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAOH,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AAOhF,OAAO,EAAwC,KAAK,eAAe,EAAqC,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1I,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAE5F,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGhF,mFAAmF;AACnF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMlD,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mDAAmD;AACnD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CA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
|
|
|
43
43
|
import { existsSync, mkdtempSync, readFileSync, rmSync, statSync } from "node:fs";
|
|
44
44
|
import { tmpdir } from "node:os";
|
|
45
45
|
import { isAbsolute, join, relative, resolve } from "node:path";
|
|
46
|
-
import { loadChantConfig } from "../config.js";
|
|
46
|
+
import { loadChantConfig, resolveSourceDir } from "../config.js";
|
|
47
47
|
import { resolveFlaggedBuildParams } from "../flag-params.js";
|
|
48
48
|
import { discoverComponents } from "./discover.js";
|
|
49
49
|
import { withoutDisabled } from "./cli-support.js";
|
|
@@ -366,7 +366,7 @@ export async function compileBuildOutput(inputs, env, config) {
|
|
|
366
366
|
"name it with --src <dir>");
|
|
367
367
|
}
|
|
368
368
|
const projectDir = resolve(inputs.projectDir);
|
|
369
|
-
const root =
|
|
369
|
+
const root = resolveSourceDir(projectDir, config, inputs.src);
|
|
370
370
|
const output = resolve(projectDir, inputs.output ?? DEFAULT_BUILD_OUTPUT);
|
|
371
371
|
const rel = relative(projectDir, output);
|
|
372
372
|
if (rel === "" || rel.startsWith("..") || isAbsolute(rel)) {
|
package/dist/config.d.ts
CHANGED
|
@@ -369,6 +369,12 @@ export interface ChantConfig {
|
|
|
369
369
|
* of the project root, so a mixed-layout project — chant `src/` alongside app
|
|
370
370
|
* code that has import side effects — can scope the build to just the infra.
|
|
371
371
|
* Defaults to "." (the project root). The `--src` flag overrides it.
|
|
372
|
+
*
|
|
373
|
+
* #4794: every command that picks a source directory (`chant build`, the
|
|
374
|
+
* release compile, `chant lifecycle`, `graph`, `search`, `components`, the
|
|
375
|
+
* lexicon commands) reads it through {@link resolveSourceDir}. A root build,
|
|
376
|
+
* one with no `sourceDir`, leaves a top-level `scripts/` directory out
|
|
377
|
+
* ({@link ROOT_SOURCE_EXCLUDES}) unless `include` brings it back.
|
|
372
378
|
*/
|
|
373
379
|
sourceDir?: string;
|
|
374
380
|
/**
|
|
@@ -781,6 +787,36 @@ export declare function findProjectConfigPastFragments(startDir: string): {
|
|
|
781
787
|
dir: string;
|
|
782
788
|
configPath?: string;
|
|
783
789
|
};
|
|
790
|
+
/**
|
|
791
|
+
* The source directory a project's config names, relative to the project
|
|
792
|
+
* root: `sourceDir`, else "." (#4794). The relative half of
|
|
793
|
+
* {@link resolveSourceDir}, for a caller that names a path inside the
|
|
794
|
+
* project (a rollback's `git checkout -- <dir>`).
|
|
795
|
+
*/
|
|
796
|
+
export declare function configuredSourceDir(config: {
|
|
797
|
+
sourceDir?: unknown;
|
|
798
|
+
} | undefined): string;
|
|
799
|
+
/**
|
|
800
|
+
* The one source-dir rule (#4794): the directory a command builds a
|
|
801
|
+
* project's declarations from, absolute. `explicit` (a `--src` flag or a path
|
|
802
|
+
* argument) wins, resolved against `projectDir`; else the config's
|
|
803
|
+
* `sourceDir`; else the project root. There is no `src` fallback: a project
|
|
804
|
+
* whose declarations live in `src/` beside other code says so with
|
|
805
|
+
* `sourceDir: "src"`. A root build leaves out {@link ROOT_SOURCE_EXCLUDES}.
|
|
806
|
+
*/
|
|
807
|
+
export declare function resolveSourceDir(projectDir: string, config: {
|
|
808
|
+
sourceDir?: unknown;
|
|
809
|
+
} | undefined, explicit?: string): string;
|
|
810
|
+
/**
|
|
811
|
+
* The top-level directories a root build leaves out (#4794): a project with
|
|
812
|
+
* no `sourceDir`, built from its own root, does not load `scripts/`, where a
|
|
813
|
+
* script that runs on load (prints and exits) would take the build's place.
|
|
814
|
+
* Matched against the path relative to the project root, so only the
|
|
815
|
+
* project's own top-level `scripts/` is skipped. The config's `include`
|
|
816
|
+
* brings it back. Test and spec files are left out of every build already
|
|
817
|
+
* (`isSourceFileName`).
|
|
818
|
+
*/
|
|
819
|
+
export declare const ROOT_SOURCE_EXCLUDES: readonly string[];
|
|
784
820
|
/** A project's discovery globs (#2519) and the directory they are relative to. */
|
|
785
821
|
export interface DiscoveryGlobs {
|
|
786
822
|
/** The directory holding the config that declared the globs. */
|
|
@@ -800,7 +836,9 @@ export interface DiscoveryGlobs {
|
|
|
800
836
|
* is in `exclude` or `include` themselves: ignoring those would discover the
|
|
801
837
|
* very files the project asked to skip.
|
|
802
838
|
*/
|
|
803
|
-
export declare function resolveDiscoveryGlobs(startDir: string
|
|
839
|
+
export declare function resolveDiscoveryGlobs(startDir: string, options?: {
|
|
840
|
+
sourceWalk?: boolean;
|
|
841
|
+
}): Promise<DiscoveryGlobs | undefined>;
|
|
804
842
|
export declare function isLintOnlyFragment(configPath: string): boolean;
|
|
805
843
|
/**
|
|
806
844
|
* Resolve the `env` half of the ownership marker (#1396). A literal is
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,EAA8D,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvH,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAA4B,KAAK,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAKpG,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,0BAA0B,EAC1B,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,sBAAsB,EAC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OAAO,EAAE,OAAO,CAAC;IACjB,qIAAqI;IACrI,GAAG,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACtB,6RAA6R;IAC7R,sBAAsB,EAAE;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,uBAAuB,CAanF;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAiB1E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpF;AAED;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IACnB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM;IAAlD,YAAY,OAAO,EAAE,MAAM,EAAW,GAAG,CAAC,EAAE,MAAM,YAAA,EAEjD;CACF"}
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
|
-
import { dirname, join } from "path";
|
|
2
|
+
import { dirname, join, resolve } from "path";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { DEFAULT_SBOM_FORMAT } from "./components/verbs/sbom-generator.js";
|
|
5
5
|
import { findProjectConfig } from "./project-root.js";
|
|
@@ -257,6 +257,36 @@ export function findProjectConfigPastFragments(startDir) {
|
|
|
257
257
|
}
|
|
258
258
|
return { dir, configPath };
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* The source directory a project's config names, relative to the project
|
|
262
|
+
* root: `sourceDir`, else "." (#4794). The relative half of
|
|
263
|
+
* {@link resolveSourceDir}, for a caller that names a path inside the
|
|
264
|
+
* project (a rollback's `git checkout -- <dir>`).
|
|
265
|
+
*/
|
|
266
|
+
export function configuredSourceDir(config) {
|
|
267
|
+
return typeof config?.sourceDir === "string" && config.sourceDir !== "" ? config.sourceDir : ".";
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The one source-dir rule (#4794): the directory a command builds a
|
|
271
|
+
* project's declarations from, absolute. `explicit` (a `--src` flag or a path
|
|
272
|
+
* argument) wins, resolved against `projectDir`; else the config's
|
|
273
|
+
* `sourceDir`; else the project root. There is no `src` fallback: a project
|
|
274
|
+
* whose declarations live in `src/` beside other code says so with
|
|
275
|
+
* `sourceDir: "src"`. A root build leaves out {@link ROOT_SOURCE_EXCLUDES}.
|
|
276
|
+
*/
|
|
277
|
+
export function resolveSourceDir(projectDir, config, explicit) {
|
|
278
|
+
return resolve(projectDir, explicit ?? configuredSourceDir(config));
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* The top-level directories a root build leaves out (#4794): a project with
|
|
282
|
+
* no `sourceDir`, built from its own root, does not load `scripts/`, where a
|
|
283
|
+
* script that runs on load (prints and exits) would take the build's place.
|
|
284
|
+
* Matched against the path relative to the project root, so only the
|
|
285
|
+
* project's own top-level `scripts/` is skipped. The config's `include`
|
|
286
|
+
* brings it back. Test and spec files are left out of every build already
|
|
287
|
+
* (`isSourceFileName`).
|
|
288
|
+
*/
|
|
289
|
+
export const ROOT_SOURCE_EXCLUDES = ["scripts"];
|
|
260
290
|
/**
|
|
261
291
|
* The `exclude`/`include` globs of the project `startDir` belongs to, found by
|
|
262
292
|
* the same upward walk as {@link loadChantConfigUpward}. `undefined` when the
|
|
@@ -269,7 +299,7 @@ export function findProjectConfigPastFragments(startDir) {
|
|
|
269
299
|
* is in `exclude` or `include` themselves: ignoring those would discover the
|
|
270
300
|
* very files the project asked to skip.
|
|
271
301
|
*/
|
|
272
|
-
export async function resolveDiscoveryGlobs(startDir) {
|
|
302
|
+
export async function resolveDiscoveryGlobs(startDir, options = {}) {
|
|
273
303
|
const { dir, configPath } = findProjectConfigPastFragments(startDir);
|
|
274
304
|
if (!configPath)
|
|
275
305
|
return undefined;
|
|
@@ -282,7 +312,9 @@ export async function resolveDiscoveryGlobs(startDir) {
|
|
|
282
312
|
throw err;
|
|
283
313
|
return undefined;
|
|
284
314
|
}
|
|
285
|
-
|
|
315
|
+
// #4794: a source walk from the root of a project with no sourceDir (a root build) leaves out ROOT_SOURCE_EXCLUDES.
|
|
316
|
+
const rootBuild = options.sourceWalk === true && config.sourceDir === undefined && resolve(startDir) === resolve(dir);
|
|
317
|
+
const exclude = [...(config.exclude ?? []), ...(rootBuild ? ROOT_SOURCE_EXCLUDES : [])];
|
|
286
318
|
const include = config.include ?? [];
|
|
287
319
|
if (exclude.length === 0 && include.length === 0)
|
|
288
320
|
return undefined;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type FloorRow } from "./floor-table.js";
|
|
2
|
+
/** One feature-detect the pin meets. */
|
|
3
|
+
export interface DeadGuard {
|
|
4
|
+
/** The file, relative to the product's directory, with `/` separators. */
|
|
5
|
+
file: string;
|
|
6
|
+
/** The line, from 1. */
|
|
7
|
+
line: number;
|
|
8
|
+
kind: "floor" | "module" | "product-floor";
|
|
9
|
+
/** The floor's name, or the subpath for `module`. */
|
|
10
|
+
floor: string;
|
|
11
|
+
/** The floor's version. */
|
|
12
|
+
version: string;
|
|
13
|
+
/** The chant pin that meets it. */
|
|
14
|
+
pin: string;
|
|
15
|
+
/** The line's text, trimmed. */
|
|
16
|
+
text: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DeadGuardsOptions {
|
|
19
|
+
/** The product's root. */
|
|
20
|
+
productDir: string;
|
|
21
|
+
/** Check every file against this chant version, in place of the package.json pins. */
|
|
22
|
+
chant?: string;
|
|
23
|
+
/** The floor table; chant's own by default. */
|
|
24
|
+
table?: readonly FloorRow[];
|
|
25
|
+
}
|
|
26
|
+
export interface DeadGuardsResult {
|
|
27
|
+
ok: boolean;
|
|
28
|
+
/** Each check the pin meets, by file and line. */
|
|
29
|
+
dead: DeadGuard[];
|
|
30
|
+
/** Each check the pin does not meet yet, the same shape, with `pin` the pin that falls short. */
|
|
31
|
+
live: DeadGuard[];
|
|
32
|
+
/** Each package.json with a chant pin and the version it pins at least. */
|
|
33
|
+
pins: {
|
|
34
|
+
file: string;
|
|
35
|
+
pin: string;
|
|
36
|
+
}[];
|
|
37
|
+
/** The number of source files read. */
|
|
38
|
+
files: number;
|
|
39
|
+
/** Source files with no chant pin above them, which no check was made in. */
|
|
40
|
+
unpinned: string[];
|
|
41
|
+
}
|
|
42
|
+
/** The lowest version a chant range admits: `^0.124.78` is 0.124.78. Undefined for `workspace:`, `file:` and the like. */
|
|
43
|
+
export declare function pinOf(range: string): string | undefined;
|
|
44
|
+
/** The product's source files, relative, skipping dependencies, builds, tests and hidden directories. */
|
|
45
|
+
export declare function productSources(productDir: string): string[];
|
|
46
|
+
/**
|
|
47
|
+
* `src` with every comment blanked to spaces (line breaks kept), and a mask
|
|
48
|
+
* of which characters sit inside a string or template literal's text.
|
|
49
|
+
*/
|
|
50
|
+
export declare function scanSource(src: string): {
|
|
51
|
+
code: string;
|
|
52
|
+
inString: Uint8Array;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Whether `offset` in `code` (comments blanked) sits inside a `try { ... }`
|
|
56
|
+
* block that has a `catch`: an open brace before it, not yet closed, that
|
|
57
|
+
* follows `try`, and whose block is followed by `catch`. A `try` with only
|
|
58
|
+
* `finally` catches nothing. Braces in strings count too, which a template
|
|
59
|
+
* literal can throw off; the check is a heuristic, and
|
|
60
|
+
* `chant-dead-guards: keep` covers a miss.
|
|
61
|
+
*/
|
|
62
|
+
export declare function insideTry(code: string, offset: number): boolean;
|
|
63
|
+
/** One finding in one file, before the pin is applied. */
|
|
64
|
+
export interface Guard {
|
|
65
|
+
line: number;
|
|
66
|
+
kind: DeadGuard["kind"];
|
|
67
|
+
floor: string;
|
|
68
|
+
version: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The feature-detects on a floor in one source file. `table` gives each
|
|
72
|
+
* floor's version; a name two files declare takes the higher one.
|
|
73
|
+
*/
|
|
74
|
+
export declare function guardsIn(src: string, table?: readonly FloorRow[]): Guard[];
|
|
75
|
+
/**
|
|
76
|
+
* Every feature-detect in the product at `productDir` and whether its pin
|
|
77
|
+
* meets it. `ok` is false when one does.
|
|
78
|
+
*/
|
|
79
|
+
export declare function findDeadGuards(options: DeadGuardsOptions): DeadGuardsResult;
|
|
80
|
+
/** One dead guard as a line: `file:line: ...`. */
|
|
81
|
+
export declare function deadGuardLine(g: DeadGuard): string;
|
|
82
|
+
//# sourceMappingURL=dead-guards.d.ts.map
|