@intentius/chant 0.124.100 → 0.124.102
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/action-pins.d.ts +2 -0
- package/dist/action-pins.js +3 -0
- package/dist/ci-detect.d.ts +13 -0
- package/dist/ci-detect.js +12 -0
- package/dist/ci-evidence-claims.d.ts +12 -0
- package/dist/ci-evidence-claims.js +12 -0
- package/dist/ci-system.d.ts +66 -0
- package/dist/ci-system.js +61 -0
- package/dist/cli/handlers/build.js +27 -0
- package/dist/cli/handlers/release-doctor.d.ts +12 -0
- package/dist/cli/handlers/release-doctor.js +118 -0
- package/dist/cli/handlers/release-init.d.ts +10 -0
- package/dist/cli/handlers/release-init.js +374 -0
- package/dist/cli/handlers/release.d.ts +43 -2
- package/dist/cli/handlers/release.js +667 -39
- package/dist/cli/handlers/run-generate.js +11 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +44 -101
- package/dist/cli/parse-args.js +48 -0
- package/dist/cli/registry.d.ts +16 -0
- package/dist/cli/release-commands/artifacts.d.ts +3 -0
- package/dist/cli/release-commands/artifacts.js +14 -0
- package/dist/cli/release-commands/candidates.d.ts +3 -0
- package/dist/cli/release-commands/candidates.js +16 -0
- package/dist/cli/release-commands/changed.d.ts +3 -0
- package/dist/cli/release-commands/changed.js +14 -0
- package/dist/cli/release-commands/compose.d.ts +3 -0
- package/dist/cli/release-commands/compose.js +16 -0
- package/dist/cli/release-commands/cut.d.ts +3 -0
- package/dist/cli/release-commands/cut.js +50 -0
- package/dist/cli/release-commands/doctor.d.ts +3 -0
- package/dist/cli/release-commands/doctor.js +14 -0
- package/dist/cli/release-commands/export.d.ts +3 -0
- package/dist/cli/release-commands/export.js +12 -0
- package/dist/cli/release-commands/images.d.ts +3 -0
- package/dist/cli/release-commands/images.js +13 -0
- package/dist/cli/release-commands/index.d.ts +8 -0
- package/dist/cli/release-commands/index.js +52 -0
- package/dist/cli/release-commands/init.d.ts +3 -0
- package/dist/cli/release-commands/init.js +19 -0
- package/dist/cli/release-commands/list.d.ts +3 -0
- package/dist/cli/release-commands/list.js +10 -0
- package/dist/cli/release-commands/next.d.ts +3 -0
- package/dist/cli/release-commands/next.js +13 -0
- package/dist/cli/release-commands/publish.d.ts +3 -0
- package/dist/cli/release-commands/publish.js +22 -0
- package/dist/cli/release-commands/stamp.d.ts +3 -0
- package/dist/cli/release-commands/stamp.js +15 -0
- package/dist/cli/release-commands/status.d.ts +3 -0
- package/dist/cli/release-commands/status.js +17 -0
- package/dist/cli/release-commands/tag.d.ts +3 -0
- package/dist/cli/release-commands/tag.js +12 -0
- package/dist/cli/release-commands/types.d.ts +20 -0
- package/dist/cli/release-commands/types.js +1 -0
- package/dist/cli/release-commands/verify.d.ts +3 -0
- package/dist/cli/release-commands/verify.js +15 -0
- package/dist/cli/release-commands/workflow.d.ts +3 -0
- package/dist/cli/release-commands/workflow.js +15 -0
- package/dist/cloud-lister/index.d.ts +4 -1
- package/dist/cloud-lister/index.js +2 -1
- package/dist/cloud-lister/kubernetes-components.d.ts +56 -0
- package/dist/cloud-lister/kubernetes-components.js +642 -0
- package/dist/cloud-lister/kubernetes.d.ts +18 -0
- package/dist/cloud-lister/kubernetes.js +26 -1
- package/dist/cloud-lister/mask.d.ts +5 -1
- package/dist/cloud-lister/mask.js +14 -5
- package/dist/components/cli-support.d.ts +1 -1
- package/dist/components/cli-support.js +1 -1
- package/dist/config-environments.d.ts +8 -1
- package/dist/config-environments.js +2 -0
- package/dist/config-import.d.ts +1 -1
- package/dist/config-import.js +6 -2
- package/dist/config-sandbox.d.ts +1 -1
- package/dist/config-sandbox.js +3 -3
- package/dist/config.d.ts +369 -10
- package/dist/config.js +127 -7
- package/dist/deep-observation.js +9 -3
- package/dist/floor-table.data.js +21 -1
- package/dist/forge-remote.d.ts +13 -0
- package/dist/forge-remote.js +15 -0
- package/dist/lexicon.d.ts +45 -4
- package/dist/lifecycle/__fixtures__/package-files.d.ts +32 -0
- package/dist/lifecycle/__fixtures__/package-files.js +72 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.d.ts +62 -0
- package/dist/lifecycle/__fixtures__/publish-fakes.js +275 -3
- package/dist/lifecycle/publish-attachments.d.ts +2 -1
- package/dist/lifecycle/publish-attachments.js +19 -2
- package/dist/lifecycle/publish-cargo.d.ts +99 -0
- package/dist/lifecycle/publish-cargo.js +412 -0
- package/dist/lifecycle/publish-credentials.d.ts +1 -1
- package/dist/lifecycle/publish-credentials.js +13 -0
- package/dist/lifecycle/publish-declaration.d.ts +322 -4
- package/dist/lifecycle/publish-declaration.js +340 -9
- package/dist/lifecycle/publish-forge.d.ts +45 -2
- package/dist/lifecycle/publish-forge.js +434 -34
- package/dist/lifecycle/publish-git-ssh.d.ts +15 -0
- package/dist/lifecycle/publish-git-ssh.js +30 -4
- package/dist/lifecycle/publish-github.d.ts +40 -2
- package/dist/lifecycle/publish-github.js +100 -3
- package/dist/lifecycle/publish-helm.d.ts +83 -0
- package/dist/lifecycle/publish-helm.js +452 -0
- package/dist/lifecycle/publish-homebrew.d.ts +7 -9
- package/dist/lifecycle/publish-homebrew.js +34 -197
- package/dist/lifecycle/publish-index.d.ts +141 -0
- package/dist/lifecycle/publish-index.js +719 -0
- package/dist/lifecycle/publish-marketplace.js +77 -0
- package/dist/lifecycle/publish-maven.d.ts +79 -0
- package/dist/lifecycle/publish-maven.js +364 -0
- package/dist/lifecycle/publish-mcp-registry.d.ts +66 -0
- package/dist/lifecycle/publish-mcp-registry.js +305 -0
- package/dist/lifecycle/publish-npm.d.ts +27 -1
- package/dist/lifecycle/publish-npm.js +216 -3
- package/dist/lifecycle/publish-nuget.d.ts +93 -0
- package/dist/lifecycle/publish-nuget.js +377 -0
- package/dist/lifecycle/publish-oci.d.ts +91 -2
- package/dist/lifecycle/publish-oci.js +247 -8
- package/dist/lifecycle/publish-package-files.d.ts +16 -0
- package/dist/lifecycle/publish-package-files.js +39 -0
- package/dist/lifecycle/publish-pypi.d.ts +138 -0
- package/dist/lifecycle/publish-pypi.js +657 -0
- package/dist/lifecycle/publish-record.d.ts +6 -3
- package/dist/lifecycle/publish-record.js +6 -3
- package/dist/lifecycle/publish-rubygems.d.ts +84 -0
- package/dist/lifecycle/publish-rubygems.js +366 -0
- package/dist/lifecycle/publish-signing.d.ts +147 -0
- package/dist/lifecycle/publish-signing.js +257 -0
- package/dist/lifecycle/publish-targets.d.ts +37 -1
- package/dist/lifecycle/publish-targets.js +102 -0
- package/dist/lifecycle/publish-tauri.js +43 -0
- package/dist/lifecycle/publish-train-names.d.ts +57 -0
- package/dist/lifecycle/publish-train-names.js +123 -0
- package/dist/lifecycle/publish-verify.d.ts +121 -0
- package/dist/lifecycle/publish-verify.js +130 -0
- package/dist/lifecycle/query.js +8 -0
- package/dist/lifecycle/release-artifacts.d.ts +290 -0
- package/dist/lifecycle/release-artifacts.js +808 -0
- package/dist/lifecycle/release-changelog.d.ts +13 -1
- package/dist/lifecycle/release-changelog.js +35 -2
- package/dist/lifecycle/release-cut.d.ts +64 -4
- package/dist/lifecycle/release-cut.js +147 -34
- package/dist/lifecycle/release-doctor.d.ts +113 -0
- package/dist/lifecycle/release-doctor.js +1198 -0
- package/dist/lifecycle/release-green.d.ts +86 -0
- package/dist/lifecycle/release-green.js +286 -0
- package/dist/lifecycle/release-init-registries.d.ts +48 -0
- package/dist/lifecycle/release-init-registries.js +97 -0
- package/dist/lifecycle/release-init.d.ts +275 -0
- package/dist/lifecycle/release-init.js +984 -0
- package/dist/lifecycle/release-intents.d.ts +73 -0
- package/dist/lifecycle/release-intents.js +128 -0
- package/dist/lifecycle/release-next.d.ts +111 -0
- package/dist/lifecycle/release-next.js +251 -0
- package/dist/lifecycle/release-prerelease.d.ts +19 -0
- package/dist/lifecycle/release-prerelease.js +30 -0
- package/dist/lifecycle/release-publish.d.ts +256 -10
- package/dist/lifecycle/release-publish.js +247 -35
- package/dist/lifecycle/release-status-change.d.ts +226 -0
- package/dist/lifecycle/release-status-change.js +478 -0
- package/dist/lifecycle/release-status.d.ts +11 -0
- package/dist/lifecycle/release-status.js +1 -1
- package/dist/lifecycle/release-store.d.ts +73 -2
- package/dist/lifecycle/release-store.js +32 -1
- package/dist/lifecycle/release-tag.d.ts +142 -0
- package/dist/lifecycle/release-tag.js +322 -0
- package/dist/lifecycle/release-verify.d.ts +73 -1
- package/dist/lifecycle/release-verify.js +117 -2
- package/dist/lifecycle/release-version-formats.d.ts +73 -0
- package/dist/lifecycle/release-version-formats.js +570 -0
- package/dist/lifecycle/release-version.d.ts +58 -10
- package/dist/lifecycle/release-version.js +164 -36
- package/dist/lifecycle/release-workstation.d.ts +3 -2
- package/dist/lifecycle/release-workstation.js +3 -2
- package/dist/op/generate-pipeline.js +1 -1
- package/dist/op/local-executor.d.ts +1 -1
- package/dist/op/local-executor.js +2 -2
- package/dist/op/op-waves-evidence.js +9 -2
- package/dist/pr-forge-base.js +4 -2
- package/dist/pr-forge.d.ts +20 -2
- package/dist/pr-forge.js +46 -10
- package/dist/release-floors.d.ts +8 -1
- package/dist/release-floors.js +9 -2
- package/dist/sensitive-key.d.ts +12 -0
- package/dist/sensitive-key.js +52 -0
- package/dist/tool-pins.d.ts +40 -0
- package/dist/tool-pins.js +66 -0
- package/dist/ts-loader.d.ts +8 -0
- package/dist/ts-loader.js +19 -0
- package/dist/wave-runtime.mjs +345 -342
- package/dist/workspace/ci-forge.d.ts +17 -0
- package/dist/workspace/ci-forge.js +17 -0
- package/dist/workspace/ci-init.js +1 -1
- package/dist/workspace/composites.schema.json +1 -0
- package/dist/workspace/declaration.d.ts +8 -0
- package/dist/workspace/declaration.js +12 -0
- package/dist/workspace/declaration.schema.json +8 -0
- package/dist/workspace/environments.d.ts +2 -0
- package/dist/workspace/environments.js +1 -1
- package/dist/workspace/identity-gate-rule.d.ts +61 -5
- package/dist/workspace/identity-gate-rule.js +81 -12
- package/dist/workspace/lexicon-outputs.d.ts +1 -1
- package/dist/workspace/lexicon-outputs.js +1 -1
- package/dist/workspace/member-pipeline.d.ts +2 -1
- package/dist/workspace/member-pipeline.js +5 -2
- package/dist/workspace/reason-codes.d.ts +2 -0
- package/dist/workspace/reason-codes.js +3 -1
- package/dist/workspace/release-changed.d.ts +75 -4
- package/dist/workspace/release-changed.js +205 -34
- package/dist/workspace/release-changed.schema.json +20 -2
- package/dist/workspace/release-steps/artifacts.d.ts +7 -0
- package/dist/workspace/release-steps/artifacts.js +45 -0
- package/dist/workspace/release-steps/builds.d.ts +12 -0
- package/dist/workspace/release-steps/builds.js +38 -0
- package/dist/workspace/release-steps/doctor.d.ts +8 -0
- package/dist/workspace/release-steps/doctor.js +14 -0
- package/dist/workspace/release-steps/goreleaser.d.ts +16 -0
- package/dist/workspace/release-steps/goreleaser.js +36 -0
- package/dist/workspace/release-steps/green.d.ts +3 -0
- package/dist/workspace/release-steps/green.js +6 -0
- package/dist/workspace/release-steps/images.d.ts +22 -0
- package/dist/workspace/release-steps/images.js +59 -0
- package/dist/workspace/release-steps/index.d.ts +9 -0
- package/dist/workspace/release-steps/index.js +50 -0
- package/dist/workspace/release-steps/nfpm.d.ts +13 -0
- package/dist/workspace/release-steps/nfpm.js +29 -0
- package/dist/workspace/release-steps/nuget.d.ts +14 -0
- package/dist/workspace/release-steps/nuget.js +16 -0
- package/dist/workspace/release-steps/pypi.d.ts +15 -0
- package/dist/workspace/release-steps/pypi.js +21 -0
- package/dist/workspace/release-steps/qemu.d.ts +21 -0
- package/dist/workspace/release-steps/qemu.js +35 -0
- package/dist/workspace/release-steps/signing.d.ts +18 -0
- package/dist/workspace/release-steps/signing.js +30 -0
- package/dist/workspace/release-steps/stamp.d.ts +3 -0
- package/dist/workspace/release-steps/stamp.js +4 -0
- package/dist/workspace/release-steps/targets.d.ts +31 -0
- package/dist/workspace/release-steps/targets.js +40 -0
- package/dist/workspace/release-steps/types.d.ts +104 -0
- package/dist/workspace/release-steps/types.js +2 -0
- package/dist/workspace/release-steps/verify.d.ts +3 -0
- package/dist/workspace/release-steps/verify.js +4 -0
- package/dist/workspace/release-toolchains.d.ts +59 -0
- package/dist/workspace/release-toolchains.js +133 -0
- package/dist/workspace/release-train-workflow.d.ts +36 -0
- package/dist/workspace/release-train-workflow.js +121 -0
- package/dist/workspace/release-train.d.ts +3 -1
- package/dist/workspace/release-train.js +20 -3
- package/dist/workspace/release-workflow.d.ts +183 -59
- package/dist/workspace/release-workflow.js +570 -201
- package/dist/workspace/releases.schema.json +70 -1
- package/dist/workspace/search-contract.d.ts +1 -1
- package/dist/workspace/security.js +9 -2
- package/dist/workspace/train-cut.d.ts +182 -0
- package/dist/workspace/train-cut.js +504 -0
- package/dist/workspace/train-prepare.d.ts +64 -0
- package/dist/workspace/train-prepare.js +313 -0
- package/dist/workspace/train-publish.d.ts +177 -0
- package/dist/workspace/train-publish.js +574 -0
- package/dist/workspace/train-range-labels.d.ts +33 -0
- package/dist/workspace/train-range-labels.js +109 -0
- package/dist/workspace/train-shell.d.ts +5 -0
- package/dist/workspace/train-shell.js +17 -0
- package/dist/workspace/trust/check-evidence-report.d.ts +3 -7
- package/dist/workspace/trust/check-evidence-report.js +3 -7
- package/dist/workspace/trust/seal.d.ts +13 -3
- package/dist/workspace/trust/seal.js +14 -4
- package/dist/workspace/work-cli.d.ts +3 -2
- package/dist/workspace/work-cli.js +3 -2
- package/dist/workspace/workspace-ledger.d.ts +14 -1
- package/dist/workspace/workspace-ledger.js +33 -7
- package/package.json +1 -1
|
@@ -194,7 +194,7 @@ export async function listKubernetes(ctx, target, retryDelays) {
|
|
|
194
194
|
nativeId: k.namespaced ? `${ns}/${meta.name}` : meta.name,
|
|
195
195
|
cloudIds: meta.uid ? [{ kind: "k8s-uid", value: meta.uid }] : [],
|
|
196
196
|
tags,
|
|
197
|
-
properties: maskKubernetesObject(obj),
|
|
197
|
+
properties: withWorkloadStatus(maskKubernetesObject(obj), item, k),
|
|
198
198
|
observedAt,
|
|
199
199
|
labels: true,
|
|
200
200
|
});
|
|
@@ -221,6 +221,31 @@ export async function listKubernetes(ctx, target, retryDelays) {
|
|
|
221
221
|
ctx.coverage.push({ listedType: k.listedType, location: l, ...listedVerdict(scope) });
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
+
const num = (v) => (typeof v === "number" && Number.isFinite(v) ? v : 0);
|
|
225
|
+
export function workloadStatusView(obj, group, kind) {
|
|
226
|
+
const status = obj.status;
|
|
227
|
+
if (!status || typeof status !== "object")
|
|
228
|
+
return undefined;
|
|
229
|
+
const spec = (obj.spec ?? {});
|
|
230
|
+
if (group === "apps" && (kind === "Deployment" || kind === "StatefulSet" || kind === "ReplicaSet")) {
|
|
231
|
+
return { readyReplicas: num(status.readyReplicas), desiredReplicas: typeof spec.replicas === "number" ? spec.replicas : 1 };
|
|
232
|
+
}
|
|
233
|
+
if (group === "apps" && kind === "DaemonSet") {
|
|
234
|
+
return { readyReplicas: num(status.numberReady), desiredReplicas: num(status.desiredNumberScheduled) };
|
|
235
|
+
}
|
|
236
|
+
if (group === "" && kind === "Pod") {
|
|
237
|
+
const containers = [...(Array.isArray(status.containerStatuses) ? status.containerStatuses : []), ...(Array.isArray(status.initContainerStatuses) ? status.initContainerStatuses : [])];
|
|
238
|
+
const restarts = containers.reduce((sum, c) => sum + num(c?.restartCount), 0);
|
|
239
|
+
const conditions = Array.isArray(status.conditions) ? status.conditions : [];
|
|
240
|
+
const ready = conditions.some((c) => c?.type === "Ready" && c?.status === "True");
|
|
241
|
+
return { ...(typeof status.phase === "string" ? { phase: status.phase } : {}), restarts, ready };
|
|
242
|
+
}
|
|
243
|
+
return undefined;
|
|
244
|
+
}
|
|
245
|
+
function withWorkloadStatus(masked, item, k) {
|
|
246
|
+
const view = workloadStatusView(item, k.group, k.kind);
|
|
247
|
+
return view ? { ...masked, workloadStatus: view } : masked;
|
|
248
|
+
}
|
|
224
249
|
/**
|
|
225
250
|
* A {@link KubernetesTarget} from a kubeconfig the caller names (its text,
|
|
226
251
|
* and the directory relative file paths resolve against). Static credentials
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
* one list chant's thin and deep observation paths share. behold carried a
|
|
8
8
|
* copy while the lister lived there; in chant it is the same list.
|
|
9
9
|
*
|
|
10
|
+
* A Kubernetes pod spec's Secret references keep the Secret's name and mask
|
|
11
|
+
* every other field (chant#5252, `podSecretNameView` in ../sensitive-key.ts),
|
|
12
|
+
* so a live read can tell which Secret a workload mounts.
|
|
13
|
+
*
|
|
10
14
|
* Beyond key names, two things are masked whole because their values are
|
|
11
15
|
* secrets whatever their keys are called:
|
|
12
16
|
* - a Kubernetes Secret's `data` and `stringData`, and its
|
|
@@ -23,7 +27,7 @@ export declare const MASKED = "<masked>";
|
|
|
23
27
|
* {@link MASKED}. Arrays of `{Key, Value}` / `{key, value}` pairs (AWS tags,
|
|
24
28
|
* some ARM shapes) are masked by the pair's key as well.
|
|
25
29
|
*/
|
|
26
|
-
export declare function maskValue(value: unknown): unknown;
|
|
30
|
+
export declare function maskValue(value: unknown, pattern?: string): unknown;
|
|
27
31
|
export declare function maskProperties(props: Record<string, unknown>): Record<string, unknown>;
|
|
28
32
|
export declare function maskTags(tags: Record<string, string>): Record<string, string>;
|
|
29
33
|
/**
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
* one list chant's thin and deep observation paths share. behold carried a
|
|
8
8
|
* copy while the lister lived there; in chant it is the same list.
|
|
9
9
|
*
|
|
10
|
+
* A Kubernetes pod spec's Secret references keep the Secret's name and mask
|
|
11
|
+
* every other field (chant#5252, `podSecretNameView` in ../sensitive-key.ts),
|
|
12
|
+
* so a live read can tell which Secret a workload mounts.
|
|
13
|
+
*
|
|
10
14
|
* Beyond key names, two things are masked whole because their values are
|
|
11
15
|
* secrets whatever their keys are called:
|
|
12
16
|
* - a Kubernetes Secret's `data` and `stringData`, and its
|
|
@@ -14,7 +18,7 @@
|
|
|
14
18
|
* repeats them;
|
|
15
19
|
* - any tag or label whose key matches the patterns.
|
|
16
20
|
*/
|
|
17
|
-
import { isReferenceField, isSensitiveKey, SENSITIVE_KEY_PATTERNS } from "../sensitive-key.js";
|
|
21
|
+
import { isReferenceField, isSensitiveKey, podSecretNameView, SENSITIVE_KEY_PATTERNS } from "../sensitive-key.js";
|
|
18
22
|
export { isSensitiveKey, SENSITIVE_KEY_PATTERNS };
|
|
19
23
|
/** What a masked value becomes. A fixed string, so a masked value never diffs. */
|
|
20
24
|
export const MASKED = "<masked>";
|
|
@@ -23,23 +27,28 @@ export const MASKED = "<masked>";
|
|
|
23
27
|
* {@link MASKED}. Arrays of `{Key, Value}` / `{key, value}` pairs (AWS tags,
|
|
24
28
|
* some ARM shapes) are masked by the pair's key as well.
|
|
25
29
|
*/
|
|
26
|
-
export function maskValue(value) {
|
|
30
|
+
export function maskValue(value, pattern = "") {
|
|
27
31
|
if (Array.isArray(value))
|
|
28
|
-
return value.map((v) => maskValue(v));
|
|
32
|
+
return value.map((v) => maskValue(v, `${pattern}[]`));
|
|
29
33
|
if (value === null || typeof value !== "object")
|
|
30
34
|
return value;
|
|
31
35
|
const obj = value;
|
|
32
36
|
const pairKey = typeof obj.Key === "string" ? obj.Key : typeof obj.key === "string" ? obj.key : undefined;
|
|
33
37
|
const out = {};
|
|
34
38
|
for (const [k, v] of Object.entries(obj)) {
|
|
35
|
-
|
|
39
|
+
const at = pattern ? `${pattern}.${k}` : k;
|
|
40
|
+
const view = isSensitiveKey(k) ? podSecretNameView(at, v, MASKED) : undefined;
|
|
41
|
+
if (view !== undefined) {
|
|
42
|
+
out[k] = view;
|
|
43
|
+
}
|
|
44
|
+
else if (isSensitiveKey(k) && !isReferenceField(k, v)) {
|
|
36
45
|
out[k] = MASKED;
|
|
37
46
|
}
|
|
38
47
|
else if (pairKey !== undefined && isSensitiveKey(pairKey) && (k === "Value" || k === "value")) {
|
|
39
48
|
out[k] = MASKED;
|
|
40
49
|
}
|
|
41
50
|
else {
|
|
42
|
-
out[k] = maskValue(v);
|
|
51
|
+
out[k] = maskValue(v, at);
|
|
43
52
|
}
|
|
44
53
|
}
|
|
45
54
|
return out;
|
|
@@ -101,7 +101,7 @@ export interface ComponentGraphResult {
|
|
|
101
101
|
}
|
|
102
102
|
/** Compute the components' dependency graph under `path`, for `chant graph --components`. */
|
|
103
103
|
export declare function computeComponentGraph(path: string, sandbox?: boolean, buildParams?: BuildParamProvenance[]): Promise<ComponentGraphResult>;
|
|
104
|
-
/** A generate-mode target lexicon name — any lexicon whose plugin implements `generateComponentPipeline` (gitlab, github, and
|
|
104
|
+
/** A generate-mode target lexicon name — any lexicon whose plugin implements `generateComponentPipeline` (gitlab, github, forgejo and prow today). */
|
|
105
105
|
export type GenerateLexicon = string;
|
|
106
106
|
/**
|
|
107
107
|
* The components an "all" run takes, in `discovered` order (chant #1522). A
|
|
@@ -200,7 +200,7 @@ buildParams) {
|
|
|
200
200
|
if (!plugin?.generateComponentPipeline) {
|
|
201
201
|
return {
|
|
202
202
|
success: false,
|
|
203
|
-
error: `Lexicon "${lexicon}" does not support generate mode (no generateComponentPipeline). GitLab, GitHub, and
|
|
203
|
+
error: `Lexicon "${lexicon}" does not support generate mode (no generateComponentPipeline). GitLab, GitHub, Forgejo and Prow are supported today.`,
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
const result = await discoverComponents(path, { sandbox, buildParams });
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* them. They import nothing at runtime, so ./components/pr-environment.ts and
|
|
5
5
|
* ./live-endpoint.ts use them without bundling the config loader.
|
|
6
6
|
*/
|
|
7
|
+
import type { CiSystem } from "./ci-system.js";
|
|
7
8
|
import type { ChantConfig } from "./config.js";
|
|
8
9
|
/**
|
|
9
10
|
* One project-declared environment (chant #1166). Historically always a bare
|
|
@@ -23,7 +24,9 @@ import type { ChantConfig } from "./config.js";
|
|
|
23
24
|
* `executor` names the forge and the committed workflow that deploys the
|
|
24
25
|
* environment (#4402), so a reader such as behold knows a release there runs
|
|
25
26
|
* through CI rather than a local `chant run`. chant declares and prints it
|
|
26
|
-
* (`chant workspace graph --composites`); it never dispatches it.
|
|
27
|
+
* (`chant workspace graph --composites`); it never dispatches it. Its `ci`
|
|
28
|
+
* names the CI system that runs the workflow when that is not the forge's
|
|
29
|
+
* own, such as `prow` for a GitHub repository (#5170).
|
|
27
30
|
*/
|
|
28
31
|
export type EnvironmentDeclaration = string | {
|
|
29
32
|
name: string;
|
|
@@ -33,9 +36,13 @@ export type EnvironmentDeclaration = string | {
|
|
|
33
36
|
};
|
|
34
37
|
/** The forges an environment's executor can name (#4402). */
|
|
35
38
|
export declare const EXECUTOR_FORGES: readonly ["github", "gitlab", "forgejo"];
|
|
39
|
+
/** The CI systems an environment's executor can name (#5170), as `CI_SYSTEMS` in ./ci-system.ts lists them. */
|
|
40
|
+
export declare const EXECUTOR_CI_SYSTEMS: readonly ["github", "gitlab", "forgejo", "prow"];
|
|
36
41
|
/** The forge workflow that deploys one environment (#4402). */
|
|
37
42
|
export interface EnvironmentExecutor {
|
|
38
43
|
forge: (typeof EXECUTOR_FORGES)[number];
|
|
44
|
+
/** The CI system that runs `workflow` (#5170). Absent, the forge's own: GitHub Actions, GitLab CI or Forgejo Actions. `prow` runs a GitHub repository's jobs, and `workflow` is then the job config file Prow loads. */
|
|
45
|
+
ci?: CiSystem;
|
|
39
46
|
/** The committed workflow file the forge runs, such as `deploy-prod.yml` under `.github/workflows/`, or `.gitlab-ci.yml`. */
|
|
40
47
|
workflow: string;
|
|
41
48
|
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/** The forges an environment's executor can name (#4402). */
|
|
8
8
|
export const EXECUTOR_FORGES = ["github", "gitlab", "forgejo"];
|
|
9
|
+
/** The CI systems an environment's executor can name (#5170), as `CI_SYSTEMS` in ./ci-system.ts lists them. */
|
|
10
|
+
export const EXECUTOR_CI_SYSTEMS = ["github", "gitlab", "forgejo", "prow"];
|
|
9
11
|
/** The declared name of one `environments` entry, whichever form it takes. */
|
|
10
12
|
export function environmentName(entry) {
|
|
11
13
|
return typeof entry === "string" ? entry : entry.name;
|
package/dist/config-import.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type ConfigModuleNamespace = Record<string, unknown>;
|
|
|
23
23
|
* Node's ESM registry caches it, so repeated loads within one CLI invocation
|
|
24
24
|
* evaluate the file once — the behavior `loadChantConfig` has always had.
|
|
25
25
|
*/
|
|
26
|
-
export declare function importConfigModule(configPath: string): Promise<ConfigModuleNamespace>;
|
|
26
|
+
export declare function importConfigModule(configPath: string, fresh?: boolean): Promise<ConfigModuleNamespace>;
|
|
27
27
|
/**
|
|
28
28
|
* `require()` a `chant.config.ts` into THIS process from `dir`'s resolution
|
|
29
29
|
* context — the synchronous path `./lint/config.ts`'s `loadConfig` has used
|
package/dist/config-import.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
let freshLoads = 0;
|
|
3
5
|
import { ensureTypeScriptLoader } from "./ts-loader.js";
|
|
4
6
|
/**
|
|
5
7
|
* Import a `chant.config.ts` into THIS process and return its module namespace.
|
|
6
8
|
* Node's ESM registry caches it, so repeated loads within one CLI invocation
|
|
7
9
|
* evaluate the file once — the behavior `loadChantConfig` has always had.
|
|
8
10
|
*/
|
|
9
|
-
export async function importConfigModule(configPath) {
|
|
11
|
+
export async function importConfigModule(configPath, fresh = false) {
|
|
10
12
|
ensureTypeScriptLoader();
|
|
11
|
-
|
|
13
|
+
// `fresh` re-evaluates the config file itself: a query string makes the specifier a new module. Files it imports stay cached.
|
|
14
|
+
const specifier = fresh ? `${pathToFileURL(configPath).href}?fresh=${++freshLoads}` : configPath;
|
|
15
|
+
return (await import(specifier));
|
|
12
16
|
}
|
|
13
17
|
/**
|
|
14
18
|
* `require()` a `chant.config.ts` into THIS process from `dir`'s resolution
|
package/dist/config-sandbox.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function selectConfigExport(namespace: ConfigModuleNamespace): un
|
|
|
31
31
|
* @param projectRoot - Directory to grant the sandboxed child read access to;
|
|
32
32
|
* defaults to the config file's own directory.
|
|
33
33
|
*/
|
|
34
|
-
export declare function evaluateProjectConfig(configPath: string, projectRoot?: string): Promise<unknown>;
|
|
34
|
+
export declare function evaluateProjectConfig(configPath: string, projectRoot?: string, fresh?: boolean): Promise<unknown>;
|
|
35
35
|
/**
|
|
36
36
|
* Synchronous counterpart for `./lint/config.ts`'s `loadConfig` (`chant lint`
|
|
37
37
|
* is a sync pipeline and predates the async loader).
|
package/dist/config-sandbox.js
CHANGED
|
@@ -91,11 +91,11 @@ export function selectConfigExport(namespace) {
|
|
|
91
91
|
* @param projectRoot - Directory to grant the sandboxed child read access to;
|
|
92
92
|
* defaults to the config file's own directory.
|
|
93
93
|
*/
|
|
94
|
-
export async function evaluateProjectConfig(configPath, projectRoot = dirname(configPath)) {
|
|
94
|
+
export async function evaluateProjectConfig(configPath, projectRoot = dirname(configPath), fresh = false) {
|
|
95
95
|
if (!armed) {
|
|
96
|
-
return selectConfigExport(await importConfigModule(configPath));
|
|
96
|
+
return selectConfigExport(await importConfigModule(configPath, fresh));
|
|
97
97
|
}
|
|
98
|
-
if (memo.has(configPath))
|
|
98
|
+
if (!fresh && memo.has(configPath))
|
|
99
99
|
return memo.get(configPath);
|
|
100
100
|
// Dynamic, not static, for the same reason `./discovery/index.ts` imports
|
|
101
101
|
// `./sandbox/run` dynamically: this pulls in `esbuild`, a large CJS package
|