@intentius/chant 0.44.14 → 0.46.0
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/discover.d.ts +26 -2
- package/dist/audit/discover.d.ts.map +1 -1
- package/dist/audit/report-model.d.ts +10 -0
- package/dist/audit/report-model.d.ts.map +1 -1
- package/dist/audit/rules-doc.d.ts.map +1 -1
- package/dist/cli/build-params-cli.d.ts +16 -7
- package/dist/cli/build-params-cli.d.ts.map +1 -1
- package/dist/cli/commands/audit.d.ts +20 -0
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts +9 -0
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-docs.d.ts +13 -0
- package/dist/cli/commands/check-lexicon-docs.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon-examples.d.ts +24 -14
- package/dist/cli/commands/check-lexicon-examples.d.ts.map +1 -1
- package/dist/cli/commands/check-lexicon.d.ts +14 -0
- package/dist/cli/commands/check-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/codegen.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts +5 -0
- package/dist/cli/commands/init-lexicon/templates/docs.d.ts.map +1 -1
- package/dist/cli/commands/init-lexicon.d.ts.map +1 -1
- package/dist/cli/commands/lexicon-surface-diff.d.ts +6 -0
- package/dist/cli/commands/lexicon-surface-diff.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/onboard.d.ts +28 -0
- package/dist/cli/commands/onboard.d.ts.map +1 -1
- package/dist/cli/handlers/build.d.ts.map +1 -1
- package/dist/cli/handlers/graph.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts +13 -0
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/handlers/run.d.ts.map +1 -1
- package/dist/cli/handlers/search.d.ts +27 -0
- package/dist/cli/handlers/search.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +7 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/codegen/docs-pages.d.ts +39 -0
- package/dist/codegen/docs-pages.d.ts.map +1 -0
- package/dist/codegen/docs-sections.d.ts.map +1 -1
- package/dist/codegen/docs-sidebar.d.ts +13 -2
- package/dist/codegen/docs-sidebar.d.ts.map +1 -1
- package/dist/codegen/docs-types.d.ts +30 -10
- package/dist/codegen/docs-types.d.ts.map +1 -1
- package/dist/codegen/docs.d.ts +14 -2
- package/dist/codegen/docs.d.ts.map +1 -1
- package/dist/codegen/lexicon-regen.d.ts +11 -0
- package/dist/codegen/lexicon-regen.d.ts.map +1 -1
- package/dist/codegen/surface-snapshot.d.ts +27 -3
- package/dist/codegen/surface-snapshot.d.ts.map +1 -1
- package/dist/codegen/validate.d.ts +21 -3
- package/dist/codegen/validate.d.ts.map +1 -1
- package/dist/components/capability-plugin.d.ts +13 -2
- package/dist/components/capability-plugin.d.ts.map +1 -1
- package/dist/components/driver.d.ts +38 -0
- package/dist/components/driver.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/starter-plugin.d.ts.map +1 -1
- package/dist/config.d.ts +85 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/discovery/fold-import.d.ts.map +1 -1
- package/dist/env.d.ts +12 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/fold/fold.d.ts +100 -1
- package/dist/fold/fold.d.ts.map +1 -1
- package/dist/graph-ir.d.ts +12 -0
- package/dist/graph-ir.d.ts.map +1 -1
- package/dist/graph-ops.d.ts +17 -0
- package/dist/graph-ops.d.ts.map +1 -0
- package/dist/lexicon.d.ts +182 -2
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/change-set.d.ts +23 -2
- package/dist/lifecycle/change-set.d.ts.map +1 -1
- package/dist/lifecycle/deep-observe.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +1 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/observe.d.ts +8 -0
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lifecycle/replay.d.ts.map +1 -1
- package/dist/lifecycle/snapshot.d.ts.map +1 -1
- package/dist/lifecycle/teardown.d.ts +130 -0
- package/dist/lifecycle/teardown.d.ts.map +1 -0
- package/dist/lifecycle/types.d.ts +7 -0
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/lint/engine.d.ts +6 -2
- package/dist/lint/engine.d.ts.map +1 -1
- package/dist/lint/policy.d.ts.map +1 -1
- package/dist/lint/rule.d.ts +31 -0
- package/dist/lint/rule.d.ts.map +1 -1
- package/dist/lint/rules/cor021-env-literal-name.d.ts +3 -0
- package/dist/lint/rules/cor021-env-literal-name.d.ts.map +1 -0
- package/dist/lint/rules/index.d.ts +2 -1
- package/dist/lint/rules/index.d.ts.map +1 -1
- package/dist/managed-fields.d.ts +33 -21
- package/dist/managed-fields.d.ts.map +1 -1
- package/dist/observation.d.ts +23 -1
- package/dist/observation.d.ts.map +1 -1
- package/dist/op/builders.d.ts +36 -7
- package/dist/op/builders.d.ts.map +1 -1
- package/dist/op/index.d.ts +1 -1
- package/dist/op/index.d.ts.map +1 -1
- package/dist/testing.d.ts +136 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/yaml.d.ts +0 -8
- package/dist/yaml.d.ts.map +1 -1
- package/package.json +6 -1
- package/src/__snapshots__/okf.test.ts.snap +20 -0
- package/src/audit/discover.test.ts +55 -1
- package/src/audit/discover.ts +70 -2
- package/src/audit/edge-init-safety.test.ts +149 -18
- package/src/audit/report-model.ts +12 -1
- package/src/audit/rules-doc.ts +1 -0
- package/src/build-params.test.ts +52 -0
- package/src/cli/build-params-cli.test.ts +25 -8
- package/src/cli/build-params-cli.ts +37 -23
- package/src/cli/commands/__fixtures__/audit-coverage/.github/workflows/ci.yml +5 -0
- package/src/cli/commands/__fixtures__/audit-coverage/Dockerfile +2 -0
- package/src/cli/commands/__fixtures__/audit-coverage/infra/main.tf +3 -0
- package/src/cli/commands/__fixtures__/audit-coverage/infra/stack.json +6 -0
- package/src/cli/commands/__fixtures__/audit-coverage/k8s/deploy.yaml +12 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/pages/getting-started.mdx +16 -0
- package/src/cli/commands/__fixtures__/init-lexicon-output/docs/src/content.config.ts +10 -2
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/generate-cli.ts +3 -1
- package/src/cli/commands/__fixtures__/init-lexicon-output/src/codegen/generate.ts +2 -1
- package/src/cli/commands/__snapshots__/init-lexicon.test.ts.snap +2 -1
- package/src/cli/commands/audit.test.ts +83 -1
- package/src/cli/commands/audit.ts +121 -28
- package/src/cli/commands/build.test.ts +275 -5
- package/src/cli/commands/build.ts +86 -14
- package/src/cli/commands/check-lexicon-docs.ts +30 -0
- package/src/cli/commands/check-lexicon-examples.test.ts +73 -7
- package/src/cli/commands/check-lexicon-examples.ts +66 -17
- package/src/cli/commands/check-lexicon.test.ts +46 -2
- package/src/cli/commands/check-lexicon.ts +64 -4
- package/src/cli/commands/init-lexicon/templates/codegen.ts +5 -2
- package/src/cli/commands/init-lexicon/templates/docs.ts +35 -2
- package/src/cli/commands/init-lexicon.test.ts +42 -1
- package/src/cli/commands/init-lexicon.ts +3 -1
- package/src/cli/commands/lexicon-rolling-upgrade.ts +1 -1
- package/src/cli/commands/lexicon-surface-diff.test.ts +1 -1
- package/src/cli/commands/lexicon-surface-diff.ts +10 -1
- package/src/cli/commands/lexicon-surface-diff.update.test.ts +112 -0
- package/src/cli/commands/lint.ts +19 -6
- package/src/cli/commands/onboard.test.ts +319 -225
- package/src/cli/commands/onboard.ts +144 -58
- package/src/cli/handlers/build.test.ts +3 -3
- package/src/cli/handlers/build.ts +2 -0
- package/src/cli/handlers/components.ts +2 -2
- package/src/cli/handlers/graph.test.ts +44 -0
- package/src/cli/handlers/graph.ts +24 -4
- package/src/cli/handlers/lifecycle.test.ts +348 -1
- package/src/cli/handlers/lifecycle.ts +235 -3
- package/src/cli/handlers/run.test.ts +5 -5
- package/src/cli/handlers/run.ts +1 -0
- package/src/cli/handlers/search-live.test.ts +217 -0
- package/src/cli/handlers/search.test.ts +41 -1
- package/src/cli/handlers/search.ts +60 -8
- package/src/cli/main.ts +17 -4
- package/src/cli/registry.ts +7 -0
- package/src/cli/security-boundary.test.ts +2 -1
- package/src/codegen/docs-pages.test.ts +194 -0
- package/src/codegen/docs-pages.ts +138 -0
- package/src/codegen/docs-sections.ts +0 -8
- package/src/codegen/docs-sidebar.ts +50 -37
- package/src/codegen/docs-types.ts +32 -4
- package/src/codegen/docs.ts +78 -40
- package/src/codegen/lexicon-regen.ts +22 -2
- package/src/codegen/rolling-upgrade.test.ts +1 -1
- package/src/codegen/rolling-upgrade.ts +1 -1
- package/src/codegen/surface-snapshot.test.ts +139 -0
- package/src/codegen/surface-snapshot.ts +297 -122
- package/src/codegen/validate.test.ts +49 -3
- package/src/codegen/validate.ts +36 -7
- package/src/components/auto-release.ts +1 -1
- package/src/components/capability-plugin.ts +23 -2
- package/src/components/driver.test.ts +45 -0
- package/src/components/driver.ts +64 -27
- package/src/components/index.ts +2 -0
- package/src/components/starter-plugin.ts +5 -2
- package/src/config.test.ts +40 -0
- package/src/config.ts +159 -8
- package/src/discovery/fold-import.test.ts +427 -2
- package/src/discovery/fold-import.ts +163 -7
- package/src/discovery/sandbox/driver.test.ts +11 -0
- package/src/env.test.ts +35 -1
- package/src/env.ts +17 -3
- package/src/fold/fold.test.ts +41 -0
- package/src/fold/fold.ts +372 -2
- package/src/graph-ir-live.test.ts +42 -0
- package/src/graph-ir.ts +42 -2
- package/src/graph-ops.test.ts +69 -0
- package/src/graph-ops.ts +42 -0
- package/src/lexicon.ts +182 -2
- package/src/lifecycle/change-set.test.ts +41 -0
- package/src/lifecycle/change-set.ts +30 -2
- package/src/lifecycle/deep-observe.ts +4 -0
- package/src/lifecycle/index.ts +1 -0
- package/src/lifecycle/observe.ts +29 -2
- package/src/lifecycle/replay.ts +3 -0
- package/src/lifecycle/snapshot.ts +3 -0
- package/src/lifecycle/teardown.test.ts +537 -0
- package/src/lifecycle/teardown.ts +357 -0
- package/src/lifecycle/types.ts +7 -0
- package/src/lint/engine.ts +7 -1
- package/src/lint/policy.ts +14 -3
- package/src/lint/rule.ts +23 -0
- package/src/lint/rules/cor021-env-literal-name.test.ts +128 -0
- package/src/lint/rules/cor021-env-literal-name.ts +114 -0
- package/src/lint/rules/index.ts +4 -1
- package/src/managed-fields.test.ts +15 -42
- package/src/managed-fields.ts +43 -26
- package/src/observation.test.ts +24 -8
- package/src/observation.ts +48 -4
- package/src/op/builders.ts +40 -7
- package/src/op/index.ts +1 -1
- package/src/ownership.test.ts +63 -1
- package/src/testing.test.ts +261 -0
- package/src/testing.ts +338 -0
- package/src/yaml.test.ts +15 -0
- package/src/yaml.ts +19 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation.d.ts","sourceRoot":"","sources":["../src/observation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,gBAAgB,GAChB,YAAY,GACZ,kBAAkB,GAClB,UAAU,CAAC;AAEf,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,EAAE,SAAS,gBAAgB,EAMzD,CAAC;AAEF,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5E;AAED,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,qGA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AC,MAAM,CAAC,GAC/B,OAAO,CAAC,iBAAiB,CAAC,CAsD5B"}
|
package/dist/op/builders.d.ts
CHANGED
|
@@ -57,6 +57,33 @@ export declare const shell: (cmd: string, opts?: {
|
|
|
57
57
|
}) => ActivityStep;
|
|
58
58
|
/** Run `chant teardown` in the given project directory. Uses `longInfra` profile. */
|
|
59
59
|
export declare const teardown: (path: string) => ActivityStep;
|
|
60
|
+
/**
|
|
61
|
+
* Tear down one environment's marker-owned resources — the durable form of
|
|
62
|
+
* `chant lifecycle teardown <env> --yes` (#1222). The activity runs core's
|
|
63
|
+
* teardown engine in-process: enumerate by ownership marker (this project's
|
|
64
|
+
* `ownership.stack` + `env`), delete through each lexicon's `executeTeardown`
|
|
65
|
+
* capability, retry failures once, and fail the step when any candidate is
|
|
66
|
+
* still failed. Distinct from {@link teardown}, which runs a project's own
|
|
67
|
+
* `npm run teardown` script.
|
|
68
|
+
*
|
|
69
|
+
* The CLI's guards apply unchanged, and a production-like environment name
|
|
70
|
+
* needs `confirmProd: true` in `opts` — the authored counterpart of
|
|
71
|
+
* `--confirm-prod`, since an Op never prompts. An ordinary {@link gate} step
|
|
72
|
+
* placed before this one composes as usual (steps run in authored order), so
|
|
73
|
+
* a human approval can precede the deletion:
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
* phase("Teardown", [
|
|
77
|
+
* gate("approve-teardown", { description: "Release the staging teardown" }),
|
|
78
|
+
* envTeardown("staging"),
|
|
79
|
+
* ]),
|
|
80
|
+
* ```
|
|
81
|
+
*
|
|
82
|
+
* `opts` also accepts `path` (the chant project directory, default the
|
|
83
|
+
* worker's cwd). Defaults to the `longInfra` profile (override via
|
|
84
|
+
* `opts.profile`).
|
|
85
|
+
*/
|
|
86
|
+
export declare const envTeardown: (env: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
60
87
|
/**
|
|
61
88
|
* Create a local k3d cluster (vanilla Kubernetes in Docker). Idempotent: skips
|
|
62
89
|
* creation if a cluster of the same name already exists. Defaults to the
|
|
@@ -147,8 +174,8 @@ export declare const azDelete: (templatePath: string, opts?: Record<string, unkn
|
|
|
147
174
|
* Deploy a built CloudFormation template by calling the CloudFormation API
|
|
148
175
|
* directly (create-or-update + poll) — the direct twin of {@link azApply} /
|
|
149
176
|
* {@link gcpApply} for AWS, targeting a local Floci emulator or real AWS by
|
|
150
|
-
* endpoint override. Speaks the CFN API over HTTP rather than shelling `aws`
|
|
151
|
-
*
|
|
177
|
+
* endpoint override. Speaks the CFN API over HTTP rather than shelling `aws` —
|
|
178
|
+
* `nativeApply({ target: "cloudformation" })` routes here too (#1449). Provided by
|
|
152
179
|
* the aws lexicon; loaded when the project lists `aws`. Defaults to the
|
|
153
180
|
* `longInfra` profile. `opts` requires `stackName`; accepts `endpoint`, `region`,
|
|
154
181
|
* `capabilities`, `timeoutMs`, `intervalMs`.
|
|
@@ -157,13 +184,15 @@ export declare const awsApply: (templatePath: string, opts?: Record<string, unkn
|
|
|
157
184
|
/** Delete a CloudFormation stack — the inverse of {@link awsApply}. Defaults to the `longInfra` profile (override via `opts.profile`). `opts` requires `stackName`. */
|
|
158
185
|
export declare const awsDelete: (templatePath: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
159
186
|
/**
|
|
160
|
-
* Apply chant's built GCP (CNRM) resources directly to
|
|
187
|
+
* Apply chant's built GCP (CNRM) resources directly to their GCP REST APIs,
|
|
161
188
|
* targeting a local floci-gcp emulator or real GCP by endpoint override — the
|
|
162
|
-
* native GCP applier (#706 starter #711)
|
|
163
|
-
* Defaults to the `longInfra` profile (override via
|
|
189
|
+
* native GCP applier (#706 starter #711). `nativeApply({ target: "gcp" })`
|
|
190
|
+
* routes here too (#1449). Defaults to the `longInfra` profile (override via
|
|
191
|
+
* `opts.profile`).
|
|
164
192
|
*
|
|
165
|
-
* `opts` accepts `endpoint` (default `
|
|
166
|
-
* `project` (default `GOOGLE_CLOUD_PROJECT` env / the CNRM
|
|
193
|
+
* `opts` accepts `endpoint` (default `GCP_ENDPOINT_URL` env / each kind's
|
|
194
|
+
* real-GCP host) and `project` (default `GOOGLE_CLOUD_PROJECT` env / the CNRM
|
|
195
|
+
* project-id annotation).
|
|
167
196
|
*/
|
|
168
197
|
export declare const gcpApply: (manifestPath: string, opts?: Record<string, unknown>) => ActivityStep;
|
|
169
198
|
/** Delete the GCP (CNRM) resources in a built manifest — the inverse of {@link gcpApply}. Defaults to the `longInfra` profile (override via `opts.profile`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/op/builders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIjG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,EAAE,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,CAAC,OAAO,UAAU,CAAC,CAEpE;AAED,mEAAmE;AACnE,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,cAAc,EAAE,EACvB,IAAI,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5B,eAAe,CAEjB;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CACtB,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,GAChC,YAAY,CAOd;AAED,oFAAoF;AACpF,wBAAgB,IAAI,CAClB,UAAU,EAAE,MAAM,EAClB,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,QAAQ,CAOV;AAsBD,8JAA8J;AAC9J,eAAO,MAAM,KAAK,G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AM,SAAS,GAAI,OAAM;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CAC9B,KAAG,YAGR,CAAC;AAEF,+JAA+J;AAC/J,eAAO,MAAM,WAAW,GAAI,OAAM;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CAC9B,KAAG,YAGR,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,OAAO;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,KAAG,YAKjE,CAAC"}
|
package/dist/op/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Op, phase, activity, gate, build, kubectlApply, helmInstall, waitForStack, waitForReady, gitlabPipeline, lifecycleSnapshot, shell, teardown, k3dUp, k3dDown, flociUp, flociDown, flociAzUp, flociAzDown, flociGcpUp, flociGcpDown, httpCheck, azGroupEnsure, azGroupDelete, azApply, azDelete, awsApply, awsDelete, gcpApply, gcpDelete, policyGate, spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown } from "./builders.js";
|
|
1
|
+
export { Op, phase, activity, gate, build, kubectlApply, helmInstall, waitForStack, waitForReady, gitlabPipeline, lifecycleSnapshot, shell, teardown, envTeardown, k3dUp, k3dDown, flociUp, flociDown, flociAzUp, flociAzDown, flociGcpUp, flociGcpDown, httpCheck, azGroupEnsure, azGroupDelete, azApply, azDelete, awsApply, awsDelete, gcpApply, gcpDelete, policyGate, spriteCreate, spriteExec, spriteCheckpoint, spriteRestore, listCheckpoints, spriteDestroy, spriteWriteFile, spriteReadFile, spriteListDir, spriteRemove, spriteApplyNetworkPolicy, spriteApplyServices, spriteTaskCreate, spriteTaskRefresh, spriteTaskRelease, spritesUp, spritesDown } from "./builders.js";
|
|
2
2
|
export { OpResource } from "./resource.js";
|
|
3
3
|
export { safeHeartbeat, sleep } from "./activity-runtime.js";
|
|
4
4
|
export { emulatorLifecycle, emulatorsOf, endpointEnvVars } from "./emulator-lifecycle.js";
|
package/dist/op/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/op/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EACvF,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/op/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EACvF,cAAc,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EACnG,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAC3D,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EACrG,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EACzF,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
|
+
/**
|
|
2
|
+
* `@intentius/chant/testing` (#1224) — the live-stack test harness.
|
|
3
|
+
*
|
|
4
|
+
* A vitest suite deploys a real instance of its project once, asserts against
|
|
5
|
+
* it, and tears it down — emulator-locally on a dev machine, real-cloud in CI,
|
|
6
|
+
* with the same suite text. One call composes machinery that already exists:
|
|
7
|
+
*
|
|
8
|
+
* - **build** — the same programmatic path `chant build` takes: config
|
|
9
|
+
* resolution (`buildParams` + the ownership marker) mirrored from the CLI,
|
|
10
|
+
* then `build()` over the project's own serializers.
|
|
11
|
+
* - **apply** — an additive `nativeApply` per built lexicon output, run
|
|
12
|
+
* in-process through the local Op executor (`runOpLocally`). `deleteMode`
|
|
13
|
+
* is `"never"`: a test deploy creates and updates, nothing else.
|
|
14
|
+
* - **destroy** — #1222's marker-scoped teardown (`executeTeardown`), called
|
|
15
|
+
* in-process for exactly this suite's environment. Stateless by design:
|
|
16
|
+
* a crashed suite's environment is recovered by calling destroy again (or
|
|
17
|
+
* `chant lifecycle teardown <env> --yes`).
|
|
18
|
+
*
|
|
19
|
+
* ## Isolation
|
|
20
|
+
*
|
|
21
|
+
* Every deploy targets its own environment: `test-<suite>-<nonce>` by default
|
|
22
|
+
* ({@link testEnvName}), so parallel CI jobs never collide. The environment
|
|
23
|
+
* is the teardown key — everything the deploy stamps carries the ownership
|
|
24
|
+
* marker `{ stack, env }`, and `destroy()` selects on that identity and
|
|
25
|
+
* nothing else. A project that declares `environments` must legalize the
|
|
26
|
+
* dynamic names with a pattern entry (#1221):
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* environments: ["dev", "prod", { name: "test-*", endpoint: "http://localhost:4566" }]
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* ## Emulators
|
|
33
|
+
*
|
|
34
|
+
* The harness is emulator-aware the same way `--live` reads are (#1166): the
|
|
35
|
+
* target environment's declared `endpoint` is injected into each lexicon's
|
|
36
|
+
* ambient endpoint variable (`AWS_ENDPOINT_URL`, …) for the apply and the
|
|
37
|
+
* teardown — unless the variable is already set. Ambient always wins, so the
|
|
38
|
+
* env vars `chant emulator up --json` reports (#920) take precedence when
|
|
39
|
+
* exported, and a CI job pointing the identical suite at a real account just
|
|
40
|
+
* leaves both unset.
|
|
41
|
+
*/
|
|
42
|
+
import type { Declarable } from "./declarable.js";
|
|
43
|
+
import type { SerializerResult } from "./serializer.js";
|
|
44
|
+
import { type BuildParamValue } from "./build-params.js";
|
|
45
|
+
import type { LexiconPlugin } from "./lexicon.js";
|
|
46
|
+
import { type ActivityFn, type ActivityProfile } from "./op/activity-registry.js";
|
|
47
|
+
import { type TeardownReport } from "./lifecycle/teardown.js";
|
|
48
|
+
export interface DeployStackOptions {
|
|
49
|
+
/** The chant project directory (where the infra source lives). */
|
|
50
|
+
dir: string;
|
|
51
|
+
/**
|
|
52
|
+
* Explicit environment name. Overrides the default `test-<suite>-<nonce>`
|
|
53
|
+
* derivation — for a shared long-lived test environment, or a test that
|
|
54
|
+
* needs a deterministic name. Must be legal for the project's declared
|
|
55
|
+
* `environments`, exactly as `--env` would be.
|
|
56
|
+
*/
|
|
57
|
+
env?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Suite name folded into the default environment name. Defaults to the
|
|
60
|
+
* project directory's basename.
|
|
61
|
+
*/
|
|
62
|
+
suite?: string;
|
|
63
|
+
/** Build parameters, exactly as `--param name=value` flags would supply them. */
|
|
64
|
+
params?: Record<string, BuildParamValue>;
|
|
65
|
+
/**
|
|
66
|
+
* Loaded lexicon plugins. Defaults to loading the project's own declared/
|
|
67
|
+
* detected lexicons — pass this only to substitute test doubles.
|
|
68
|
+
*/
|
|
69
|
+
plugins?: LexiconPlugin[];
|
|
70
|
+
/** Activity implementations for the apply. Defaults to the real registry. */
|
|
71
|
+
activities?: Map<string, ActivityFn>;
|
|
72
|
+
/** Activity profiles (timeouts/retries). Defaults to the lexicon-declared table. */
|
|
73
|
+
profiles?: Record<string, ActivityProfile>;
|
|
74
|
+
/**
|
|
75
|
+
* Extra lexicon-name → `nativeApply` target entries, merged over the
|
|
76
|
+
* built-in map (aws → cloudformation, k8s → kubectl, azure → arm,
|
|
77
|
+
* gcp → gcp, fly → fly). A seam for tests and out-of-tree lexicons.
|
|
78
|
+
*/
|
|
79
|
+
applyTargets?: Record<string, string>;
|
|
80
|
+
}
|
|
81
|
+
/** The handle a suite holds between `beforeAll` and `afterAll`. */
|
|
82
|
+
export interface DeployedStack {
|
|
83
|
+
/** The built outputs, keyed by lexicon — what was deployed. */
|
|
84
|
+
outputs: Map<string, string | SerializerResult>;
|
|
85
|
+
/** The discovered entities, keyed by name. */
|
|
86
|
+
entities: Map<string, Declarable>;
|
|
87
|
+
/** The environment this deploy targeted — the teardown key. */
|
|
88
|
+
env: string;
|
|
89
|
+
/**
|
|
90
|
+
* Tear down everything carrying this suite's marker `{ stack, env }`.
|
|
91
|
+
* Throws {@link TeardownIncompleteError} when any candidate failed to
|
|
92
|
+
* delete or the plan had holes — an environment that cannot be called
|
|
93
|
+
* clean is a test failure, never a silent leak. Safe to call again:
|
|
94
|
+
* teardown is stateless, and a second call over a clean environment
|
|
95
|
+
* plans nothing.
|
|
96
|
+
*/
|
|
97
|
+
destroy(): Promise<TeardownReport>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Thrown by {@link DeployedStack.destroy} when the environment cannot be
|
|
101
|
+
* called clean: candidates still `failed` after the retry pass, or the plan
|
|
102
|
+
* had holes (#1089 — parts of the estate could not be read, so "nothing
|
|
103
|
+
* left" would be a claim about what was readable, not about the environment).
|
|
104
|
+
* Carries the full report for diagnosis.
|
|
105
|
+
*/
|
|
106
|
+
export declare class TeardownIncompleteError extends Error {
|
|
107
|
+
readonly report: TeardownReport;
|
|
108
|
+
constructor(report: TeardownReport);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The default environment name for one suite run: `test-<suite>-<nonce>`.
|
|
112
|
+
* The `test-` prefix is what a project's `"test-*"` pattern entry (#1221)
|
|
113
|
+
* legalizes; the nonce keeps parallel CI jobs of the same suite apart.
|
|
114
|
+
*/
|
|
115
|
+
export declare function testEnvName(suite: string): string;
|
|
116
|
+
/**
|
|
117
|
+
* Deploy a live instance of the project in `dir` for one test suite.
|
|
118
|
+
*
|
|
119
|
+
* Build (the CLI's own config resolution: `buildParams`, ownership marker,
|
|
120
|
+
* build roots) + additive apply (one `nativeApply` per built output with a
|
|
121
|
+
* native mechanism, via the local Op executor). Returns the handle the suite
|
|
122
|
+
* holds: outputs, entities, the environment name, and `destroy`.
|
|
123
|
+
*
|
|
124
|
+
* The ownership marker stamped on every resource is `{ stack: ownership.stack,
|
|
125
|
+
* env: <this deploy's environment> }` — the marker env always follows the
|
|
126
|
+
* suite environment, whatever `ownership.env` in config says, because the
|
|
127
|
+
* marker is the only thing `destroy()` selects on. A project with no
|
|
128
|
+
* `ownership.stack` is refused up front: a deploy that stamps nothing is a
|
|
129
|
+
* deploy nothing can sweep.
|
|
130
|
+
*
|
|
131
|
+
* Failures are thrown, never returned: build errors, unresolved parameters,
|
|
132
|
+
* an illegal environment name, and a failed apply (the local executor's
|
|
133
|
+
* `OpRunFailure`) all reject the returned promise.
|
|
134
|
+
*/
|
|
135
|
+
export declare function deployStack(options: DeployStackOptions): Promise<DeployedStack>;
|
|
136
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAMH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAMrD,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAI1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,EAAg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AsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,CAkHrF"}
|
package/dist/yaml.d.ts
CHANGED
|
@@ -6,14 +6,6 @@
|
|
|
6
6
|
* dedicated library if you need anchors, multi-document streams, or
|
|
7
7
|
* block scalars.
|
|
8
8
|
*/
|
|
9
|
-
/**
|
|
10
|
-
* Emit a YAML value with proper indentation.
|
|
11
|
-
*
|
|
12
|
-
* - Primitives render inline.
|
|
13
|
-
* - Arrays and objects render as block YAML, returning a string that starts
|
|
14
|
-
* with `\n` so the caller can append it after a key.
|
|
15
|
-
* - Tagged values `{ tag, value }` emit `!tag [...]` or `!tag scalar`.
|
|
16
|
-
*/
|
|
17
9
|
export declare function emitYAML(value: unknown, indent: number): string;
|
|
18
10
|
/** Result of parsing a YAML block. */
|
|
19
11
|
export interface ParseResult {
|
package/dist/yaml.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"yaml.d.ts","sourceRoot":"","sources":["../src/yaml.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0BH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgH/D;AAMD,sCAAsC;AACtC,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASlE;AAiFD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CA8Eb;AA0GD;;GAEG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,EACf,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,WAAW,CAqGb;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAelD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "Declarative infrastructure-as-code toolkit — TypeScript on Node.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -64,6 +64,11 @@
|
|
|
64
64
|
"types": "./dist/components/index.d.ts",
|
|
65
65
|
"default": "./src/components/index.ts"
|
|
66
66
|
},
|
|
67
|
+
"./testing": {
|
|
68
|
+
"development": "./src/testing.ts",
|
|
69
|
+
"types": "./dist/testing.d.ts",
|
|
70
|
+
"default": "./src/testing.ts"
|
|
71
|
+
},
|
|
67
72
|
"./*": {
|
|
68
73
|
"development": "./src/*.ts",
|
|
69
74
|
"types": "./dist/*.d.ts",
|
|
@@ -18,6 +18,7 @@ Declared in \`main.ts\`.
|
|
|
18
18
|
|
|
19
19
|
## Referenced by
|
|
20
20
|
|
|
21
|
+
- [appBucketPolicy](/aws/appBucketPolicy.md)
|
|
21
22
|
- [appFunc](/aws/appFunc.md)
|
|
22
23
|
- [appRole](/aws/appRole.md)
|
|
23
24
|
",
|
|
@@ -25,6 +26,24 @@ Declared in \`main.ts\`.
|
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
"content": "---
|
|
29
|
+
type: AWS::S3::BucketPolicy
|
|
30
|
+
title: appBucketPolicy
|
|
31
|
+
description: aws resource of type AWS::S3::BucketPolicy
|
|
32
|
+
name: appBucketPolicy
|
|
33
|
+
lexicon: aws
|
|
34
|
+
kind: resource
|
|
35
|
+
source: bucket-policy.ts
|
|
36
|
+
---
|
|
37
|
+
Declared in \`bucket-policy.ts\`.
|
|
38
|
+
|
|
39
|
+
## Depends on
|
|
40
|
+
|
|
41
|
+
- [appBucket](/aws/appBucket.md)
|
|
42
|
+
",
|
|
43
|
+
"path": "aws/appBucketPolicy.md",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"content": "---
|
|
28
47
|
type: AWS::Lambda::Function
|
|
29
48
|
title: appFunc
|
|
30
49
|
description: aws resource of type AWS::Lambda::Function
|
|
@@ -118,6 +137,7 @@ okf_version: '0.2'
|
|
|
118
137
|
# Lexicon: aws
|
|
119
138
|
|
|
120
139
|
* [appBucket](/aws/appBucket.md) - aws resource of type AWS::S3::Bucket
|
|
140
|
+
* [appBucketPolicy](/aws/appBucketPolicy.md) - aws resource of type AWS::S3::BucketPolicy
|
|
121
141
|
* [appFunc](/aws/appFunc.md) - aws resource of type AWS::Lambda::Function
|
|
122
142
|
* [appRole](/aws/appRole.md) - aws resource of type AWS::IAM::Role
|
|
123
143
|
* [bucketArn](/aws/bucketArn.md) - aws output of type Output
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, test, expect } from "vitest";
|
|
2
2
|
import { fileURLToPath } from "url";
|
|
3
|
-
import { discoverByDetection, loadAuditPlugins } from "./discover";
|
|
3
|
+
import { classifyFiles, discoverByDetection, hintLexiconForFile, loadAuditPlugins, unclaimedFiles } from "./discover";
|
|
4
4
|
import type { AuditInput } from "./core";
|
|
5
5
|
|
|
6
6
|
const fixture = (name: string) => fileURLToPath(new URL(`../cli/commands/__fixtures__/${name}`, import.meta.url));
|
|
@@ -70,3 +70,57 @@ describe("discoverByDetection (unified, detectTemplate-driven)", () => {
|
|
|
70
70
|
expect(plugins.map((p) => p.name)).toEqual(["github"]);
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
|
+
|
|
74
|
+
describe("lexicon hints for unclaimed files (#1623)", () => {
|
|
75
|
+
test("hintLexiconForFile guesses by path, name, and cheap content markers", () => {
|
|
76
|
+
expect(hintLexiconForFile(".github/workflows/ci.yml", "on: push\n")).toBe("github");
|
|
77
|
+
expect(hintLexiconForFile(".forgejo/workflows/ci.yml", "on: push\n")).toBe("forgejo");
|
|
78
|
+
expect(hintLexiconForFile(".gitlab-ci.yml", "build:\n script: [echo]\n")).toBe("gitlab");
|
|
79
|
+
expect(hintLexiconForFile("app/Dockerfile", "FROM x\n")).toBe("docker");
|
|
80
|
+
expect(hintLexiconForFile("charts/x/Chart.yaml", "name: x\n")).toBe("helm");
|
|
81
|
+
expect(hintLexiconForFile("infra/main.tf", "resource {}\n")).toBe("terraform");
|
|
82
|
+
expect(hintLexiconForFile("k8s/deploy.yaml", "apiVersion: apps/v1\nkind: Deployment\n")).toBe("k8s");
|
|
83
|
+
expect(hintLexiconForFile("gcp/bucket.yaml", "apiVersion: storage.cnrm.cloud.google.com/v1beta1\nkind: StorageBucket\n")).toBe("gcp");
|
|
84
|
+
expect(hintLexiconForFile("cfn/stack.yaml", "AWSTemplateFormatVersion: '2010-09-09'\nResources: {}\n")).toBe("aws");
|
|
85
|
+
expect(hintLexiconForFile("cfn/stack.json", '{"Resources":{"B":{"Type":"AWS::S3::Bucket"}}}')).toBe("aws");
|
|
86
|
+
expect(hintLexiconForFile("arm/azuredeploy.json", '{"$schema":"https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#"}')).toBe("azure");
|
|
87
|
+
expect(hintLexiconForFile("docker-compose.yml", "services:\n web:\n image: x\n")).toBe("docker");
|
|
88
|
+
expect(hintLexiconForFile("package.json", '{"name":"x"}')).toBeUndefined();
|
|
89
|
+
expect(hintLexiconForFile("config.yaml", "foo: bar\n")).toBeUndefined();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test("unclaimedFiles reports only files whose guessed lexicon is absent", () => {
|
|
93
|
+
const files = [
|
|
94
|
+
{ path: ".github/workflows/ci.yml", content: "on: push\n" },
|
|
95
|
+
{ path: "k8s/deploy.yaml", content: "apiVersion: v1\nkind: Pod\n" },
|
|
96
|
+
{ path: "odd.yaml", content: "apiVersion: v1\nkind: Pod\n" },
|
|
97
|
+
{ path: "main.tf", content: "" },
|
|
98
|
+
{ path: "README.json", content: "{}" },
|
|
99
|
+
];
|
|
100
|
+
const github = { name: "github" };
|
|
101
|
+
const k8s = { name: "k8s", detectTemplate: () => true };
|
|
102
|
+
// github loaded and claimed its file; k8s absent, so both manifests are unclaimed; tf always surfaces.
|
|
103
|
+
const inputs = classifyFiles(files, [github]);
|
|
104
|
+
expect(unclaimedFiles(files, inputs, [github])).toEqual([
|
|
105
|
+
{ path: "k8s/deploy.yaml", lexicon: "k8s" },
|
|
106
|
+
{ path: "odd.yaml", lexicon: "k8s" },
|
|
107
|
+
{ path: "main.tf", lexicon: "terraform" },
|
|
108
|
+
]);
|
|
109
|
+
// With k8s loaded, its files are claimed and drop out; only terraform remains.
|
|
110
|
+
const inputs2 = classifyFiles(files, [github, k8s]);
|
|
111
|
+
expect(unclaimedFiles(files, inputs2, [github, k8s])).toEqual([{ path: "main.tf", lexicon: "terraform" }]);
|
|
112
|
+
// Zero plugins: everything that looks like something is unclaimed.
|
|
113
|
+
expect(unclaimedFiles(files, [], []).map((u) => u.lexicon)).toEqual(["github", "k8s", "k8s", "terraform"]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test("helm bundles claim their whole chart directory", () => {
|
|
117
|
+
const files = [
|
|
118
|
+
{ path: "chart/Chart.yaml", content: "name: c\nversion: 1.0.0\n" },
|
|
119
|
+
{ path: "chart/templates/deploy.yaml", content: "apiVersion: v1\nkind: Pod\n" },
|
|
120
|
+
];
|
|
121
|
+
const helm = { name: "helm", detectTemplate: () => true };
|
|
122
|
+
const inputs = classifyFiles(files, [helm]);
|
|
123
|
+
expect(inputs).toHaveLength(1);
|
|
124
|
+
expect(unclaimedFiles(files, inputs, [helm])).toEqual([]);
|
|
125
|
+
});
|
|
126
|
+
});
|
package/src/audit/discover.ts
CHANGED
|
@@ -243,6 +243,63 @@ export function isCandidatePath(path: string): boolean {
|
|
|
243
243
|
return /\.(ya?ml|json|template)$/i.test(name);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
/**
|
|
247
|
+
* What a candidate file looks like it wants, judged cheaply by core alone
|
|
248
|
+
* (path, filename, a few content markers) with no lexicon plugin involved.
|
|
249
|
+
* Names the lexicon that would have claimed a file when that lexicon isn't
|
|
250
|
+
* installed (#1623). Deliberately coarse: precision comes from the plugin's
|
|
251
|
+
* `detectTemplate`, which is exactly what's missing in that case.
|
|
252
|
+
* `terraform` is not an audit lexicon; `*.tf` is surfaced so the user learns
|
|
253
|
+
* the audit never reads it (see `chant carve`).
|
|
254
|
+
*/
|
|
255
|
+
export type LexiconHint = AuditLexicon | "terraform";
|
|
256
|
+
|
|
257
|
+
export function hintLexiconForFile(path: string, content: string): LexiconHint | undefined {
|
|
258
|
+
const name = basename(path);
|
|
259
|
+
const ci = ciLexiconForPath(path);
|
|
260
|
+
if (ci) return ci;
|
|
261
|
+
if (isDockerfileName(name)) return "docker";
|
|
262
|
+
if (name === "Chart.yaml") return "helm";
|
|
263
|
+
if (/\.tf$/i.test(name)) return "terraform";
|
|
264
|
+
const head = content.slice(0, 64 * 1024);
|
|
265
|
+
if (/cnrm\.cloud\.google\.com/.test(head)) return "gcp";
|
|
266
|
+
if (/AWSTemplateFormatVersion|["']?Type["']?\s*:\s*["']AWS::/.test(head)) return "aws";
|
|
267
|
+
if (/deploymentTemplate\.json/.test(head)) return "azure";
|
|
268
|
+
if (isYaml(name)) {
|
|
269
|
+
if (/^apiVersion:/m.test(head) && /^kind:/m.test(head)) return "k8s";
|
|
270
|
+
if (/^services:/m.test(head)) return "docker";
|
|
271
|
+
}
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** A candidate file that looked like it belonged to a lexicon the audit did not have. */
|
|
276
|
+
export interface UnclaimedFile {
|
|
277
|
+
path: string;
|
|
278
|
+
lexicon: LexiconHint;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Files no loaded lexicon claimed, paired with the lexicon core guesses they
|
|
283
|
+
* wanted. Only files whose guessed lexicon is absent are reported; a file an
|
|
284
|
+
* installed lexicon declined is that plugin's call, not a coverage gap.
|
|
285
|
+
*/
|
|
286
|
+
export function unclaimedFiles(files: RepoFile[], inputs: AuditInput[], plugins: DetectPlugin[]): UnclaimedFile[] {
|
|
287
|
+
const loaded = new Set<string>(plugins.map((p) => p.name));
|
|
288
|
+
const claimed = new Set<string>();
|
|
289
|
+
for (const i of inputs) {
|
|
290
|
+
if (i.files) for (const rel of Object.keys(i.files)) claimed.add(i.path === "." ? rel : `${i.path}/${rel}`);
|
|
291
|
+
else claimed.add(i.path);
|
|
292
|
+
}
|
|
293
|
+
const out: UnclaimedFile[] = [];
|
|
294
|
+
for (const f of files) {
|
|
295
|
+
if (claimed.has(f.path)) continue;
|
|
296
|
+
const lexicon = hintLexiconForFile(f.path, f.content);
|
|
297
|
+
if (!lexicon || loaded.has(lexicon)) continue;
|
|
298
|
+
out.push({ path: f.path, lexicon });
|
|
299
|
+
}
|
|
300
|
+
return out;
|
|
301
|
+
}
|
|
302
|
+
|
|
246
303
|
/** Collect Helm charts as bundles from an in-memory file set; returns inputs + chart path-prefixes. */
|
|
247
304
|
function classifyHelm(files: RepoFile[], plugin: DetectPlugin | undefined): { inputs: AuditInput[]; prefixes: string[] } {
|
|
248
305
|
const inputs: AuditInput[] = [];
|
|
@@ -315,15 +372,26 @@ export function classifyFiles(files: RepoFile[], plugins: DetectPlugin[]): Audit
|
|
|
315
372
|
* then handed to the shared `classifyFiles`. Detection is skipped for any
|
|
316
373
|
* lexicon whose plugin isn't provided, so a caller can scope discovery.
|
|
317
374
|
*/
|
|
318
|
-
export function discoverByDetection(root: string, plugins:
|
|
375
|
+
export function discoverByDetection(root: string, plugins: DetectPlugin[]): AuditInput[] {
|
|
376
|
+
return classifyFiles(collectCandidates(root), plugins);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/** The walk half of `discoverByDetection`: candidate files read into memory, paths relative to the root. */
|
|
380
|
+
export function collectCandidates(root: string): RepoFile[] {
|
|
319
381
|
const all: string[] = [];
|
|
320
382
|
walkFiles(root, all);
|
|
321
383
|
const files: RepoFile[] = [];
|
|
322
384
|
for (const full of all) {
|
|
323
385
|
const path = relative(root, full);
|
|
386
|
+
// Terraform is never audited; the path alone is enough to say so (#1623).
|
|
387
|
+
// Kept out of `isCandidatePath` so remote fetches never pull HCL.
|
|
388
|
+
if (/\.tf$/i.test(path)) {
|
|
389
|
+
files.push({ path, content: "" });
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
324
392
|
if (!isCandidatePath(path)) continue;
|
|
325
393
|
const content = readSafe(full);
|
|
326
394
|
if (content !== undefined) files.push({ path, content });
|
|
327
395
|
}
|
|
328
|
-
return
|
|
396
|
+
return files;
|
|
329
397
|
}
|