@intentius/chant 0.124.23 → 0.124.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ci-jobs.d.ts +41 -1
- package/dist/ci-jobs.d.ts.map +1 -1
- package/dist/ci-jobs.js +48 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +14 -0
- package/dist/cli/handlers/approve.d.ts.map +1 -1
- package/dist/cli/handlers/approve.js +9 -0
- package/dist/cli/handlers/emulator.d.ts +13 -2
- package/dist/cli/handlers/emulator.d.ts.map +1 -1
- package/dist/cli/handlers/emulator.js +63 -3
- package/dist/cli/handlers/promote.d.ts.map +1 -1
- package/dist/cli/handlers/promote.js +7 -1
- package/dist/cli/handlers/run-wave.d.ts.map +1 -1
- package/dist/cli/handlers/run-wave.js +5 -4
- package/dist/cli/handlers/run.d.ts +4 -3
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/run.js +73 -9
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +17 -4
- package/dist/cli/parse-args.d.ts.map +1 -1
- package/dist/cli/parse-args.js +31 -0
- package/dist/cli/registry.d.ts +12 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +45 -6
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/cli-support.js +97 -22
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/driver.js +25 -10
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/graph-detail.js +24 -2
- package/dist/lifecycle/git.d.ts +11 -0
- package/dist/lifecycle/git.d.ts.map +1 -1
- package/dist/lifecycle/git.js +62 -6
- package/dist/lifecycle/no-record.d.ts +59 -0
- package/dist/lifecycle/no-record.d.ts.map +1 -0
- package/dist/lifecycle/no-record.js +88 -0
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/activities/shell.js +30 -9
- package/dist/op/emulator-lifecycle.d.ts +23 -0
- package/dist/op/emulator-lifecycle.d.ts.map +1 -1
- package/dist/op/emulator-lifecycle.js +39 -2
- package/dist/op/gate.d.ts.map +1 -1
- package/dist/op/gate.js +3 -0
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/index.js +1 -1
- package/dist/op/local-executor.d.ts +10 -0
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/local-executor.js +7 -2
- package/dist/op/op-waves-notify.d.ts +2 -0
- package/dist/op/op-waves-notify.d.ts.map +1 -1
- package/dist/op/op-waves-notify.js +9 -3
- package/dist/op/op-waves-run.d.ts +8 -2
- package/dist/op/op-waves-run.d.ts.map +1 -1
- package/dist/op/op-waves-run.js +36 -11
- package/dist/op/op-waves.d.ts +85 -1
- package/dist/op/op-waves.d.ts.map +1 -1
- package/dist/op/op-waves.js +153 -1
- package/dist/op/runtimes/local.d.ts.map +1 -1
- package/dist/op/runtimes/local.js +6 -0
- package/dist/op/step-console.d.ts +65 -0
- package/dist/op/step-console.d.ts.map +1 -0
- package/dist/op/step-console.js +140 -0
- package/dist/point-decision.d.ts.map +1 -1
- package/dist/point-decision.js +3 -0
- package/dist/wave-runtime.mjs +238 -238
- package/dist/workspace/compose-graph.d.ts +22 -3
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/compose-graph.js +18 -5
- package/dist/workspace/graph.schema.json +68 -1
- package/dist/workspace/nested-graph.d.ts +1 -1
- package/dist/workspace/nested-graph.d.ts.map +1 -1
- package/dist/workspace/nested-graph.js +5 -1
- package/dist/workspace/runs.d.ts.map +1 -1
- package/dist/workspace/runs.js +4 -2
- package/package.json +1 -1
- package/src/ci-jobs.ts +58 -1
- package/src/cli/commands/build.ts +18 -0
- package/src/cli/handlers/approve.ts +9 -0
- package/src/cli/handlers/emulator.test.ts +61 -1
- package/src/cli/handlers/emulator.ts +65 -4
- package/src/cli/handlers/promote.test.ts +7 -0
- package/src/cli/handlers/promote.ts +7 -1
- package/src/cli/handlers/run-no-record.e2e.test.ts +87 -0
- package/src/cli/handlers/run-wave.ts +5 -4
- package/src/cli/handlers/run.test.ts +126 -0
- package/src/cli/handlers/run.ts +69 -9
- package/src/cli/main.test.ts +24 -0
- package/src/cli/main.ts +17 -4
- package/src/cli/parse-args.ts +21 -0
- package/src/cli/registry.ts +12 -0
- package/src/components/cli-support.test.ts +75 -0
- package/src/components/cli-support.ts +130 -25
- package/src/components/driver.test.ts +28 -0
- package/src/components/driver.ts +23 -10
- package/src/components/generate-disabled.test.ts +56 -0
- package/src/graph-ci-edges.test.ts +50 -0
- package/src/graph-detail.ts +21 -2
- package/src/lifecycle/git.ts +61 -6
- package/src/lifecycle/no-record.test.ts +175 -0
- package/src/lifecycle/no-record.ts +108 -0
- package/src/op/activities/shell.ts +28 -6
- package/src/op/emulator-lifecycle.test.ts +24 -1
- package/src/op/emulator-lifecycle.ts +58 -2
- package/src/op/gate.ts +3 -0
- package/src/op/index.ts +1 -1
- package/src/op/local-executor.ts +20 -3
- package/src/op/op-waves-jobs.test.ts +213 -0
- package/src/op/op-waves-notify.ts +11 -5
- package/src/op/op-waves-run.ts +42 -11
- package/src/op/op-waves.ts +202 -2
- package/src/op/runtimes/local.ts +6 -0
- package/src/op/step-console.test.ts +150 -0
- package/src/op/step-console.ts +155 -0
- package/src/point-decision-bundle.test.ts +1 -0
- package/src/point-decision.ts +3 -0
- package/src/workspace/compose-graph.test.ts +55 -0
- package/src/workspace/compose-graph.ts +28 -6
- package/src/workspace/graph-contract.test.ts +26 -1
- package/src/workspace/graph.schema.json +68 -1
- package/src/workspace/nested-graph.test.ts +14 -0
- package/src/workspace/nested-graph.ts +7 -2
- package/src/workspace/runs.ts +4 -2
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
* `runtimeOwner` and export and import nodes are rewritten the same way.
|
|
12
12
|
* - `groups.byMember` maps each member to its node ids. `byLexicon` and
|
|
13
13
|
* `byComposite` keep their keys (a lexicon or composite type is the same
|
|
14
|
-
* thing in every member) and merge the ids. `byStack`, `byContainer
|
|
15
|
-
* `byWave` name things inside one member, so their keys
|
|
14
|
+
* thing in every member) and merge the ids. `byStack`, `byContainer`,
|
|
15
|
+
* `byWave` and `byPipeline` name things inside one member, so their keys
|
|
16
|
+
* are prefixed too.
|
|
17
|
+
* - Edges keep their `kind` and `crossPipeline` (#3910). A member's dangling
|
|
18
|
+
* references (`ir.dangling`) land on the top-level `dangling` list with
|
|
19
|
+
* `from` prefixed and a `member` field, like edges (#3922).
|
|
16
20
|
* - `links` holds the member links (#2524 D6, #2539): the declared links and
|
|
17
21
|
* the joins inferred from members' `imports` and `exports` with the core
|
|
18
22
|
* `joinKey()`, labelled `exact` or `folded` (`./links.ts`). A declared link
|
|
@@ -34,7 +38,7 @@ import type { KindRegistry } from "./kinds.js";
|
|
|
34
38
|
import { type LinkTableRow } from "./links.js";
|
|
35
39
|
import type { KindLinkRead } from "./kind-link-readers.js";
|
|
36
40
|
import type { RecordLinkRow } from "./record-assets.js";
|
|
37
|
-
import { type GraphIR, type IRExport, type IRGroups, type IRImport, type IREdge, type IRNode } from "../graph-ir.js";
|
|
41
|
+
import { type GraphIR, type IRExport, type IRDanglingRef, type IRGroups, type IRImport, type IREdge, type IRNode } from "../graph-ir.js";
|
|
38
42
|
/** The version of the composed document `chant workspace graph` writes. */
|
|
39
43
|
export declare const WORKSPACE_GRAPH_VERSION = 1;
|
|
40
44
|
/**
|
|
@@ -145,6 +149,11 @@ export type ComposedNode = IRNode & {
|
|
|
145
149
|
export type ComposedEdge = IREdge & {
|
|
146
150
|
member: string;
|
|
147
151
|
};
|
|
152
|
+
/** A member's dangling reference (#3910, #3922): `from` is prefixed like a node id. `nested` as on {@link ComposedNode}. */
|
|
153
|
+
export type ComposedDangling = IRDanglingRef & {
|
|
154
|
+
member: string;
|
|
155
|
+
nested?: string;
|
|
156
|
+
};
|
|
148
157
|
export interface WorkspaceGraph {
|
|
149
158
|
version: number;
|
|
150
159
|
workspace: {
|
|
@@ -164,6 +173,12 @@ export interface WorkspaceGraph {
|
|
|
164
173
|
member: string;
|
|
165
174
|
})[];
|
|
166
175
|
derivedAttrs?: Record<string, string[]>;
|
|
176
|
+
/**
|
|
177
|
+
* The members' dangling CI references (#3910, #3922): each `ir.dangling`
|
|
178
|
+
* entry with `from` prefixed by its member and a `member` field, sorted by
|
|
179
|
+
* `from`, `path` and `value`. Absent when no member has one.
|
|
180
|
+
*/
|
|
181
|
+
dangling?: ComposedDangling[];
|
|
167
182
|
/**
|
|
168
183
|
* Member links (#2524 D6, #2539), declared and inferred, then the links of
|
|
169
184
|
* the records read with `--kind` (#2549). Empty when no declaration is given.
|
|
@@ -202,6 +217,10 @@ export interface ComposeInput {
|
|
|
202
217
|
/** Present for a member whose IR was read. */
|
|
203
218
|
ir?: GraphIR;
|
|
204
219
|
}
|
|
220
|
+
/** The groups whose keys name something inside one member, so are prefixed with it. */
|
|
221
|
+
export declare const SCOPED_GROUPS: readonly ["byStack", "byContainer", "byWave", "byPipeline"];
|
|
222
|
+
/** The order the composed `dangling` list is sorted in. */
|
|
223
|
+
export declare const danglingKey: (d: IRDanglingRef) => string;
|
|
205
224
|
/**
|
|
206
225
|
* Compose the members' IRs into the workspace document. Members keep the
|
|
207
226
|
* order they are given in. With `links`, the `links` section is filled from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-graph.d.ts","sourceRoot":"","sources":["../../src/workspace/compose-graph.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"compose-graph.d.ts","sourceRoot":"","sources":["../../src/workspace/compose-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO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,CAAC,EAAE,YAAY,CAAC;IAAC,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAAE,GACnG,cAAc,CA0EhB"}
|
|
@@ -11,8 +11,12 @@
|
|
|
11
11
|
* `runtimeOwner` and export and import nodes are rewritten the same way.
|
|
12
12
|
* - `groups.byMember` maps each member to its node ids. `byLexicon` and
|
|
13
13
|
* `byComposite` keep their keys (a lexicon or composite type is the same
|
|
14
|
-
* thing in every member) and merge the ids. `byStack`, `byContainer
|
|
15
|
-
* `byWave` name things inside one member, so their keys
|
|
14
|
+
* thing in every member) and merge the ids. `byStack`, `byContainer`,
|
|
15
|
+
* `byWave` and `byPipeline` name things inside one member, so their keys
|
|
16
|
+
* are prefixed too.
|
|
17
|
+
* - Edges keep their `kind` and `crossPipeline` (#3910). A member's dangling
|
|
18
|
+
* references (`ir.dangling`) land on the top-level `dangling` list with
|
|
19
|
+
* `from` prefixed and a `member` field, like edges (#3922).
|
|
16
20
|
* - `links` holds the member links (#2524 D6, #2539): the declared links and
|
|
17
21
|
* the joins inferred from members' `imports` and `exports` with the core
|
|
18
22
|
* `joinKey()`, labelled `exact` or `folded` (`./links.ts`). A declared link
|
|
@@ -132,6 +136,10 @@ function prefixRefs(value, member) {
|
|
|
132
136
|
}
|
|
133
137
|
return out;
|
|
134
138
|
}
|
|
139
|
+
/** The groups whose keys name something inside one member, so are prefixed with it. */
|
|
140
|
+
export const SCOPED_GROUPS = ["byStack", "byContainer", "byWave", "byPipeline"];
|
|
141
|
+
/** The order the composed `dangling` list is sorted in. */
|
|
142
|
+
export const danglingKey = (d) => `${d.from}\u0000${d.path}\u0000${d.value}`;
|
|
135
143
|
function mergeInto(target, key, ids) {
|
|
136
144
|
(target[key] ?? (target[key] = [])).push(...ids);
|
|
137
145
|
}
|
|
@@ -155,7 +163,8 @@ export function composeWorkspaceGraph(workspace, inputs, links) {
|
|
|
155
163
|
const imports = [];
|
|
156
164
|
const byMember = {};
|
|
157
165
|
const shared = { byLexicon: {}, byComposite: {} };
|
|
158
|
-
const scoped = { byStack: {}, byContainer: {}, byWave: {} };
|
|
166
|
+
const scoped = { byStack: {}, byContainer: {}, byWave: {}, byPipeline: {} };
|
|
167
|
+
const dangling = [];
|
|
159
168
|
const derivedAttrs = {};
|
|
160
169
|
const collectors = [];
|
|
161
170
|
for (const { member, ir } of inputs) {
|
|
@@ -179,10 +188,12 @@ export function composeWorkspaceGraph(workspace, inputs, links) {
|
|
|
179
188
|
for (const [k, v] of Object.entries(ir.groups[key] ?? {}))
|
|
180
189
|
mergeInto(shared[key], k, v.map((id) => prefix(m, id)));
|
|
181
190
|
}
|
|
182
|
-
for (const key of
|
|
191
|
+
for (const key of SCOPED_GROUPS) {
|
|
183
192
|
for (const [k, v] of Object.entries(ir.groups[key] ?? {}))
|
|
184
193
|
mergeInto(scoped[key], prefix(m, k), v.map((id) => prefix(m, id)));
|
|
185
194
|
}
|
|
195
|
+
for (const d of ir.dangling ?? [])
|
|
196
|
+
dangling.push({ ...d, from: prefix(m, d.from), member: m });
|
|
186
197
|
for (const e of ir.exports ?? [])
|
|
187
198
|
exports.push({ ...e, ...(e.node ? { node: prefix(m, e.node) } : {}), member: m });
|
|
188
199
|
for (const i of ir.imports ?? [])
|
|
@@ -211,7 +222,7 @@ export function composeWorkspaceGraph(workspace, inputs, links) {
|
|
|
211
222
|
for (const key of ["byLexicon", "byComposite"])
|
|
212
223
|
if (Object.keys(shared[key]).length)
|
|
213
224
|
groups[key] = sorted(shared[key]);
|
|
214
|
-
for (const key of
|
|
225
|
+
for (const key of SCOPED_GROUPS)
|
|
215
226
|
if (Object.keys(scoped[key]).length)
|
|
216
227
|
groups[key] = sorted(scoped[key]);
|
|
217
228
|
const doc = {
|
|
@@ -229,6 +240,8 @@ export function composeWorkspaceGraph(workspace, inputs, links) {
|
|
|
229
240
|
collectors,
|
|
230
241
|
records: [],
|
|
231
242
|
};
|
|
243
|
+
if (dangling.length)
|
|
244
|
+
doc.dangling = dangling.sort((a, b) => danglingKey(a).localeCompare(danglingKey(b)));
|
|
232
245
|
if (Object.keys(derivedAttrs).length) {
|
|
233
246
|
doc.derivedAttrs = Object.fromEntries(Object.keys(derivedAttrs).sort().map((k) => [k, [...derivedAttrs[k]].sort()]));
|
|
234
247
|
}
|
|
@@ -93,6 +93,13 @@
|
|
|
93
93
|
"$ref": "#/$defs/edge"
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
+
"dangling": {
|
|
97
|
+
"description": "Added in contract 1 by #3922. The members' references whose target is no node of their graph (#3910): a job `needs` a job no workflow declares, a `uses:` names another repository's workflow, a GitLab `include:` names a file chant did not generate. Each member's `ir.dangling` entry with `from` prefixed by its member and a `member` field, sorted by `from`, `path` and `value`. Absent when no member has one.",
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": {
|
|
100
|
+
"$ref": "#/$defs/dangling"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
96
103
|
"groups": {
|
|
97
104
|
"type": "object",
|
|
98
105
|
"required": [
|
|
@@ -158,6 +165,16 @@
|
|
|
158
165
|
}
|
|
159
166
|
},
|
|
160
167
|
"description": "Keys prefixed with the member."
|
|
168
|
+
},
|
|
169
|
+
"byPipeline": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"additionalProperties": {
|
|
172
|
+
"type": "array",
|
|
173
|
+
"items": {
|
|
174
|
+
"type": "string"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"description": "Added in contract 1 by #3922. CI pipeline membership (#3910): a workflow or pipeline the member's CI lexicon reports, with the node ids it runs. Keys prefixed with the member, like byStack. Edges with `crossPipeline` run between these groups."
|
|
161
178
|
}
|
|
162
179
|
}
|
|
163
180
|
},
|
|
@@ -523,7 +540,15 @@
|
|
|
523
540
|
"type": "string"
|
|
524
541
|
},
|
|
525
542
|
"kind": {
|
|
526
|
-
"
|
|
543
|
+
"enum": [
|
|
544
|
+
"ref",
|
|
545
|
+
"needs",
|
|
546
|
+
"calls",
|
|
547
|
+
"triggers",
|
|
548
|
+
"includes",
|
|
549
|
+
"extends"
|
|
550
|
+
],
|
|
551
|
+
"description": "`ref` for an edge from a typed reference. The CI kinds (#3910): `needs` (a job waits on another), `calls` (a reusable workflow or action is used), `triggers` (a pipeline starts another), `includes` (a file is pulled in), `extends` (a GitLab job inherits another). The list grows within contract 1; a reader ignores a kind it does not know."
|
|
527
552
|
},
|
|
528
553
|
"viaAttr": {
|
|
529
554
|
"type": "string"
|
|
@@ -531,11 +556,53 @@
|
|
|
531
556
|
"toAttr": {
|
|
532
557
|
"type": "string"
|
|
533
558
|
},
|
|
559
|
+
"crossPipeline": {
|
|
560
|
+
"type": "boolean",
|
|
561
|
+
"description": "Added in contract 1 by #3922. True when the edge leaves the pipeline `from` belongs to (#3910): a reusable-workflow call, a `workflow_run` trigger, a GitLab child or multi-project trigger, an include. Absent on every in-pipeline edge."
|
|
562
|
+
},
|
|
534
563
|
"member": {
|
|
535
564
|
"type": "string"
|
|
536
565
|
}
|
|
537
566
|
}
|
|
538
567
|
},
|
|
568
|
+
"dangling": {
|
|
569
|
+
"type": "object",
|
|
570
|
+
"required": [
|
|
571
|
+
"from",
|
|
572
|
+
"kind",
|
|
573
|
+
"path",
|
|
574
|
+
"value",
|
|
575
|
+
"member"
|
|
576
|
+
],
|
|
577
|
+
"properties": {
|
|
578
|
+
"from": {
|
|
579
|
+
"type": "string",
|
|
580
|
+
"description": "The node holding the reference, prefixed with its member."
|
|
581
|
+
},
|
|
582
|
+
"kind": {
|
|
583
|
+
"$ref": "#/$defs/edge/properties/kind"
|
|
584
|
+
},
|
|
585
|
+
"path": {
|
|
586
|
+
"type": "string",
|
|
587
|
+
"description": "Where on `from` it was written, such as `needs`, `uses` or `trigger.include`."
|
|
588
|
+
},
|
|
589
|
+
"value": {
|
|
590
|
+
"type": "string",
|
|
591
|
+
"description": "The reference exactly as written."
|
|
592
|
+
},
|
|
593
|
+
"crossPipeline": {
|
|
594
|
+
"type": "boolean",
|
|
595
|
+
"description": "As on an edge."
|
|
596
|
+
},
|
|
597
|
+
"member": {
|
|
598
|
+
"type": "string"
|
|
599
|
+
},
|
|
600
|
+
"nested": {
|
|
601
|
+
"type": "string",
|
|
602
|
+
"description": "For a member of kind `workspace`: the nested workspace's member the reference was read through, as on a node."
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
},
|
|
539
606
|
"failure": {
|
|
540
607
|
"description": "The declaration could not be read, and nothing was composed. Exit code 1.",
|
|
541
608
|
"type": "object",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* in the user's cache directory, ws-059), and the outer side keeps nothing.
|
|
21
21
|
*/
|
|
22
22
|
import type { ParsedArgs } from "../cli/registry.js";
|
|
23
|
-
import type
|
|
23
|
+
import { type ComposedMember, type WorkspaceGraph } from "./compose-graph.js";
|
|
24
24
|
export type { NestedWorkspace } from "./compose-graph.js";
|
|
25
25
|
import { type Toolchain } from "./member-commands.js";
|
|
26
26
|
/** What reading one nested workspace gave. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested-graph.d.ts","sourceRoot":"","sources":["../../src/workspace/nested-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"nested-graph.d.ts","sourceRoot":"","sources":["../../src/workspace/nested-graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAA8B,KAAK,cAAc,EAAqB,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE1H,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEpE,8CAA8C;AAC9C,MAAM,MAAM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
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* in the user's cache directory, ws-059), and the outer side keeps nothing.
|
|
21
21
|
*/
|
|
22
22
|
import { spawn } from "node:child_process";
|
|
23
|
+
import { danglingKey, SCOPED_GROUPS } from "./compose-graph.js";
|
|
23
24
|
import { readerToolchain } from "./member-commands.js";
|
|
24
25
|
/** The command line of the nested read: the outer command's own read flags, passed on. */
|
|
25
26
|
export function nestedArgv(dir, args, at) {
|
|
@@ -135,12 +136,15 @@ export function foldNested(graph, member, inner) {
|
|
|
135
136
|
into[k] = [...(into[k] ?? []), ...v.map((id) => prefixed(outer, id))].sort();
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
|
-
for (const key of
|
|
139
|
+
for (const key of SCOPED_GROUPS) {
|
|
139
140
|
for (const [k, v] of Object.entries(innerGroups[key] ?? {})) {
|
|
140
141
|
const into = (groups[key] ?? (groups[key] = {}));
|
|
141
142
|
into[prefixed(outer, k)] = v.map((id) => prefixed(outer, id)).sort();
|
|
142
143
|
}
|
|
143
144
|
}
|
|
145
|
+
if (inner.dangling?.length) {
|
|
146
|
+
graph.dangling = [...(graph.dangling ?? []), ...inner.dangling.map((d) => ({ ...d, from: prefixed(outer, d.from), member: outer, nested: d.member }))].sort((a, b) => danglingKey(a).localeCompare(danglingKey(b)));
|
|
147
|
+
}
|
|
144
148
|
for (const c of inner.collectors ?? [])
|
|
145
149
|
graph.collectors.push({ ...c, member: prefixed(outer, c.member) });
|
|
146
150
|
for (const [kind, attrs] of Object.entries(inner.derivedAttrs ?? {})) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../../src/workspace/runs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,UA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;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAI,CAiBnG;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,YAAY,EAAE,CAiCvG"}
|
package/dist/workspace/runs.js
CHANGED
|
@@ -54,7 +54,7 @@ import { createHash, randomBytes } from "node:crypto";
|
|
|
54
54
|
import { readFileSync, statSync } from "node:fs";
|
|
55
55
|
import { resolve } from "node:path";
|
|
56
56
|
import { z } from "zod";
|
|
57
|
-
import { describeLifecyclePush, fetchLifecycleStatus, pushLifecycleStatus, readBlobBySha, RefCASConflictError, writeLedgerFiles } from "../lifecycle/git.js";
|
|
57
|
+
import { describeLifecyclePush, fetchLifecycleStatus, ledgerRevision, pushLifecycleStatus, readBlobBySha, RefCASConflictError, writeLedgerFiles } from "../lifecycle/git.js";
|
|
58
58
|
import { resolveMemberLedger } from "../lifecycle/member-ledger.js";
|
|
59
59
|
import { sortedJsonReplacer } from "../utils.js";
|
|
60
60
|
import { followSquashes } from "./squash.js";
|
|
@@ -354,7 +354,9 @@ async function appendRun(top, rootOnDisk, id, make, message) {
|
|
|
354
354
|
let written = [];
|
|
355
355
|
let lastErr;
|
|
356
356
|
for (let attempt = 1; attempt <= APPEND_RETRY_ATTEMPTS && commit === undefined; attempt++) {
|
|
357
|
-
|
|
357
|
+
// #3955: in a run that records nothing, the run's own unrecorded tip.
|
|
358
|
+
const rev = await ledgerRevision(top);
|
|
359
|
+
const prior = git(top, ["rev-parse", "--verify", "--quiet", `${rev === LEDGER_BRANCH ? `refs/heads/${LEDGER_BRANCH}` : rev}:${path}`])?.trim() || null;
|
|
358
360
|
const text = prior ? ((await readBlobBySha(prior, { cwd: top })) ?? "") : "";
|
|
359
361
|
const existing = parseRunFile(text, id).lines;
|
|
360
362
|
const lines = make(existing);
|
package/package.json
CHANGED
package/src/ci-jobs.ts
CHANGED
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
* - the `setup` steps and `environment` a job may carry, checked once per
|
|
16
16
|
* forge ({@link assertSetupSteps}, {@link assertEnvironment},
|
|
17
17
|
* {@link gitlabSetupScript}, {@link assertGitlabEnvironment});
|
|
18
|
-
* - GitLab's `rules:` expressions and `id_tokens:` declaration
|
|
18
|
+
* - GitLab's `rules:` expressions and `id_tokens:` declaration;
|
|
19
|
+
* - where a job runs and the id tokens it asks for (#3914), {@link githubRunsOn},
|
|
20
|
+
* {@link gitlabTags}, {@link gitlabIdTokensDoc} and {@link idTokenAudienceEnv}.
|
|
19
21
|
*
|
|
20
22
|
* The Forgejo dialect (action refs, dropped `permissions:` and
|
|
21
23
|
* `environment:`, the header note naming what was dropped) is the forgejo
|
|
@@ -96,11 +98,66 @@ export function dirnameOf(path: string): string {
|
|
|
96
98
|
return i <= 0 ? "." : path.slice(0, i);
|
|
97
99
|
}
|
|
98
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Where a generated job runs (#3914): a runner label, a list of labels the
|
|
103
|
+
* runner must all carry, or on GitHub a runner group with optional labels.
|
|
104
|
+
* `runs-on` on GitHub and Forgejo, `tags` on GitLab.
|
|
105
|
+
*/
|
|
106
|
+
export type CiRunner = string | readonly string[] | { group: string; labels?: readonly string[] };
|
|
107
|
+
|
|
108
|
+
/** True when `runner` is a GitHub runner group, which only GitHub has. */
|
|
109
|
+
export function isRunnerGroup(runner: CiRunner | undefined): runner is { group: string; labels?: readonly string[] } {
|
|
110
|
+
return runner !== undefined && typeof runner === "object" && !Array.isArray(runner);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Refuse a runner group on a forge that has none (#3914). `subject` and
|
|
115
|
+
* `field` name whose runner it is, such as `Op waves "x"` and `wave "prod"
|
|
116
|
+
* runner`.
|
|
117
|
+
*/
|
|
118
|
+
export function assertRunnerLabels(subject: string, field: string, runner: CiRunner | undefined, forge: "GitLab" | "Forgejo"): void {
|
|
119
|
+
if (!isRunnerGroup(runner)) return;
|
|
120
|
+
throw new Error(
|
|
121
|
+
`${subject}: ${field} is the runner group "${runner.group}", which only GitHub has. ` +
|
|
122
|
+
`${forge === "GitLab" ? "GitLab picks a runner by its tags" : "Forgejo picks a runner by its labels"}; give a label or a list of labels.`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Each id token's audience as a variable, `<NAME>_AUDIENCE` (#3914). On
|
|
128
|
+
* GitHub and Forgejo the audience is chosen when the job requests the token,
|
|
129
|
+
* so the job reads it from there; GitLab declares it in `id_tokens:`
|
|
130
|
+
* ({@link gitlabIdTokensDoc}).
|
|
131
|
+
*/
|
|
132
|
+
export function idTokenAudienceEnv(idTokens: Readonly<Record<string, string>> | undefined): Record<string, string> {
|
|
133
|
+
return Object.fromEntries(Object.entries(idTokens ?? {}).map(([name, aud]) => [`${name}_AUDIENCE`, aud]));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** A job's GitLab `id_tokens:` for `{ <variable>: <audience> }` (#3914), or undefined when there are none. */
|
|
137
|
+
export function gitlabIdTokensDoc(idTokens: Readonly<Record<string, string>> | undefined): Record<string, { aud: string }> | undefined {
|
|
138
|
+
const entries = Object.entries(idTokens ?? {});
|
|
139
|
+
return entries.length > 0 ? Object.fromEntries(entries.map(([name, aud]) => [name, { aud }])) : undefined;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** A job's GitLab `tags:` for `runner` (#3914), or undefined when it names none. */
|
|
143
|
+
export function gitlabTags(runner: CiRunner | undefined): string[] | undefined {
|
|
144
|
+
if (runner === undefined || isRunnerGroup(runner)) return undefined;
|
|
145
|
+
return typeof runner === "string" ? [runner] : [...runner];
|
|
146
|
+
}
|
|
147
|
+
|
|
99
148
|
// ── GitHub Actions and Forgejo Actions ──────────────────────────────────────
|
|
100
149
|
|
|
101
150
|
/** The runner label a generated job asks for; the Forgejo dialect rewrites it to the project's label. */
|
|
102
151
|
export const GITHUB_RUNNER = "ubuntu-latest";
|
|
103
152
|
|
|
153
|
+
/** A job's `runs-on` for `runner` (#3914): {@link GITHUB_RUNNER} when it names none. */
|
|
154
|
+
export function githubRunsOn(runner: CiRunner | undefined): string | string[] | { group: string; labels?: string[] } {
|
|
155
|
+
if (runner === undefined) return GITHUB_RUNNER;
|
|
156
|
+
if (typeof runner === "string") return runner;
|
|
157
|
+
if (isRunnerGroup(runner)) return { group: runner.group, ...(runner.labels && runner.labels.length > 0 ? { labels: [...runner.labels] } : {}) };
|
|
158
|
+
return [...runner];
|
|
159
|
+
}
|
|
160
|
+
|
|
104
161
|
/** The job token, which GitHub and Forgejo both mint for every run. */
|
|
105
162
|
export const GITHUB_JOB_TOKEN = "${{ github.token }}";
|
|
106
163
|
|
|
@@ -32,6 +32,7 @@ import { loadPolicyChecks } from "../../lint/policy";
|
|
|
32
32
|
import { armSandboxPolicyExecution, runProjectPolicies } from "../../lint/policy-sandbox";
|
|
33
33
|
import { sortedJsonReplacer } from "../../utils";
|
|
34
34
|
import { rankFoldBlockers, toCollapsedFormat, type FoldRankResult } from "../../discovery/fold-rank";
|
|
35
|
+
import { foldExecutionCounts } from "../../discovery/fold-import";
|
|
35
36
|
import { formatError, formatWarning, formatSuccess, formatBold, formatInfo } from "../format";
|
|
36
37
|
import { writeFileSync, mkdirSync } from "fs";
|
|
37
38
|
import { resolve, dirname, join, relative } from "path";
|
|
@@ -396,6 +397,23 @@ export async function buildCommand(options: BuildOptions): Promise<BuildResult>
|
|
|
396
397
|
: (decision.reason ?? "fell back to run");
|
|
397
398
|
console.error(formatInfo(`[fold:${decision.mode}] ${rel} — ${detail}`));
|
|
398
399
|
}
|
|
400
|
+
// typescript-as-data#177 — the exact instrument beside the sampled one.
|
|
401
|
+
// `test/leftness` reports "0 MB of definition-library code on the path"
|
|
402
|
+
// from a `node --cpu-prof` recording, and a profile has a sampling
|
|
403
|
+
// floor: 0 MB is everything the profiler could see rather than nothing
|
|
404
|
+
// having run. L10.1's counters have no floor.
|
|
405
|
+
//
|
|
406
|
+
// Inside --verbose with the per-file lines, not beside them. The default
|
|
407
|
+
// path is deliberately quiet for the reason above, and the leftness
|
|
408
|
+
// capture already runs --verbose and greps this log for `[fold:fold]`.
|
|
409
|
+
const counts = foldExecutionCounts();
|
|
410
|
+
console.error(
|
|
411
|
+
formatInfo(
|
|
412
|
+
`[fold:counts] factoryInvocations=${counts.factoryInvocations} ` +
|
|
413
|
+
`projectFactoryInvocations=${counts.projectFactoryInvocations} ` +
|
|
414
|
+
`factoryInterpretations=${counts.factoryInterpretations}`,
|
|
415
|
+
),
|
|
416
|
+
);
|
|
399
417
|
} else {
|
|
400
418
|
console.error(formatInfo(summarizeFoldDecisions(result.foldDecisions)));
|
|
401
419
|
}
|
|
@@ -24,6 +24,7 @@ import { FAN_OUT_GATE_OP, OVERRIDE_GATE_OP, WORKSPACE_UPGRADE_GATE_OP } from "..
|
|
|
24
24
|
import { PR_GATE_OP } from "../../pr-loop";
|
|
25
25
|
import { pushLifecycleReport, requireLifecycleLedger } from "../../lifecycle/git";
|
|
26
26
|
import { LIFECYCLE_LOCAL_NOTE, isLifecycleLocalNote } from "../../lifecycle/local-note";
|
|
27
|
+
import { ledgerRecordingOff, NO_RECORD_ENV } from "../../lifecycle/no-record";
|
|
27
28
|
import { formatError, formatWarning, formatSuccess, formatInfo } from "../format";
|
|
28
29
|
import type { CommandContext } from "../registry";
|
|
29
30
|
|
|
@@ -267,6 +268,14 @@ export async function recordGateApproval(
|
|
|
267
268
|
gate: string,
|
|
268
269
|
opts: GateApprovalOptions,
|
|
269
270
|
): Promise<GateApprovalOutcome> {
|
|
271
|
+
// #3955: with recording off the approval would be dropped with the process.
|
|
272
|
+
if (ledgerRecordingOff()) {
|
|
273
|
+
console.error(formatError({
|
|
274
|
+
message: `Cannot record the approval of "${gate}": ${NO_RECORD_ENV} is set, so nothing is written to chant/lifecycle`,
|
|
275
|
+
hint: `Unset ${NO_RECORD_ENV} to approve the gate.`,
|
|
276
|
+
}));
|
|
277
|
+
return { ok: false };
|
|
278
|
+
}
|
|
270
279
|
const { ops } = await discoverOps();
|
|
271
280
|
// `fan-out` is the op name every `chant components fan-out` gate is recorded
|
|
272
281
|
// under (../handlers/fan-out.ts). It is a command rather than a declaration,
|
|
@@ -42,7 +42,7 @@ vi.mock("node:child_process", async () => {
|
|
|
42
42
|
return { ...actual, exec: execWithCustom, execFile: execFileWithCustom };
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const { runEmulator, formatEmulatorHelp, parsePortMappings } = await import("./emulator");
|
|
45
|
+
const { runEmulator, formatEmulatorHelp, parsePortMappings, parseUpOptions } = await import("./emulator");
|
|
46
46
|
|
|
47
47
|
function cap(): EmulatorCapability {
|
|
48
48
|
return {
|
|
@@ -286,3 +286,63 @@ describe("chant emulator --port and --help (#3673)", () => {
|
|
|
286
286
|
expect(formatEmulatorHelp([])).toContain("No lexicon configured for this project has a local emulator.");
|
|
287
287
|
});
|
|
288
288
|
});
|
|
289
|
+
|
|
290
|
+
describe("chant emulator up --image, --network, --setting, --loopback (#3952)", () => {
|
|
291
|
+
const floci = (): EmulatorCapability => ({ ...cap(), spec: { ...cap().spec, settingsPrefix: "FLOCI_" } });
|
|
292
|
+
const other = (): EmulatorCapability => ({
|
|
293
|
+
spec: { name: "chant-floci-az", image: "floci/floci-az:1.0.0", containerPort: 4577, healthPath: "/health" },
|
|
294
|
+
env: () => ({}),
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
beforeEach(() => {
|
|
298
|
+
upMock.mockReset();
|
|
299
|
+
vi.restoreAllMocks();
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
test("up passes each option to the lifecycle", async () => {
|
|
303
|
+
stderr();
|
|
304
|
+
upMock.mockResolvedValue({ endpoint: "http://localhost:4566" });
|
|
305
|
+
const exit = await runEmulator({
|
|
306
|
+
args: makeArgs({
|
|
307
|
+
path: "up", image: "floci/floci:1.6.0", network: "loom", loopback: true,
|
|
308
|
+
setting: ["FLOCI_STORAGE_MODE=memory", "FLOCI_X=a=b"], port: ["4567"],
|
|
309
|
+
}),
|
|
310
|
+
plugins: [plugin("aws", floci())],
|
|
311
|
+
serializers: [],
|
|
312
|
+
});
|
|
313
|
+
expect(exit).toBe(0);
|
|
314
|
+
expect(upMock).toHaveBeenCalledWith({
|
|
315
|
+
image: "floci/floci:1.6.0", network: "loom", loopback: true,
|
|
316
|
+
settings: { FLOCI_STORAGE_MODE: "memory", FLOCI_X: "a=b" }, port: 4567,
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
test("a setting no selected emulator takes is refused before anything starts", async () => {
|
|
321
|
+
const err = stderr();
|
|
322
|
+
const exit = await runEmulator({
|
|
323
|
+
args: makeArgs({ path: "up", setting: ["HOME=/tmp"] }),
|
|
324
|
+
plugins: [plugin("aws", floci())],
|
|
325
|
+
serializers: [],
|
|
326
|
+
});
|
|
327
|
+
expect(exit).toBe(1);
|
|
328
|
+
expect(upMock).not.toHaveBeenCalled();
|
|
329
|
+
expect(err.join("\n")).toContain("--setting HOME: no selected emulator takes it; the selected ones take FLOCI_* (chant-floci)");
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
test("settings go only to the emulator whose prefix matches; --image needs one emulator", () => {
|
|
333
|
+
const a = floci();
|
|
334
|
+
const b = other();
|
|
335
|
+
const opts = parseUpOptions({ setting: ["FLOCI_A=1"], network: "n" }, [a, b]);
|
|
336
|
+
expect(opts.get(a)).toEqual({ network: "n", settings: { FLOCI_A: "1" } });
|
|
337
|
+
expect(opts.get(b)).toEqual({ network: "n" });
|
|
338
|
+
expect(() => parseUpOptions({ image: "x:1" }, [a, b])).toThrow(/--image x:1 is ambiguous with 2 emulators/);
|
|
339
|
+
expect(() => parseUpOptions({ setting: ["FLOCI_A"] }, [a])).toThrow(/expected <KEY>=<VALUE>/);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test("the options apply to up only", async () => {
|
|
343
|
+
const err = stderr();
|
|
344
|
+
const exit = await runEmulator({ args: makeArgs({ path: "status", loopback: true }), plugins: [plugin("aws", floci())], serializers: [] });
|
|
345
|
+
expect(exit).toBe(1);
|
|
346
|
+
expect(err.join("\n")).toContain("--loopback applies to `chant emulator up` only");
|
|
347
|
+
});
|
|
348
|
+
});
|