@intentius/chant 0.124.14 → 0.124.16
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/build.d.ts +6 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +1 -0
- package/dist/change-set.d.ts +24 -2
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +50 -1
- package/dist/ci-jobs.d.ts +227 -0
- package/dist/ci-jobs.d.ts.map +1 -0
- package/dist/ci-jobs.js +448 -0
- package/dist/cli/flush.d.ts +16 -0
- package/dist/cli/flush.d.ts.map +1 -0
- package/dist/cli/flush.js +42 -0
- package/dist/cli/handlers/approve.d.ts +98 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -0
- package/dist/cli/handlers/approve.js +495 -0
- package/dist/cli/handlers/operator.d.ts +1 -95
- package/dist/cli/handlers/operator.d.ts.map +1 -1
- package/dist/cli/handlers/operator.js +4 -488
- package/dist/cli/handlers/override-approve.js +1 -1
- package/dist/cli/main.d.ts +4 -15
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +4 -1062
- package/dist/cli/parse-args.d.ts +6 -0
- package/dist/cli/parse-args.d.ts.map +1 -0
- package/dist/cli/parse-args.js +1028 -0
- package/dist/components/fan-out-record.d.ts +1 -1
- package/dist/components/fan-out-record.d.ts.map +1 -1
- package/dist/components/fan-out-record.js +3 -7
- package/dist/components/fan-out-run.d.ts +5 -3
- package/dist/components/fan-out-run.d.ts.map +1 -1
- package/dist/components/fan-out-run.js +7 -5
- package/dist/components/pr-pipeline.d.ts.map +1 -1
- package/dist/components/pr-pipeline.js +3 -2
- package/dist/composite.d.ts +10 -2
- package/dist/composite.d.ts.map +1 -1
- package/dist/composite.js +8 -0
- package/dist/discovery/collect.d.ts +2 -1
- package/dist/discovery/collect.d.ts.map +1 -1
- package/dist/discovery/collect.js +16 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/discovery/fold-import.js +2 -107
- package/dist/discovery/host-composite.d.ts +35 -0
- package/dist/discovery/host-composite.d.ts.map +1 -0
- package/dist/discovery/host-composite.js +93 -0
- package/dist/discovery/index.d.ts +9 -0
- package/dist/discovery/index.d.ts.map +1 -1
- package/dist/discovery/index.js +1 -1
- package/dist/gate-decision.d.ts +20 -9
- package/dist/gate-decision.d.ts.map +1 -1
- package/dist/gate-decision.js +72 -19
- package/dist/gated-waves.d.ts +25 -6
- package/dist/gated-waves.d.ts.map +1 -1
- package/dist/gated-waves.js +21 -6
- package/dist/lifecycle/gate-audit.d.ts +69 -2
- package/dist/lifecycle/gate-audit.d.ts.map +1 -1
- package/dist/lifecycle/gate-audit.js +76 -2
- package/dist/lifecycle/gate-ledger.d.ts +24 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.js +9 -1
- package/dist/op/activities/activity-contracts.d.ts +5 -5
- package/dist/op/activities/activity-contracts.js +1 -1
- package/dist/op/activities/change-set.d.ts +8 -3
- package/dist/op/activities/change-set.d.ts.map +1 -1
- package/dist/op/activities/change-set.js +5 -2
- package/dist/op/activities/reconcile.d.ts +28 -16
- package/dist/op/activities/reconcile.d.ts.map +1 -1
- package/dist/op/activities/reconcile.js +34 -20
- package/dist/op/builders.d.ts +1 -1
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/builders.js +1 -1
- package/dist/op/op-waves-run.d.ts +2 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +8 -9
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +4 -8
- package/dist/package-version.d.ts +2 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +10 -0
- package/dist/wave-engine.d.ts +62 -0
- package/dist/wave-engine.d.ts.map +1 -0
- package/dist/wave-engine.js +59 -0
- package/dist/wave-layout.d.ts +29 -0
- package/dist/wave-layout.d.ts.map +1 -0
- package/dist/wave-layout.js +41 -0
- package/dist/wave-runtime.d.ts +29 -0
- package/dist/wave-runtime.d.ts.map +1 -0
- package/dist/wave-runtime.js +103 -0
- package/dist/wave-runtime.mjs +331 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts +7 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.js +17 -1
- package/dist/workspace/__fixtures__/sessions.d.ts +1 -1
- package/dist/workspace/__fixtures__/sessions.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/sessions.js +3 -3
- package/dist/workspace/ajv2020.d.ts +5 -0
- package/dist/workspace/ajv2020.d.ts.map +1 -0
- package/dist/workspace/ajv2020.js +14 -0
- package/dist/workspace/change-set.schema.json +5 -3
- package/dist/workspace/ci-green-workflow.d.ts +3 -1
- package/dist/workspace/ci-green-workflow.d.ts.map +1 -1
- package/dist/workspace/ci-green-workflow.js +5 -2
- package/dist/workspace/class-data.d.ts +84 -0
- package/dist/workspace/class-data.d.ts.map +1 -0
- package/dist/workspace/class-data.js +238 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.js +4 -8
- package/dist/workspace/kinds.d.ts +3 -7
- package/dist/workspace/kinds.d.ts.map +1 -1
- package/dist/workspace/kinds.js +8 -45
- package/dist/workspace/points.d.ts.map +1 -1
- package/dist/workspace/points.js +2 -5
- package/dist/workspace/principal-classes.d.ts +4 -11
- package/dist/workspace/principal-classes.d.ts.map +1 -1
- package/dist/workspace/principal-classes.js +13 -99
- package/package.json +5 -3
- package/src/build.ts +8 -0
- package/src/change-set.test.ts +48 -0
- package/src/change-set.ts +52 -2
- package/src/ci-jobs.test.ts +49 -0
- package/src/ci-jobs.ts +515 -0
- package/src/cli/flush.ts +44 -0
- package/src/cli/handlers/approve.ts +618 -0
- package/src/cli/handlers/operator.ts +10 -608
- package/src/cli/handlers/override-approve.test.ts +1 -1
- package/src/cli/handlers/override-approve.ts +1 -1
- package/src/cli/main.ts +5 -816
- package/src/cli/parse-args.ts +781 -0
- package/src/components/fan-out-record.ts +3 -7
- package/src/components/fan-out-run.ts +7 -5
- package/src/components/pr-pipeline.ts +3 -2
- package/src/composite.ts +15 -3
- package/src/discovery/collect.ts +15 -1
- package/src/discovery/fold-build-parity.test.ts +71 -0
- package/src/discovery/fold-import.ts +2 -113
- package/src/discovery/fold-project-provenance.test.ts +21 -4
- package/src/discovery/host-composite.ts +101 -0
- package/src/discovery/index.ts +11 -1
- package/src/gate-decision-bundle.test.ts +6 -4
- package/src/gate-decision-identity.test.ts +59 -6
- package/src/gate-decision.ts +81 -21
- package/src/gated-waves.ts +28 -6
- package/src/lifecycle/gate-audit.test.ts +55 -1
- package/src/lifecycle/gate-audit.ts +116 -3
- package/src/lifecycle/gate-ledger.test.ts +20 -1
- package/src/lifecycle/gate-ledger.ts +33 -1
- package/src/op/activities/activity-contracts.ts +1 -1
- package/src/op/activities/change-set.ts +11 -3
- package/src/op/activities/lexicon-upgrade.test.ts +2 -0
- package/src/op/activities/reconcile.test.ts +62 -2
- package/src/op/activities/reconcile.ts +46 -22
- package/src/op/builders.ts +1 -1
- package/src/op/op-waves-run.ts +9 -9
- package/src/op/op-waves.test.ts +2 -0
- package/src/op/op-waves.ts +4 -8
- package/src/op/work-lease-run.test.ts +12 -4
- package/src/package-version.ts +11 -0
- package/src/wave-engine.test.ts +107 -0
- package/src/wave-engine.ts +98 -0
- package/src/wave-layout.ts +44 -0
- package/src/wave-runtime-bundle.test.ts +70 -0
- package/src/wave-runtime.e2e.test.ts +177 -0
- package/src/wave-runtime.ts +104 -0
- package/src/workspace/__fixtures__/contract-repo.ts +17 -1
- package/src/workspace/__fixtures__/sessions.ts +3 -3
- package/src/workspace/ajv2020.ts +17 -0
- package/src/workspace/change-set.schema.json +5 -3
- package/src/workspace/ci-green-workflow.test.ts +4 -4
- package/src/workspace/ci-green-workflow.ts +5 -2
- package/src/workspace/class-data.test.ts +64 -0
- package/src/workspace/class-data.ts +236 -0
- package/src/workspace/declaration.ts +4 -10
- package/src/workspace/kinds.ts +8 -40
- package/src/workspace/points.ts +2 -5
- package/src/workspace/principal-classes.ts +13 -99
- package/src/workspace/records-formats.test.ts +7 -2
- package/src/workspace/records-sessions-write.test.ts +3 -3
- package/src/workspace/status-contract.e2e.test.ts +37 -0
- package/src/workspace/status-contract.test.ts +23 -21
package/dist/build.d.ts
CHANGED
|
@@ -117,6 +117,12 @@ export interface BuildOptions {
|
|
|
117
117
|
* `options.plugins.map(p => p.name)`.
|
|
118
118
|
*/
|
|
119
119
|
lexicons?: readonly string[];
|
|
120
|
+
/**
|
|
121
|
+
* chant#3612 — host package specifiers to follow a bare import into. Passed
|
|
122
|
+
* straight through to {@link DiscoveryOptions.lexiconPackages}; ignored
|
|
123
|
+
* unless {@link fold} is set. Never needed for a chant project.
|
|
124
|
+
*/
|
|
125
|
+
lexiconPackages?: readonly string[];
|
|
120
126
|
/**
|
|
121
127
|
* chant #1442 — lexicon name → the version of the plugin that served it.
|
|
122
128
|
* Recorded on {@link BuildResult.lexiconVersions} so a build digest can say
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAsB,MAAM,UAAU,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAyB,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACl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nB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACjC,YAAY,EAAE,aAAa,CAAC,oBAAoB,CAAC,EACjD,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,oBAAoB,CAAC,CAwB/B;AAED;;;;;;;GAOG;AACH,wBAAsB,KAAK,CACzB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,UAAU,EAAE,EACzB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,CAatB;AA8MD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,sBAAsB,EAC5B,WAAW,EAAE,UAAU,EAAE,EACzB,KAAK,SAAsB,EAC3B,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAC9B,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,WAAW,CAAC,CAgBtB"}
|
package/dist/build.js
CHANGED
|
@@ -448,6 +448,7 @@ export async function build(path, serializers, parentBuildStack, options) {
|
|
|
448
448
|
fold: options?.fold,
|
|
449
449
|
intrinsics: options?.intrinsics,
|
|
450
450
|
lexicons: options?.lexicons,
|
|
451
|
+
lexiconPackages: options?.lexiconPackages,
|
|
451
452
|
sandbox: options?.sandbox,
|
|
452
453
|
executing: options?.executing,
|
|
453
454
|
buildParams: options?.buildParams,
|
package/dist/change-set.d.ts
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
* Each planner reaches it through an adapter that returns a
|
|
12
12
|
* {@link ChangeSetPart}: one member and its entries. The lifecycle and
|
|
13
13
|
* reconcile adapters are here; the terraform-family ones live in the
|
|
14
|
-
* terraform lexicon's `change-set` subpath
|
|
14
|
+
* terraform lexicon's `change-set` subpath and the SQL ones in the sql
|
|
15
|
+
* lexicon's. A part another process wrote to a file reads back through
|
|
16
|
+
* {@link readChangeSetPartFile}. {@link composeChangeSet} joins
|
|
15
17
|
* the parts.
|
|
16
18
|
*
|
|
17
19
|
* ## The digest
|
|
@@ -52,7 +54,14 @@ export declare const CHANGE_SET_ACTIONS: readonly ChangeSetAction[];
|
|
|
52
54
|
/** How much applying one change hurts, in the vocabulary of `./lifecycle/disruption.ts`. */
|
|
53
55
|
export type ChangeSetDisruption = "in-place" | "rolling" | "replace" | "destroy" | "unknown";
|
|
54
56
|
/** Which tool produced a member's plan. */
|
|
55
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Which tool produced a member's plan. `sql` is a SQL schema change: a
|
|
59
|
+
* versioned plan (a product's migrations) or one of the sql lexicon's
|
|
60
|
+
* migration Ops' plans, through `@intentius/chant-lexicon-sql/change-set`.
|
|
61
|
+
*/
|
|
62
|
+
export type ChangeSetPlanner = "terraform" | "tofu" | "choudoufu" | "chant" | "warden" | "sql";
|
|
63
|
+
/** Every planner, in the order the schema lists them. */
|
|
64
|
+
export declare const CHANGE_SET_PLANNERS: readonly ChangeSetPlanner[];
|
|
56
65
|
/** One attribute a change writes, at top-level granularity. */
|
|
57
66
|
export interface ChangeSetAttribute {
|
|
58
67
|
path: string;
|
|
@@ -251,4 +260,17 @@ export interface ReconcilePlanPartInput {
|
|
|
251
260
|
* the managed counts, which are guardrail denominators rather than changes.
|
|
252
261
|
*/
|
|
253
262
|
export declare function reconcilePlanPart(input: ReconcilePlanPartInput): ChangeSetPart;
|
|
263
|
+
/**
|
|
264
|
+
* A part an adapter in another process wrote as JSON, read back as `member`'s
|
|
265
|
+
* part. The `sql` planner's plans arrive this way: the sql lexicon's
|
|
266
|
+
* `change-set` adapters, or a product that fills them, write the part, and
|
|
267
|
+
* `readChangeSetPart` with `planner: "sql"` reads it.
|
|
268
|
+
*
|
|
269
|
+
* The part must name `planner` on its member and on every entry, and say
|
|
270
|
+
* `status`, `planDigest` and `holes`. Its member and entries are renamed to
|
|
271
|
+
* `member`, so the file need not know the name the run gives it; a `lexicon`
|
|
272
|
+
* given here replaces the part's. Nothing is recomputed: the plan digest is
|
|
273
|
+
* the one the writer took, over a plan this process never sees.
|
|
274
|
+
*/
|
|
275
|
+
export declare function readChangeSetPartFile(part: unknown, planner: ChangeSetPlanner, member: string, lexicon?: string): ChangeSetPart;
|
|
254
276
|
//# sourceMappingURL=change-set.d.ts.map
|
package/dist/change-set.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"change-set.d.ts","sourceRoot":"","sources":["../src/change-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,KAAK,EAAE,SAAS,IAAI,kBAAkB,EAAoC,MAAM,wBAAwB,CAAC;AAChH,OAAO,KAAK,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEnE,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,sFAAsF,CAAC;AAExH,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,wHAAwH;AACxH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEvG,yDAAyD;AACzD,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAAyE,CAAC;AAEnI,4FAA4F;AAC5F,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7F,2CAA2C;AAC3C;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,MAAM,GAAG,WAAW,GAA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E,OAAO,EAAE,cAAc,EAAE,GAAG,gBAAgB,CAiC1G;AAMD,MAAM,WAAW,uBAAuB;IACtC,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,CAAC,aAAa,CAAC,EAAE,OAAO,GAAE,uBAA4B,GAAG,iBAAiB,CAwB9H;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC,GAAG,OAAO,CAM7H;AAID,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,IAAI,EAAE,kBAAkB,CAAC;IACzB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAYD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,aAAa,CAkD9E;AAID,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,IAAI,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;IAChD,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAMD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,aAAa,CAyC9E;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAsB/H"}
|
package/dist/change-set.js
CHANGED
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
* Each planner reaches it through an adapter that returns a
|
|
12
12
|
* {@link ChangeSetPart}: one member and its entries. The lifecycle and
|
|
13
13
|
* reconcile adapters are here; the terraform-family ones live in the
|
|
14
|
-
* terraform lexicon's `change-set` subpath
|
|
14
|
+
* terraform lexicon's `change-set` subpath and the SQL ones in the sql
|
|
15
|
+
* lexicon's. A part another process wrote to a file reads back through
|
|
16
|
+
* {@link readChangeSetPartFile}. {@link composeChangeSet} joins
|
|
15
17
|
* the parts.
|
|
16
18
|
*
|
|
17
19
|
* ## The digest
|
|
@@ -46,6 +48,8 @@ export const CHANGE_SET_SCHEMA_ID = "https://intentius.io/chant/schemas/workspac
|
|
|
46
48
|
export const CHANGE_SET_CONTRACT = 1;
|
|
47
49
|
/** Every action, in the order the summary lists them. */
|
|
48
50
|
export const CHANGE_SET_ACTIONS = ["create", "update", "replace", "delete", "read", "no-op", "forget"];
|
|
51
|
+
/** Every planner, in the order the schema lists them. */
|
|
52
|
+
export const CHANGE_SET_PLANNERS = ["terraform", "tofu", "choudoufu", "chant", "warden", "sql"];
|
|
49
53
|
const byString = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
50
54
|
function entryKey(e) {
|
|
51
55
|
return `${e.member}\u0000${e.address}\u0000${e.deposed ?? ""}\u0000${e.action}`;
|
|
@@ -310,3 +314,48 @@ export function reconcilePlanPart(input) {
|
|
|
310
314
|
entries,
|
|
311
315
|
};
|
|
312
316
|
}
|
|
317
|
+
// ── a part written to a file ───────────────────────────────────────────────────
|
|
318
|
+
const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
319
|
+
/**
|
|
320
|
+
* A part an adapter in another process wrote as JSON, read back as `member`'s
|
|
321
|
+
* part. The `sql` planner's plans arrive this way: the sql lexicon's
|
|
322
|
+
* `change-set` adapters, or a product that fills them, write the part, and
|
|
323
|
+
* `readChangeSetPart` with `planner: "sql"` reads it.
|
|
324
|
+
*
|
|
325
|
+
* The part must name `planner` on its member and on every entry, and say
|
|
326
|
+
* `status`, `planDigest` and `holes`. Its member and entries are renamed to
|
|
327
|
+
* `member`, so the file need not know the name the run gives it; a `lexicon`
|
|
328
|
+
* given here replaces the part's. Nothing is recomputed: the plan digest is
|
|
329
|
+
* the one the writer took, over a plan this process never sees.
|
|
330
|
+
*/
|
|
331
|
+
export function readChangeSetPartFile(part, planner, member, lexicon) {
|
|
332
|
+
const where = `the ${planner} part for ${member}`;
|
|
333
|
+
if (!isRecord(part) || !isRecord(part.member) || !Array.isArray(part.entries))
|
|
334
|
+
throw new Error(`${where} is not a change-set part: it needs member and entries`);
|
|
335
|
+
const m = part.member;
|
|
336
|
+
if (m.planner !== planner)
|
|
337
|
+
throw new Error(`${where} names planner ${String(m.planner)}, not ${planner}`);
|
|
338
|
+
if (m.status !== "planned" && m.status !== "failed")
|
|
339
|
+
throw new Error(`${where} has no status`);
|
|
340
|
+
if (m.planDigest !== null && typeof m.planDigest !== "string")
|
|
341
|
+
throw new Error(`${where} has no planDigest`);
|
|
342
|
+
if (m.status === "planned" && m.planDigest === null)
|
|
343
|
+
throw new Error(`${where} planned but has no planDigest`);
|
|
344
|
+
if (!Array.isArray(m.holes))
|
|
345
|
+
throw new Error(`${where} has no holes array`);
|
|
346
|
+
const entries = part.entries.map((e, i) => {
|
|
347
|
+
if (!isRecord(e) || typeof e.address !== "string" || typeof e.type !== "string" || typeof e.action !== "string" || !Array.isArray(e.attributes)) {
|
|
348
|
+
throw new Error(`${where}: entries[${i}] needs address, type, action and attributes`);
|
|
349
|
+
}
|
|
350
|
+
if (!CHANGE_SET_ACTIONS.includes(e.action))
|
|
351
|
+
throw new Error(`${where}: entries[${i}] has action ${e.action}`);
|
|
352
|
+
if (e.planner !== planner)
|
|
353
|
+
throw new Error(`${where}: entries[${i}] names planner ${String(e.planner)}, not ${planner}`);
|
|
354
|
+
return { ...e, member, ...(lexicon !== undefined ? { lexicon } : {}) };
|
|
355
|
+
});
|
|
356
|
+
return {
|
|
357
|
+
member: { ...m, member, ...(lexicon !== undefined ? { lexicon } : {}) },
|
|
358
|
+
entries,
|
|
359
|
+
...(Array.isArray(part.sideEffects) ? { sideEffects: part.sideEffects } : {}),
|
|
360
|
+
};
|
|
361
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The job primitives chant's three CI generators share (#3765): the scheduled
|
|
3
|
+
* Op pipeline (`generateOpsPipeline`), the Op waves pipeline
|
|
4
|
+
* (`generateOpWavesPipeline`) and the component pipeline (`chant build
|
|
5
|
+
* --components --generate`, with `--pr-loop`, `--wave-gate` and
|
|
6
|
+
* `--promote-to`). Each forge lexicon builds its documents from these, so a
|
|
7
|
+
* trigger, a token, a permission rule or an image default is decided once:
|
|
8
|
+
*
|
|
9
|
+
* - the image a generated job runs in, {@link CI_IMAGE};
|
|
10
|
+
* - the branches a trigger filters on, {@link triggerBranches};
|
|
11
|
+
* - the job token and secret expressions of GitHub Actions and Forgejo
|
|
12
|
+
* Actions, {@link GITHUB_JOB_TOKEN} and {@link githubSecret};
|
|
13
|
+
* - the `permissions:` a finding-mode needs and the rules for adding to it,
|
|
14
|
+
* {@link permissionsFor} and {@link mergePermissions};
|
|
15
|
+
* - the `setup` steps and `environment` a job may carry, checked once per
|
|
16
|
+
* forge ({@link assertSetupSteps}, {@link assertEnvironment},
|
|
17
|
+
* {@link gitlabSetupScript}, {@link assertGitlabEnvironment});
|
|
18
|
+
* - GitLab's `rules:` expressions and `id_tokens:` declaration.
|
|
19
|
+
*
|
|
20
|
+
* The Forgejo dialect (action refs, dropped `permissions:` and
|
|
21
|
+
* `environment:`, the header note naming what was dropped) is the forgejo
|
|
22
|
+
* lexicon's, in its `components/ci-jobs.ts`, since the transform it applies
|
|
23
|
+
* lives there.
|
|
24
|
+
*/
|
|
25
|
+
import type { OpEnvironment, OpFindingMode, OpSetupStep, OpTrigger } from "./lexicon.js";
|
|
26
|
+
/**
|
|
27
|
+
* The image every generated job runs in unless the caller names another. It
|
|
28
|
+
* carries node and npm, which `chant` needs, and git, which a job that reads
|
|
29
|
+
* the base commit or pushes to `chant/lifecycle` needs (#3789).
|
|
30
|
+
*/
|
|
31
|
+
export declare const CI_IMAGE = "node:22";
|
|
32
|
+
/**
|
|
33
|
+
* The branch a `push` trigger filters on when it names none. A generator
|
|
34
|
+
* works from a spec, not a checkout, so it cannot read a project's real
|
|
35
|
+
* default branch; a project on another one names it.
|
|
36
|
+
*/
|
|
37
|
+
export declare const DEFAULT_BRANCH = "main";
|
|
38
|
+
/**
|
|
39
|
+
* The branches a push trigger filters on: the ones given, or
|
|
40
|
+
* {@link DEFAULT_BRANCH} when none are. An empty list is none, on every
|
|
41
|
+
* forge.
|
|
42
|
+
*/
|
|
43
|
+
export declare function pushBranches(branches: readonly string[] | undefined): string[];
|
|
44
|
+
/**
|
|
45
|
+
* The branches a trigger filters on: a `pull_request` trigger's list, or
|
|
46
|
+
* undefined for every branch; a `push` trigger's, with {@link pushBranches}'
|
|
47
|
+
* default; none for `cron`.
|
|
48
|
+
*/
|
|
49
|
+
export declare function triggerBranches(trigger: OpTrigger): string[] | undefined;
|
|
50
|
+
/** A job id every forge accepts, from a kebab- or camel-cased name. */
|
|
51
|
+
export declare function ciJobName(name: string): string;
|
|
52
|
+
/** A command template with each `{name}` part filled in. */
|
|
53
|
+
export declare function fillCommand(template: readonly string[], name: string): string[];
|
|
54
|
+
/** `{ [key]: map }` when the map has an entry, else `{}`: for spreading an optional mapping into a document. */
|
|
55
|
+
export declare function nonEmpty<K extends string, V>(key: K, map: Record<string, V> | undefined): {
|
|
56
|
+
[P in K]?: Record<string, V>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A job's `environment:` mapping. Always the mapping form, never the string
|
|
60
|
+
* shorthand, so adding a `url` later is a new key rather than a reshaped
|
|
61
|
+
* value. GitHub and GitLab read the same two keys.
|
|
62
|
+
*/
|
|
63
|
+
export declare function environmentDoc(environment: OpEnvironment): {
|
|
64
|
+
name: string;
|
|
65
|
+
url?: string;
|
|
66
|
+
};
|
|
67
|
+
/** The directory part of a relative path, `.` when there is none. */
|
|
68
|
+
export declare function dirnameOf(path: string): string;
|
|
69
|
+
/** The runner label a generated job asks for; the Forgejo dialect rewrites it to the project's label. */
|
|
70
|
+
export declare const GITHUB_RUNNER = "ubuntu-latest";
|
|
71
|
+
/** The job token, which GitHub and Forgejo both mint for every run. */
|
|
72
|
+
export declare const GITHUB_JOB_TOKEN = "${{ github.token }}";
|
|
73
|
+
/** A repository secret, by name. */
|
|
74
|
+
export declare function githubSecret(name: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* A repository secret, or the job token when the secret is unset (#3624). An
|
|
77
|
+
* unset secret reads as the empty string, so a workflow generated for a
|
|
78
|
+
* production token still runs in a fork or a fresh repository, with what the
|
|
79
|
+
* job token may do.
|
|
80
|
+
*/
|
|
81
|
+
export declare function githubSecretOrJobToken(name: string): string;
|
|
82
|
+
/** Each name mapped from the repository secret of the same name. */
|
|
83
|
+
export declare function githubSecretEnv(names: readonly string[]): Record<string, string>;
|
|
84
|
+
/**
|
|
85
|
+
* Least-privilege `permissions:` for a finding-mode. `report` needs no write
|
|
86
|
+
* access; `issue` needs only `issues: write`; `pull-request` (and
|
|
87
|
+
* `merge-request`, generated the same way when a GitLab-authored spec is
|
|
88
|
+
* targeted at github) needs `contents: write` to push the reconcile branch
|
|
89
|
+
* plus `pull-requests: write` to open the PR. `comment` changes nothing in
|
|
90
|
+
* the repository, so its whole scope is `{ contents: read, pull-requests:
|
|
91
|
+
* write }`.
|
|
92
|
+
*/
|
|
93
|
+
export declare function permissionsForMode(mode: OpFindingMode): Record<string, "read" | "write">;
|
|
94
|
+
/**
|
|
95
|
+
* {@link permissionsForMode} on a trigger. A `pull_request` trigger reports
|
|
96
|
+
* its finding as a comment on the triggering PR itself (#2084): any mode but
|
|
97
|
+
* `report` posts something to act on a finding, so on that trigger every
|
|
98
|
+
* such mode also gets `pull-requests: write` for the comment.
|
|
99
|
+
*/
|
|
100
|
+
export declare function permissionsFor(mode: OpFindingMode, trigger: OpTrigger): Record<string, "read" | "write">;
|
|
101
|
+
/**
|
|
102
|
+
* Every scope `GITHUB_TOKEN` accepts in a workflow's `permissions:` mapping,
|
|
103
|
+
* kebab-cased as GitHub spells them. An additive scope outside this set is
|
|
104
|
+
* refused by name rather than emitted: GitHub ignores an unknown key, so
|
|
105
|
+
* `id_token` or `idToken` would generate a workflow that looks like it grants
|
|
106
|
+
* OIDC and hands the run no token at all.
|
|
107
|
+
*/
|
|
108
|
+
export declare const GITHUB_TOKEN_SCOPES: ReadonlySet<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Merge a spec's additive `permissions` over the finding-mode's own set
|
|
111
|
+
* (#2242), refusing by name anything that is not strictly additive:
|
|
112
|
+
*
|
|
113
|
+
* - a blanket `write-all`/`read-all`, in either the key or the value
|
|
114
|
+
* position, which is the exact thing {@link permissionsForMode} exists to
|
|
115
|
+
* avoid;
|
|
116
|
+
* - a scope GitHub does not define ({@link GITHUB_TOKEN_SCOPES}), because
|
|
117
|
+
* GitHub ignores the key and the run silently gets nothing;
|
|
118
|
+
* - a scope the mode already grants, at any value — additive means additive,
|
|
119
|
+
* so this can neither downgrade `contents: write` to read nor restate it.
|
|
120
|
+
* A mode whose set is wrong is fixed by changing the mode, where the
|
|
121
|
+
* scope and the behavior that spends it stay together;
|
|
122
|
+
* - `pull-requests: write` on a trigger with no pull request. Pull-request
|
|
123
|
+
* access is what the finding-modes own: `pull-request` grants it together
|
|
124
|
+
* with the `contents: write` needed to push the branch first, and
|
|
125
|
+
* `comment` grants it on the one trigger that carries a pull request to
|
|
126
|
+
* comment on. Adding it beside a mode that posts nothing, on a cron or
|
|
127
|
+
* push run, grants write access no step in the generated job can spend.
|
|
128
|
+
*/
|
|
129
|
+
export declare function mergePermissions(name: string, base: Record<string, "read" | "write">, additive: Record<string, "read" | "write">, trigger: OpTrigger): Record<string, "read" | "write">;
|
|
130
|
+
/**
|
|
131
|
+
* Validate a `setup` list for GitHub or Forgejo Actions (#2242). A `run`
|
|
132
|
+
* entry needs a non-empty line and nothing else. A `uses` entry has to be a
|
|
133
|
+
* pinned `owner/repo[/subpath]@ref`: no bare `owner/repo`, since an unpinned
|
|
134
|
+
* action resolves to its default branch, and no ref in
|
|
135
|
+
* {@link DEFAULT_BRANCH_REFS} for the same reason spelled out loud. Local
|
|
136
|
+
* (`./path`) and container (`docker://`) refs are refused too — they are
|
|
137
|
+
* legal GitHub Actions, but the generator emits a workflow into a repository
|
|
138
|
+
* it has never seen, so it cannot know a local path resolves there.
|
|
139
|
+
*/
|
|
140
|
+
export declare function assertSetupSteps(name: string, setup: OpSetupStep[]): void;
|
|
141
|
+
/** One setup entry as a GitHub Actions step: `with:` and `env:` only when they hold something. */
|
|
142
|
+
export declare function setupStepDoc(step: OpSetupStep): Record<string, unknown>;
|
|
143
|
+
/**
|
|
144
|
+
* Validate an `environment` for GitHub Actions (#2257). GitHub creates an
|
|
145
|
+
* environment it has never seen on first use rather than failing the run,
|
|
146
|
+
* and an environment created that way carries no protection rules at all —
|
|
147
|
+
* so a job can name one and read as gated while being gated by nothing.
|
|
148
|
+
* Neither the generator nor GitHub can tell those apart at build time, which
|
|
149
|
+
* is why what is refused here is only the shape that could never bind: a
|
|
150
|
+
* name that is blank, and a `url` that is neither absolute nor an expression
|
|
151
|
+
* the forge resolves.
|
|
152
|
+
*/
|
|
153
|
+
export declare function assertEnvironment(name: string, environment: OpEnvironment): void;
|
|
154
|
+
/** The pipeline source GitLab reports for a merge-request pipeline. */
|
|
155
|
+
export declare const GITLAB_MERGE_REQUEST_SOURCE = "$CI_PIPELINE_SOURCE == \"merge_request_event\"";
|
|
156
|
+
/** The pipeline source GitLab reports for a pipeline schedule. */
|
|
157
|
+
export declare const GITLAB_SCHEDULE_SOURCE = "$CI_PIPELINE_SOURCE == \"schedule\"";
|
|
158
|
+
/** A job variable that makes the runner clone the whole history, which a job reading the base commit needs. */
|
|
159
|
+
export declare const GITLAB_FULL_HISTORY: {
|
|
160
|
+
readonly GIT_DEPTH: "0";
|
|
161
|
+
};
|
|
162
|
+
/** The `rules:` if-expression for a push to `branch`, a quoted name or an expression such as `$CI_DEFAULT_BRANCH`. */
|
|
163
|
+
export declare function gitlabPushRule(branch: string): string;
|
|
164
|
+
/**
|
|
165
|
+
* Refuse a branch name that cannot be interpolated into a `rules:`
|
|
166
|
+
* if-expression. The expression is a string GitLab parses, so a `"` would end
|
|
167
|
+
* it early and a `$` would expand as a variable — either one silently changes
|
|
168
|
+
* which pipelines match the job, which is worse than not generating it.
|
|
169
|
+
* `subject` names what filters, such as `Scheduled Op "apply"`.
|
|
170
|
+
*/
|
|
171
|
+
export declare function assertGitlabBranch(subject: string, branch: string): void;
|
|
172
|
+
/**
|
|
173
|
+
* One `rules:` entry per branch a trigger filters on, each checked by
|
|
174
|
+
* {@link assertGitlabBranch}. Two or more branches are two or more entries:
|
|
175
|
+
* `rules:` is an OR over its list, which is how GitLab spells the alternation
|
|
176
|
+
* github expresses as a `branches:` array. A cron trigger is selected by
|
|
177
|
+
* `selector`, the CI/CD variable a pipeline schedule sets, and the Op's name.
|
|
178
|
+
*/
|
|
179
|
+
export declare function gitlabRules(subject: string, trigger: OpTrigger, selector: {
|
|
180
|
+
variable: string;
|
|
181
|
+
value: string;
|
|
182
|
+
}): Array<{
|
|
183
|
+
if: string;
|
|
184
|
+
}>;
|
|
185
|
+
/**
|
|
186
|
+
* The `id_tokens:` entry an `id-token: write` spec gets. The name is the
|
|
187
|
+
* environment variable the JWT lands in, which the job's own setup line reads
|
|
188
|
+
* (`aws sts assume-role-with-web-identity --web-identity-token
|
|
189
|
+
* "$CHANT_ID_TOKEN"`, or the provider's equivalent).
|
|
190
|
+
*
|
|
191
|
+
* `$CI_SERVER_URL` as the audience is GitLab's own documented default: an
|
|
192
|
+
* identity provider federated to a GitLab instance is registered with that
|
|
193
|
+
* instance's URL as its audience, and the variable expands to exactly that on
|
|
194
|
+
* gitlab.com and on a self-managed instance alike.
|
|
195
|
+
*/
|
|
196
|
+
export declare const GITLAB_ID_TOKEN_NAME = "CHANT_ID_TOKEN";
|
|
197
|
+
export declare const GITLAB_ID_TOKEN_AUDIENCE = "$CI_SERVER_URL";
|
|
198
|
+
/**
|
|
199
|
+
* Turn additive `permissions` (#2242) into the one GitLab declaration that
|
|
200
|
+
* carries the same meaning, refusing everything else by name.
|
|
201
|
+
*
|
|
202
|
+
* `id-token: write` is that one: GitLab's OIDC surface is `id_tokens:`, a
|
|
203
|
+
* per-job declaration of a JWT the job exchanges for cloud credentials
|
|
204
|
+
* itself. `id-token: read` is refused rather than mapped, because GitLab
|
|
205
|
+
* either mints the token into the job or does not. Every other scope is
|
|
206
|
+
* refused: GitLab has no per-job token-scope mapping at all, and a scope
|
|
207
|
+
* quietly dropped would emit a job that reads as granted and runs with
|
|
208
|
+
* nothing.
|
|
209
|
+
*/
|
|
210
|
+
export declare function gitlabIdTokens(name: string, permissions: Record<string, "read" | "write"> | undefined): Record<string, unknown> | undefined;
|
|
211
|
+
/**
|
|
212
|
+
* A `setup` list as GitLab `script:` lines. A `uses` entry is a GitHub
|
|
213
|
+
* Actions marketplace action, which GitLab has no shape for, so it is refused
|
|
214
|
+
* by name rather than dropped. `subject` names whose setup it is, such as
|
|
215
|
+
* `Scheduled Op "apply"`.
|
|
216
|
+
*/
|
|
217
|
+
export declare function gitlabSetupScript(subject: string, setup: readonly OpSetupStep[] | undefined): string[];
|
|
218
|
+
/**
|
|
219
|
+
* Validate an `environment` on GitLab's own terms (#2257). A GitLab job
|
|
220
|
+
* naming an environment that does not exist creates an unprotected one on
|
|
221
|
+
* first deploy rather than failing, so the only shapes worth refusing at
|
|
222
|
+
* build time are the ones that could never bind: a blank name, and a `url`
|
|
223
|
+
* that is neither absolute nor a variable expression GitLab expands, which
|
|
224
|
+
* would render as a dead "View deployment" link.
|
|
225
|
+
*/
|
|
226
|
+
export declare function assertGitlabEnvironment(name: string, environment: OpEnvironment): void;
|
|
227
|
+
//# sourceMappingURL=ci-jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-jobs.d.ts","sourceRoot":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