@intentius/chant 0.124.103 → 0.124.105
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/audit/secrets.d.ts +6 -0
- package/dist/audit/secrets.js +9 -2
- package/dist/capabilities/templates.d.ts +66 -3
- package/dist/capabilities/templates.js +220 -81
- package/dist/cli/commands/import-index.d.ts +15 -0
- package/dist/cli/commands/import-index.js +37 -3
- package/dist/cli/handlers/lifecycle.js +6 -0
- package/dist/cli/handlers/release-config.d.ts +15 -0
- package/dist/cli/handlers/release-config.js +58 -0
- package/dist/cli/handlers/release-doctor.js +8 -3
- package/dist/cli/handlers/release-init.js +7 -4
- package/dist/cli/handlers/release.js +36 -3
- package/dist/cli/handlers/search.d.ts +1 -1
- package/dist/cli/handlers/search.js +24 -2
- package/dist/cli/main.js +12 -2
- package/dist/cli/parse-args.js +9 -2
- package/dist/cli/registry.d.ts +2 -0
- package/dist/cli/release-commands/cut.js +3 -0
- package/dist/cli/release-commands/doctor.js +5 -2
- package/dist/cloud-lister/aws.d.ts +9 -0
- package/dist/cloud-lister/aws.js +20 -0
- package/dist/config-import.js +26 -4
- package/dist/config.d.ts +24 -0
- package/dist/config.js +6 -0
- package/dist/floor-table.data.js +8 -6
- package/dist/floor-table.js +3 -1
- package/dist/graph-refs.d.ts +22 -0
- package/dist/graph-refs.js +20 -11
- package/dist/lifecycle/cloud-index.d.ts +6 -0
- package/dist/lifecycle/cloud-index.js +32 -5
- package/dist/lifecycle/derive-edges.d.ts +1 -1
- package/dist/lifecycle/derive-edges.js +5 -3
- package/dist/lifecycle/identity-match.d.ts +18 -2
- package/dist/lifecycle/identity-match.js +10 -5
- package/dist/lifecycle/index-drift.d.ts +13 -0
- package/dist/lifecycle/index-drift.js +21 -3
- package/dist/lifecycle/index-import.d.ts +24 -2
- package/dist/lifecycle/index-import.js +61 -9
- package/dist/lifecycle/index-join.d.ts +1 -1
- package/dist/lifecycle/index-join.js +1 -1
- package/dist/lifecycle/publish-declaration.d.ts +6 -0
- package/dist/lifecycle/publish-declaration.js +18 -1
- package/dist/lifecycle/publish-forge.d.ts +2 -0
- package/dist/lifecycle/publish-forge.js +3 -1
- package/dist/lifecycle/publish-oci.d.ts +27 -0
- package/dist/lifecycle/publish-oci.js +63 -8
- package/dist/lifecycle/release-artifacts.js +3 -1
- package/dist/lifecycle/release-at.d.ts +5 -1
- package/dist/lifecycle/release-at.js +69 -4
- package/dist/lifecycle/release-changelog.d.ts +18 -5
- package/dist/lifecycle/release-changelog.js +22 -10
- package/dist/lifecycle/release-cut.d.ts +13 -1
- package/dist/lifecycle/release-cut.js +3 -0
- package/dist/lifecycle/release-doctor.d.ts +10 -0
- package/dist/lifecycle/release-doctor.js +84 -14
- package/dist/lifecycle/release-green.d.ts +5 -2
- package/dist/lifecycle/release-green.js +40 -8
- package/dist/lifecycle/release-images.d.ts +39 -3
- package/dist/lifecycle/release-images.js +84 -7
- package/dist/lifecycle/release-init-goreleaser-images.d.ts +21 -0
- package/dist/lifecycle/release-init-goreleaser-images.js +160 -0
- package/dist/lifecycle/release-init.d.ts +38 -7
- package/dist/lifecycle/release-init.js +298 -52
- package/dist/lifecycle/release-next.d.ts +1 -1
- package/dist/lifecycle/release-next.js +9 -4
- package/dist/local-chant.d.ts +3 -0
- package/dist/local-chant.js +28 -2
- package/dist/release-floors.d.ts +10 -6
- package/dist/release-floors.js +10 -6
- package/dist/ts-loader.d.ts +12 -3
- package/dist/ts-loader.js +27 -11
- package/dist/wave-runtime.mjs +292 -291
- package/dist/workspace/capabilities-contract.d.ts +15 -5
- package/dist/workspace/capabilities-contract.js +7 -4
- package/dist/workspace/capabilities.schema.json +45 -1
- package/dist/workspace/catalog-edges.d.ts +22 -0
- package/dist/workspace/catalog-edges.js +23 -0
- package/dist/workspace/release-changed.d.ts +2 -0
- package/dist/workspace/release-changed.js +7 -2
- package/dist/workspace/release-steps/doctor.js +2 -1
- package/dist/workspace/release-steps/goreleaser.d.ts +6 -3
- package/dist/workspace/release-steps/goreleaser.js +12 -6
- package/dist/workspace/release-toolchains.d.ts +6 -0
- package/dist/workspace/release-toolchains.js +8 -0
- package/dist/workspace/release-train-workflow.d.ts +18 -0
- package/dist/workspace/release-train-workflow.js +135 -7
- package/dist/workspace/release-train.js +1 -1
- package/dist/workspace/release-workflow.d.ts +26 -0
- package/dist/workspace/release-workflow.js +60 -12
- package/dist/workspace/train-artifacts.js +3 -4
- package/dist/workspace/train-cut.d.ts +22 -1
- package/dist/workspace/train-cut.js +80 -16
- package/package.json +2 -2
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* runs, unchanged.
|
|
14
14
|
*/
|
|
15
15
|
import type { CapabilityEntry } from "../capabilities/catalog.js";
|
|
16
|
-
import type {
|
|
16
|
+
import type { CatalogTemplate, RefusedTemplate } from "../capabilities/templates.js";
|
|
17
17
|
/** The version of the `capabilities` document this chant writes. */
|
|
18
18
|
export declare const CAPABILITIES_CONTRACT_VERSION = 1;
|
|
19
19
|
/** `$id` of the JSON Schema for the document, shipped beside this file. */
|
|
@@ -38,9 +38,17 @@ export interface CapabilitiesResult extends CapabilitiesHead {
|
|
|
38
38
|
/**
|
|
39
39
|
* The investigation templates (#4531), the catalog's second kind of entry.
|
|
40
40
|
* Added within contract 1; a document from a chant older than
|
|
41
|
-
* CAPABILITY_TEMPLATES_FLOOR lacks it.
|
|
41
|
+
* CAPABILITY_TEMPLATES_FLOOR lacks it. From PROJECT_TEMPLATES_FLOOR it
|
|
42
|
+
* holds chant's templates and then the project's own from
|
|
43
|
+
* `.chant/templates.json` (behold#1142), each with its `origin`.
|
|
42
44
|
*/
|
|
43
|
-
templates:
|
|
45
|
+
templates: CatalogTemplate[];
|
|
46
|
+
/**
|
|
47
|
+
* The project's template entries left out of `templates`, each naming the
|
|
48
|
+
* file and field at fault (behold#1142). Added within contract 1 at
|
|
49
|
+
* PROJECT_TEMPLATES_FLOOR.
|
|
50
|
+
*/
|
|
51
|
+
refused: RefusedTemplate[];
|
|
44
52
|
}
|
|
45
53
|
export interface CapabilitiesFailure extends CapabilitiesHead {
|
|
46
54
|
error: {
|
|
@@ -53,13 +61,15 @@ export type CapabilitiesDocument = CapabilitiesResult | CapabilitiesFailure;
|
|
|
53
61
|
/**
|
|
54
62
|
* The catalog, with a support statement for each lexicon named. Each is
|
|
55
63
|
* loaded on its own, so one that isn't installed is said to be, and the rest
|
|
56
|
-
* still read.
|
|
64
|
+
* still read. The templates are the catalog for the project at `dir`:
|
|
65
|
+
* chant's, and the ones `.chant/templates.json` at its workspace or project
|
|
66
|
+
* root declares (behold#1142).
|
|
57
67
|
*/
|
|
58
68
|
export declare function capabilitiesDocument(lexicons: string[], load?: (name: string) => Promise<{
|
|
59
69
|
capabilityPack?: {
|
|
60
70
|
mapping: unknown;
|
|
61
71
|
};
|
|
62
|
-
}
|
|
72
|
+
}>, dir?: string): Promise<CapabilitiesResult>;
|
|
63
73
|
export declare function capabilitiesFailure(error: CapabilitiesFailure["error"]): Promise<CapabilitiesFailure>;
|
|
64
74
|
/**
|
|
65
75
|
* The lexicons the members of the workspace at `cwd` load, for its catalog:
|
|
@@ -28,9 +28,11 @@ async function head() {
|
|
|
28
28
|
/**
|
|
29
29
|
* The catalog, with a support statement for each lexicon named. Each is
|
|
30
30
|
* loaded on its own, so one that isn't installed is said to be, and the rest
|
|
31
|
-
* still read.
|
|
31
|
+
* still read. The templates are the catalog for the project at `dir`:
|
|
32
|
+
* chant's, and the ones `.chant/templates.json` at its workspace or project
|
|
33
|
+
* root declares (behold#1142).
|
|
32
34
|
*/
|
|
33
|
-
export async function capabilitiesDocument(lexicons, load) {
|
|
35
|
+
export async function capabilitiesDocument(lexicons, load, dir = process.cwd()) {
|
|
34
36
|
const loadPlugin = load ?? (await import("../cli/plugins.js")).loadPlugin;
|
|
35
37
|
const { capabilityCatalog } = await import("../capabilities/catalog.js");
|
|
36
38
|
const mappings = {};
|
|
@@ -44,14 +46,15 @@ export async function capabilitiesDocument(lexicons, load) {
|
|
|
44
46
|
mappings[name] = undefined;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
|
-
const {
|
|
49
|
+
const { templateCatalog } = await import("../capabilities/templates.js");
|
|
48
50
|
const catalog = capabilityCatalog(mappings);
|
|
49
51
|
for (const c of catalog.capabilities) {
|
|
50
52
|
for (const name of notLoaded) {
|
|
51
53
|
c.lexicons[name] = { code: "lexicon-not-loaded", message: `the ${name} lexicon isn't installed where this chant runs, so its mapping wasn't read` };
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
|
-
|
|
56
|
+
const { templates, refused } = templateCatalog(dir);
|
|
57
|
+
return { ...(await head()), ...catalog, templates, refused };
|
|
55
58
|
}
|
|
56
59
|
export async function capabilitiesFailure(error) {
|
|
57
60
|
return { ...(await head()), error };
|
|
@@ -61,10 +61,39 @@
|
|
|
61
61
|
},
|
|
62
62
|
"templates": {
|
|
63
63
|
"type": "array",
|
|
64
|
-
"description": "The investigation templates (#4531), the catalog's second kind of entry: each a fixed query about one resource, as a chant search path pattern or as Cypher for behold's graph pane. Added within contract 1 by #4531, written by chant 0.124.54 and newer; a document without it is from an older chant.",
|
|
64
|
+
"description": "The investigation templates (#4531), the catalog's second kind of entry: each a fixed query about one resource, as a chant search path pattern or as Cypher for behold's graph pane. Added within contract 1 by #4531, written by chant 0.124.54 and newer; a document without it is from an older chant. chant's own come first, then the project's own from .chant/templates.json at the workspace root, or at the project root with no workspace.",
|
|
65
65
|
"items": {
|
|
66
66
|
"$ref": "#/$defs/template"
|
|
67
67
|
}
|
|
68
|
+
},
|
|
69
|
+
"refused": {
|
|
70
|
+
"type": "array",
|
|
71
|
+
"description": "The project's template entries left out of templates: one that does not hold to the entry kind, or whose id is one of chant's, or the whole file as one entry when it is not a templates file. The others still load. Added within contract 1 by behold#1142, written by chant 0.124.105 and newer.",
|
|
72
|
+
"items": {
|
|
73
|
+
"type": "object",
|
|
74
|
+
"required": [
|
|
75
|
+
"file",
|
|
76
|
+
"message"
|
|
77
|
+
],
|
|
78
|
+
"properties": {
|
|
79
|
+
"id": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "The entry's id, when it has a usable one."
|
|
82
|
+
},
|
|
83
|
+
"file": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"description": "The file the entry was read from, relative to the workspace or project root, such as .chant/templates.json."
|
|
86
|
+
},
|
|
87
|
+
"field": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"description": "The field at fault, such as templates[2].query.text; absent when the file cannot be read as JSON."
|
|
90
|
+
},
|
|
91
|
+
"message": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"description": "What is wrong, naming the file and the field."
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
68
97
|
}
|
|
69
98
|
}
|
|
70
99
|
},
|
|
@@ -220,6 +249,21 @@
|
|
|
220
249
|
"type": "string"
|
|
221
250
|
}
|
|
222
251
|
},
|
|
252
|
+
"kinds": {
|
|
253
|
+
"type": "array",
|
|
254
|
+
"minItems": 1,
|
|
255
|
+
"description": "The node kinds it applies to, as the graph holds them, such as aws_s3_bucket or AWS::S3::Bucket; absent means every kind. Added within contract 1 by behold#1142, written by chant 0.124.105 and newer.",
|
|
256
|
+
"items": {
|
|
257
|
+
"type": "string"
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"origin": {
|
|
261
|
+
"enum": [
|
|
262
|
+
"chant",
|
|
263
|
+
"project"
|
|
264
|
+
],
|
|
265
|
+
"description": "Where it was declared: chant's own templates.json, or the project's .chant/templates.json. Added within contract 1 by behold#1142, written by chant 0.124.105 and newer."
|
|
266
|
+
},
|
|
223
267
|
"inputs": {
|
|
224
268
|
"type": "array",
|
|
225
269
|
"description": "What it is filled with. The first is the resource, the only one of kind resource. A path pattern fills {{<name>}}; a Cypher query binds the resource as $key and each other input as $<name>. A scope input says where the query is read and appears in neither.",
|
|
@@ -33,6 +33,21 @@
|
|
|
33
33
|
* where it will be applied, and the objects one member applies together go to
|
|
34
34
|
* one namespace far more often than not.
|
|
35
35
|
*
|
|
36
|
+
* ## A cloud index beside the workspace (#5245)
|
|
37
|
+
*
|
|
38
|
+
* A caller that reads a cluster and a cloud index together (behold's joined
|
|
39
|
+
* read) hands the index's nodes to {@link runCatalogPass} as one more member,
|
|
40
|
+
* through {@link indexedMemberNodes}: the member is the index document's
|
|
41
|
+
* scope key. The cloud kinds are scoped by no catalog, so they sit in the
|
|
42
|
+
* workspace scope with no namespace, which every namespaced holder reaches
|
|
43
|
+
* (`scopeOf` below, and the account-only key `reconstructIndexedEdges`
|
|
44
|
+
* looks a holder's value up under). The index's own account and region are
|
|
45
|
+
* not part of that scope, so a rule that joins a cluster object to an
|
|
46
|
+
* indexed node checks them itself: the IRSA rule keeps a role of the
|
|
47
|
+
* annotation's account, the ExternalSecret rule a secret of the store's
|
|
48
|
+
* region. `deriveEdgesAcross` (../lifecycle/derive-edges.ts) does not join
|
|
49
|
+
* the two: it reads one cloud account, and refuses a cluster source.
|
|
50
|
+
*
|
|
36
51
|
* ## Declared nodes the rules are not written against
|
|
37
52
|
*
|
|
38
53
|
* A catalog's `declaredNode` gives the node the rules read, for a lexicon
|
|
@@ -80,6 +95,7 @@
|
|
|
80
95
|
import { type ContainmentPair, type RepoPathRef, type NamedCatalog } from "../graph-refs.js";
|
|
81
96
|
import { type DetailLevel } from "../graph-detail.js";
|
|
82
97
|
import type { CatalogRuleEntry, ComposedAmbiguous, ComposedDangling, ComposedEdge, ComposedNode, NodeExpansion, WorkspaceGraph } from "./compose-graph.js";
|
|
98
|
+
import type { IndexDocument } from "../lifecycle/index-document.js";
|
|
83
99
|
/** The scope every node of a declared workspace graph sits in. */
|
|
84
100
|
export declare const WORKSPACE_SCOPE = "workspace";
|
|
85
101
|
/** What the catalog pass found, on the ids of the nodes it read. */
|
|
@@ -116,6 +132,12 @@ export declare function catalogRules(catalogs: readonly NamedCatalog[]): Record<
|
|
|
116
132
|
* it no such file is read.
|
|
117
133
|
*/
|
|
118
134
|
export declare function runCatalogPass(nodes: readonly ComposedNode[], catalogs: readonly NamedCatalog[], members?: readonly string[], lookPath?: LookPath, readFile?: ReadFile): CatalogPass;
|
|
135
|
+
/**
|
|
136
|
+
* An index document's nodes as members of a catalog pass (#5245): each in the
|
|
137
|
+
* member the document's scope key names, so they sit beside a cluster's
|
|
138
|
+
* objects or a workspace's members in one {@link runCatalogPass}.
|
|
139
|
+
*/
|
|
140
|
+
export declare function indexedMemberNodes(doc: IndexDocument): ComposedNode[];
|
|
119
141
|
/**
|
|
120
142
|
* Write a pass into the document. `placed` maps an id the pass read to the
|
|
121
143
|
* id of the node the document draws it as at its detail tier; an id it does
|
|
@@ -33,6 +33,21 @@
|
|
|
33
33
|
* where it will be applied, and the objects one member applies together go to
|
|
34
34
|
* one namespace far more often than not.
|
|
35
35
|
*
|
|
36
|
+
* ## A cloud index beside the workspace (#5245)
|
|
37
|
+
*
|
|
38
|
+
* A caller that reads a cluster and a cloud index together (behold's joined
|
|
39
|
+
* read) hands the index's nodes to {@link runCatalogPass} as one more member,
|
|
40
|
+
* through {@link indexedMemberNodes}: the member is the index document's
|
|
41
|
+
* scope key. The cloud kinds are scoped by no catalog, so they sit in the
|
|
42
|
+
* workspace scope with no namespace, which every namespaced holder reaches
|
|
43
|
+
* (`scopeOf` below, and the account-only key `reconstructIndexedEdges`
|
|
44
|
+
* looks a holder's value up under). The index's own account and region are
|
|
45
|
+
* not part of that scope, so a rule that joins a cluster object to an
|
|
46
|
+
* indexed node checks them itself: the IRSA rule keeps a role of the
|
|
47
|
+
* annotation's account, the ExternalSecret rule a secret of the store's
|
|
48
|
+
* region. `deriveEdgesAcross` (../lifecycle/derive-edges.ts) does not join
|
|
49
|
+
* the two: it reads one cloud account, and refuses a cluster source.
|
|
50
|
+
*
|
|
36
51
|
* ## Declared nodes the rules are not written against
|
|
37
52
|
*
|
|
38
53
|
* A catalog's `declaredNode` gives the node the rules read, for a lexicon
|
|
@@ -274,6 +289,14 @@ export function runCatalogPass(nodes, catalogs, members, lookPath, readFile) {
|
|
|
274
289
|
expansions,
|
|
275
290
|
};
|
|
276
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* An index document's nodes as members of a catalog pass (#5245): each in the
|
|
294
|
+
* member the document's scope key names, so they sit beside a cluster's
|
|
295
|
+
* objects or a workspace's members in one {@link runCatalogPass}.
|
|
296
|
+
*/
|
|
297
|
+
export function indexedMemberNodes(doc) {
|
|
298
|
+
return doc.graph.nodes.map((n) => ({ ...n, member: doc.stamp.scopeKey }));
|
|
299
|
+
}
|
|
277
300
|
/** A rule path's first step, the `viaAttr` an edge it draws carries, as the pass's own rules do. */
|
|
278
301
|
const refViaAttr = (path) => path.split(/[.[]/)[0] || path;
|
|
279
302
|
/** The repository paths the nodes name that `lookPath` does not find (#5102). */
|
|
@@ -153,6 +153,7 @@ export declare function tagHistoryRelease(top: string, shapes: readonly VersionT
|
|
|
153
153
|
export declare function releaseSettingsAt(dir: string): Promise<{
|
|
154
154
|
legacyTags: string[];
|
|
155
155
|
breakingOnZero?: "minor" | "major";
|
|
156
|
+
sources?: string[];
|
|
156
157
|
}>;
|
|
157
158
|
/**
|
|
158
159
|
* The settings for the member at `memberDir` (#5200, #5191): its own
|
|
@@ -166,6 +167,7 @@ export declare function memberReleaseSettings(memberDir: string, root?: {
|
|
|
166
167
|
}): Promise<{
|
|
167
168
|
legacyTags: string[];
|
|
168
169
|
breakingOnZero: "minor" | "major";
|
|
170
|
+
sources: string[];
|
|
169
171
|
}>;
|
|
170
172
|
/**
|
|
171
173
|
* The bump a commit gives on the version `label` (#5191): on 0.x, unless
|
|
@@ -348,7 +348,7 @@ export async function releaseSettingsAt(dir) {
|
|
|
348
348
|
try {
|
|
349
349
|
const { loadChantConfig } = await import("../config.js");
|
|
350
350
|
const release = (await loadChantConfig(dir)).config.release;
|
|
351
|
-
return { legacyTags: [...(release?.legacyTags ?? [])], ...(release?.breakingOnZero ? { breakingOnZero: release.breakingOnZero } : {}) };
|
|
351
|
+
return { legacyTags: [...(release?.legacyTags ?? [])], ...(release?.breakingOnZero ? { breakingOnZero: release.breakingOnZero } : {}), ...(release?.sources ? { sources: [...release.sources] } : {}) };
|
|
352
352
|
}
|
|
353
353
|
catch {
|
|
354
354
|
return { legacyTags: [] };
|
|
@@ -373,6 +373,8 @@ export async function memberReleaseSettings(memberDir, root) {
|
|
|
373
373
|
return {
|
|
374
374
|
legacyTags: [...new Set([...own.legacyTags, ...rootSettings.legacyTags])],
|
|
375
375
|
breakingOnZero: own.breakingOnZero ?? rootSettings.breakingOnZero ?? "minor",
|
|
376
|
+
// #5271: the member's own; a root's sources are not its members'.
|
|
377
|
+
sources: own.sources ?? [],
|
|
376
378
|
};
|
|
377
379
|
}
|
|
378
380
|
function realpathOr(p) {
|
|
@@ -486,6 +488,9 @@ async function read(query) {
|
|
|
486
488
|
const settings = await memberReleaseSettings(memberDir, { dir: rootDir, settings: rootSettings });
|
|
487
489
|
const last = ledger.last ?? (settings.legacyTags.length > rootSettings.legacyTags.length ? legacyRelease(top, settings.legacyTags) : legacyLast);
|
|
488
490
|
let paths = [];
|
|
491
|
+
// #5271: release.sources, as paths from the outermost root; "" is the whole of it.
|
|
492
|
+
const sources = settings.sources.map((s) => posix(relative(outerDir, resolve(memberDir, s)))).filter((s) => s !== ".." && !s.startsWith("../")).map((s) => (s === "." ? "" : s));
|
|
493
|
+
const fromSources = (path) => sources.some((s) => s === "" || path === s || path.startsWith(`${s}/`));
|
|
489
494
|
if (last) {
|
|
490
495
|
if (tryGit(top, ["cat-file", "-e", `${last.commit}^{commit}`]) === null)
|
|
491
496
|
throw new ReadFailure("ledger-unreadable", `the last release of ${m.name} is at ${last.commit.slice(0, 12)}, which this clone does not have`);
|
|
@@ -494,7 +499,7 @@ async function read(query) {
|
|
|
494
499
|
const path = outerFromTop === "." || outerFromTop === "" ? file : file.startsWith(`${outerFromTop}/`) ? file.slice(outerFromTop.length + 1) : null;
|
|
495
500
|
if (path === null)
|
|
496
501
|
continue;
|
|
497
|
-
if (memberHolding(path, outer.members) !== m.name && !(outerMemberOf(m.name) === undefined && memberHolding(path, declaration.members) === m.name))
|
|
502
|
+
if (memberHolding(path, outer.members) !== m.name && !(outerMemberOf(m.name) === undefined && memberHolding(path, declaration.members) === m.name) && !fromSources(path))
|
|
498
503
|
continue;
|
|
499
504
|
if (ignore.some((match) => match(path)))
|
|
500
505
|
continue;
|
|
@@ -3,7 +3,8 @@ export const doctorFeature = {
|
|
|
3
3
|
steps: (c) => {
|
|
4
4
|
if (!c.doctor)
|
|
5
5
|
return [];
|
|
6
|
-
|
|
6
|
+
// The cut job runs without id-token: write, which only the publish job holds, so the doctor there is told where it is.
|
|
7
|
+
const items = [`${c.chant} release doctor${c.shape === "dispatch" && c.job === "cut" ? " --from cut" : ""}`];
|
|
7
8
|
if (c.shape !== "dispatch")
|
|
8
9
|
return c.job === "publish" ? [{ slot: "prepare", order: 10, items }] : [];
|
|
9
10
|
if (c.job !== "cut")
|
|
@@ -2,15 +2,18 @@ import type { ReleasePipelineConfig, ReleaseWorkflowForge } from "../release-wor
|
|
|
2
2
|
import { type ReleaseWorkflowFeature } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* What a job that builds goreleaser entries runs first (#5151): Go from the
|
|
5
|
-
* member's `go.mod` (GitHub and Forgejo, unless
|
|
6
|
-
* names `actions/setup-go`),
|
|
5
|
+
* member's `go.mod` (GitHub and Forgejo, unless the job's toolchains set Go
|
|
6
|
+
* up already or `release.workflow.setup` names `actions/setup-go`), without
|
|
7
|
+
* a cache like every other setup step, then the pinned goreleaser, downloaded, checked
|
|
7
8
|
* by SHA-256 and named by `CHANT_GORELEASER`. A config that sets
|
|
8
9
|
* `CHANT_GORELEASER` in `release.workflow.env` gets no install. GitLab
|
|
9
10
|
* jobs run in the project's image, which brings its own Go.
|
|
10
11
|
*/
|
|
11
|
-
export declare function goreleaserSetup(forge: ReleaseWorkflowForge, root: string | null, p: ReleasePipelineConfig): {
|
|
12
|
+
export declare function goreleaserSetup(forge: ReleaseWorkflowForge, root: string | null, p: ReleasePipelineConfig, goSetUp?: boolean): {
|
|
12
13
|
github: string[];
|
|
13
14
|
gitlab: string[];
|
|
14
15
|
};
|
|
16
|
+
/** The job's toolchains (#5152) set Go up already, from `release.workflow.toolchains` or a `go.mod` at the project's root (#5268). */
|
|
17
|
+
export declare function setsUpGo(p: ReleasePipelineConfig, projectFiles: readonly string[] | undefined, root: string | null): boolean;
|
|
15
18
|
/** In the job that builds the files: a dispatched release's cut, or a tag's publish. */
|
|
16
19
|
export declare const goreleaserFeature: ReleaseWorkflowFeature;
|
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
/** goreleaser for the `release.artifacts` entries it builds (#5151). */
|
|
2
2
|
import { ACTION_PINS, usesRef } from "../../action-pins.js";
|
|
3
3
|
import { TOOL_PINS, toolInstallLine } from "../../tool-pins.js";
|
|
4
|
+
import { buildJobToolchains } from "../release-toolchains.js";
|
|
4
5
|
import { RELEASE_RUNNER_PLATFORM } from "./types.js";
|
|
5
6
|
/**
|
|
6
7
|
* What a job that builds goreleaser entries runs first (#5151): Go from the
|
|
7
|
-
* member's `go.mod` (GitHub and Forgejo, unless
|
|
8
|
-
* names `actions/setup-go`),
|
|
8
|
+
* member's `go.mod` (GitHub and Forgejo, unless the job's toolchains set Go
|
|
9
|
+
* up already or `release.workflow.setup` names `actions/setup-go`), without
|
|
10
|
+
* a cache like every other setup step, then the pinned goreleaser, downloaded, checked
|
|
9
11
|
* by SHA-256 and named by `CHANT_GORELEASER`. A config that sets
|
|
10
12
|
* `CHANT_GORELEASER` in `release.workflow.env` gets no install. GitLab
|
|
11
13
|
* jobs run in the project's image, which brings its own Go.
|
|
12
14
|
*/
|
|
13
|
-
export function goreleaserSetup(forge, root, p) {
|
|
15
|
+
export function goreleaserSetup(forge, root, p, goSetUp = false) {
|
|
14
16
|
const install = p.env?.CHANT_GORELEASER === undefined;
|
|
15
17
|
if (forge === "gitlab") {
|
|
16
18
|
return { github: [], gitlab: install ? [`${toolInstallLine(TOOL_PINS.goreleaser, RELEASE_RUNNER_PLATFORM, "/tmp/goreleaser")} && export CHANT_GORELEASER=/tmp/goreleaser/goreleaser`] : [] };
|
|
17
19
|
}
|
|
18
|
-
const go = (p.setup ?? []).some((s) => "uses" in s && /^actions\/setup-go@/.test(s.uses))
|
|
20
|
+
const go = goSetUp || (p.setup ?? []).some((s) => "uses" in s && /^actions\/setup-go@/.test(s.uses))
|
|
19
21
|
? []
|
|
20
|
-
: [` - uses: ${usesRef(ACTION_PINS.setupGo7)}`, " with:", ` go-version-file: ${root ? `${root}/` : ""}go.mod
|
|
22
|
+
: [` - uses: ${usesRef(ACTION_PINS.setupGo7)}`, " with:", ` go-version-file: ${root ? `${root}/` : ""}go.mod`, " cache: false"];
|
|
21
23
|
const line = `${toolInstallLine(TOOL_PINS.goreleaser, RELEASE_RUNNER_PLATFORM, "$RUNNER_TEMP/goreleaser")} && echo "CHANT_GORELEASER=$RUNNER_TEMP/goreleaser/goreleaser" >> "$GITHUB_ENV"`;
|
|
22
24
|
return { github: [...go, ...(install ? [` - name: goreleaser ${TOOL_PINS.goreleaser.version}`, ` run: ${JSON.stringify(line)}`] : [])], gitlab: [] };
|
|
23
25
|
}
|
|
26
|
+
/** The job's toolchains (#5152) set Go up already, from `release.workflow.toolchains` or a `go.mod` at the project's root (#5268). */
|
|
27
|
+
export function setsUpGo(p, projectFiles, root) {
|
|
28
|
+
return buildJobToolchains(p.toolchains, projectFiles, root).some((t) => t.name === "go");
|
|
29
|
+
}
|
|
24
30
|
/** In the job that builds the files: a dispatched release's cut, or a tag's publish. */
|
|
25
31
|
export const goreleaserFeature = {
|
|
26
32
|
name: "goreleaser",
|
|
@@ -29,7 +35,7 @@ export const goreleaserFeature = {
|
|
|
29
35
|
return [];
|
|
30
36
|
if (c.job !== (c.shape === "dispatch" ? "cut" : "publish"))
|
|
31
37
|
return [];
|
|
32
|
-
const g = goreleaserSetup(c.forge, c.root, c.pipeline);
|
|
38
|
+
const g = goreleaserSetup(c.forge, c.root, c.pipeline, setsUpGo(c.pipeline, c.input.projectFiles, c.root));
|
|
33
39
|
const items = c.forge !== "gitlab" ? [{ lines: g.github }] : c.shape === "dispatch" ? g.gitlab : [{ lines: g.gitlab.map((l) => ` - ${JSON.stringify(l)}`) }];
|
|
34
40
|
return [{ slot: "prepare", order: 20, items }];
|
|
35
41
|
},
|
|
@@ -30,6 +30,12 @@ export declare function toolchainStep(decl: ReleaseToolchainDecl, files: Readonl
|
|
|
30
30
|
* first for a job that runs chant, at the declared version when there is one.
|
|
31
31
|
*/
|
|
32
32
|
export declare function resolveToolchains(decl: readonly ReleaseToolchainDecl[] | false | undefined, files: ReadonlySet<string>, root: string | null, withNode: boolean): ToolchainStep[];
|
|
33
|
+
/**
|
|
34
|
+
* The toolchains a job that builds sets up (#5152): `release.workflow.toolchains`,
|
|
35
|
+
* or those the project's root files name, with Node first. A caller that
|
|
36
|
+
* knows no project files sets up Node alone.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildJobToolchains(decl: readonly ReleaseToolchainDecl[] | false | undefined, projectFiles: readonly string[] | undefined, root: string | null): ToolchainStep[];
|
|
33
39
|
/** A step's lines in a GitHub or Forgejo job. Node renders as it always has: its inputs unquoted. */
|
|
34
40
|
export declare function toolchainLines(steps: readonly ToolchainStep[]): string[];
|
|
35
41
|
/**
|
|
@@ -96,6 +96,14 @@ export function resolveToolchains(decl, files, root, withNode) {
|
|
|
96
96
|
list.sort((a, b) => (named(a) === "node" ? -1 : named(b) === "node" ? 1 : 0));
|
|
97
97
|
return list.map((d) => toolchainStep(d, files, root));
|
|
98
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* The toolchains a job that builds sets up (#5152): `release.workflow.toolchains`,
|
|
101
|
+
* or those the project's root files name, with Node first. A caller that
|
|
102
|
+
* knows no project files sets up Node alone.
|
|
103
|
+
*/
|
|
104
|
+
export function buildJobToolchains(decl, projectFiles, root) {
|
|
105
|
+
return resolveToolchains(decl, new Set(projectFiles ?? (decl === undefined ? ["package.json"] : [])), root, true);
|
|
106
|
+
}
|
|
99
107
|
/** A step's lines in a GitHub or Forgejo job. Node renders as it always has: its inputs unquoted. */
|
|
100
108
|
export function toolchainLines(steps) {
|
|
101
109
|
return steps.flatMap((s) => [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReleaseGreenSource } from "../lifecycle/release-green.js";
|
|
2
2
|
import { type JobExtras, type ReleaseWorkflowForge } from "./release-workflow.js";
|
|
3
|
+
import { type ReleaseBuildConfig } from "./release-toolchains.js";
|
|
3
4
|
export interface TrainWorkflowInput {
|
|
4
5
|
forge: ReleaseWorkflowForge;
|
|
5
6
|
env: string;
|
|
@@ -40,7 +41,24 @@ export interface TrainWorkflowInput {
|
|
|
40
41
|
doctor?: boolean;
|
|
41
42
|
/** `verified-releases`: `chant workspace train verify` before the publish (#5216). */
|
|
42
43
|
verify?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The members' per-platform builds (#5237), with `trigger: "dispatch"`
|
|
46
|
+
* only. The gate plans the train (`train cut --plan-only`) and gives each
|
|
47
|
+
* build job the label its member is planned at; a member not in the train
|
|
48
|
+
* builds nothing. The cut job unpacks each archive into its member and
|
|
49
|
+
* cuts with `--planned`, so a train labelled otherwise than the builds
|
|
50
|
+
* were is refused with nothing cut. The publish job of the same run
|
|
51
|
+
* unpacks them again.
|
|
52
|
+
*/
|
|
53
|
+
builds?: TrainBuild[];
|
|
43
54
|
}
|
|
55
|
+
/** A member's build job (#5237): the member, its directory from the workspace root, the directory it runs in from the checkout, and its toolchain steps. */
|
|
56
|
+
export type TrainBuild = ReleaseBuildConfig & {
|
|
57
|
+
member: string;
|
|
58
|
+
memberDir: string;
|
|
59
|
+
path: string;
|
|
60
|
+
setup: string[];
|
|
61
|
+
};
|
|
44
62
|
/** The tag a train's cut pushes, as a GitHub tag filter: `*` stops at `/`, so a member's own tag starts nothing. */
|
|
45
63
|
export declare function trainTagFilter(env: string): string;
|
|
46
64
|
/**
|