@intentius/chant-lexicon-pulumi 0.124.98 → 0.124.99
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/adopt.d.ts +0 -1
- package/dist/capability-plugin.d.ts +0 -1
- package/dist/change-set.d.ts +0 -1
- package/dist/changed-units.d.ts +0 -1
- package/dist/check-step.d.ts +0 -1
- package/dist/ci-setup.d.ts +0 -1
- package/dist/codegen/docs-cli.d.ts +0 -1
- package/dist/codegen/docs.d.ts +0 -1
- package/dist/codegen/package.d.ts +0 -1
- package/dist/composites/pulumi-adopt-op.d.ts +0 -1
- package/dist/composites/pulumi-watch-op.d.ts +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/describe-resources.d.ts +0 -1
- package/dist/drift-read.d.ts +0 -1
- package/dist/drift-record.d.ts +0 -1
- package/dist/engine-events.d.ts +0 -1
- package/dist/engine-graph.d.ts +0 -1
- package/dist/exit-codes.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/init-templates.d.ts +0 -1
- package/dist/integrity.json +2 -2
- package/dist/lint/audit-catalog.d.ts +0 -1
- package/dist/lint/post-synth/index.d.ts +0 -1
- package/dist/lint/post-synth/member-read-helpers.d.ts +0 -1
- package/dist/lint/post-synth/pul001.d.ts +0 -1
- package/dist/lint/post-synth/pul002.d.ts +0 -1
- package/dist/lint/post-synth/pul003.d.ts +0 -1
- package/dist/lint/post-synth/pul004.d.ts +0 -1
- package/dist/lint/post-synth/pul005.d.ts +0 -1
- package/dist/lint/post-synth/pul006.d.ts +0 -1
- package/dist/lint/post-synth/pul007.d.ts +0 -1
- package/dist/lint/post-synth/pul008.d.ts +0 -1
- package/dist/lint/post-synth/pul009.d.ts +0 -1
- package/dist/lint/post-synth/pul010.d.ts +0 -1
- package/dist/lint/post-synth/pul011.d.ts +0 -1
- package/dist/lint/post-synth/pul012.d.ts +0 -1
- package/dist/lint/post-synth/pul013.d.ts +0 -1
- package/dist/lint/post-synth/pul014.d.ts +0 -1
- package/dist/lint/post-synth/pul015.d.ts +0 -1
- package/dist/lint/rules/index.d.ts +0 -1
- package/dist/lint/rules/member-dir-absolute.d.ts +0 -1
- package/dist/lock-rows.d.ts +0 -1
- package/dist/lsp/completions.d.ts +0 -1
- package/dist/lsp/documents.d.ts +0 -1
- package/dist/lsp/hover.d.ts +0 -1
- package/dist/lsp/keys.d.ts +0 -1
- package/dist/lsp/object-path.d.ts +0 -1
- package/dist/lsp/yaml-cursor.d.ts +0 -1
- package/dist/manifest.json +1 -1
- package/dist/member-engine.d.ts +0 -1
- package/dist/member-outputs.d.ts +0 -1
- package/dist/op/activities/index.d.ts +0 -1
- package/dist/op/activities/pulumi-adopt.d.ts +0 -1
- package/dist/op/activities/pulumi.d.ts +0 -1
- package/dist/op/activity-contracts.d.ts +0 -1
- package/dist/op/builders.d.ts +0 -1
- package/dist/package-cli.d.ts +0 -1
- package/dist/plan-shape.d.ts +0 -1
- package/dist/planned-output-changes.d.ts +0 -1
- package/dist/plugin.d.ts +0 -1
- package/dist/plunge-timings.d.ts +0 -1
- package/dist/preview-tips.d.ts +0 -1
- package/dist/pulumi-up.d.ts +0 -1
- package/dist/release-copy.d.ts +0 -1
- package/dist/review-stack.d.ts +0 -1
- package/dist/run.d.ts +0 -1
- package/dist/serializer.d.ts +0 -1
- package/dist/stack-export-snapshot.d.ts +0 -1
- package/dist/stack-ops.d.ts +0 -1
- package/dist/stack-outputs.d.ts +0 -1
- package/dist/stack-references.d.ts +0 -1
- package/dist/trace-facts.d.ts +0 -1
- package/dist/values.d.ts +0 -1
- package/dist/workspace-member.d.ts +0 -1
- package/package.json +3 -4
- package/dist/adopt.d.ts.map +0 -1
- package/dist/capability-plugin.d.ts.map +0 -1
- package/dist/change-set.d.ts.map +0 -1
- package/dist/changed-units.d.ts.map +0 -1
- package/dist/check-step.d.ts.map +0 -1
- package/dist/ci-setup.d.ts.map +0 -1
- package/dist/codegen/docs-cli.d.ts.map +0 -1
- package/dist/codegen/docs.d.ts.map +0 -1
- package/dist/codegen/package.d.ts.map +0 -1
- package/dist/composites/pulumi-adopt-op.d.ts.map +0 -1
- package/dist/composites/pulumi-watch-op.d.ts.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/describe-resources.d.ts.map +0 -1
- package/dist/drift-read.d.ts.map +0 -1
- package/dist/drift-record.d.ts.map +0 -1
- package/dist/engine-events.d.ts.map +0 -1
- package/dist/engine-graph.d.ts.map +0 -1
- package/dist/exit-codes.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/init-templates.d.ts.map +0 -1
- package/dist/lint/audit-catalog.d.ts.map +0 -1
- package/dist/lint/post-synth/index.d.ts.map +0 -1
- package/dist/lint/post-synth/member-read-helpers.d.ts.map +0 -1
- package/dist/lint/post-synth/pul001.d.ts.map +0 -1
- package/dist/lint/post-synth/pul002.d.ts.map +0 -1
- package/dist/lint/post-synth/pul003.d.ts.map +0 -1
- package/dist/lint/post-synth/pul004.d.ts.map +0 -1
- package/dist/lint/post-synth/pul005.d.ts.map +0 -1
- package/dist/lint/post-synth/pul006.d.ts.map +0 -1
- package/dist/lint/post-synth/pul007.d.ts.map +0 -1
- package/dist/lint/post-synth/pul008.d.ts.map +0 -1
- package/dist/lint/post-synth/pul009.d.ts.map +0 -1
- package/dist/lint/post-synth/pul010.d.ts.map +0 -1
- package/dist/lint/post-synth/pul011.d.ts.map +0 -1
- package/dist/lint/post-synth/pul012.d.ts.map +0 -1
- package/dist/lint/post-synth/pul013.d.ts.map +0 -1
- package/dist/lint/post-synth/pul014.d.ts.map +0 -1
- package/dist/lint/post-synth/pul015.d.ts.map +0 -1
- package/dist/lint/rules/index.d.ts.map +0 -1
- package/dist/lint/rules/member-dir-absolute.d.ts.map +0 -1
- package/dist/lock-rows.d.ts.map +0 -1
- package/dist/lsp/completions.d.ts.map +0 -1
- package/dist/lsp/documents.d.ts.map +0 -1
- package/dist/lsp/hover.d.ts.map +0 -1
- package/dist/lsp/keys.d.ts.map +0 -1
- package/dist/lsp/object-path.d.ts.map +0 -1
- package/dist/lsp/yaml-cursor.d.ts.map +0 -1
- package/dist/member-engine.d.ts.map +0 -1
- package/dist/member-outputs.d.ts.map +0 -1
- package/dist/op/activities/index.d.ts.map +0 -1
- package/dist/op/activities/pulumi-adopt.d.ts.map +0 -1
- package/dist/op/activities/pulumi.d.ts.map +0 -1
- package/dist/op/activity-contracts.d.ts.map +0 -1
- package/dist/op/builders.d.ts.map +0 -1
- package/dist/package-cli.d.ts.map +0 -1
- package/dist/plan-shape.d.ts.map +0 -1
- package/dist/planned-output-changes.d.ts.map +0 -1
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plunge-timings.d.ts.map +0 -1
- package/dist/preview-tips.d.ts.map +0 -1
- package/dist/pulumi-up.d.ts.map +0 -1
- package/dist/release-copy.d.ts.map +0 -1
- package/dist/review-stack.d.ts.map +0 -1
- package/dist/run.d.ts.map +0 -1
- package/dist/serializer.d.ts.map +0 -1
- package/dist/stack-export-snapshot.d.ts.map +0 -1
- package/dist/stack-ops.d.ts.map +0 -1
- package/dist/stack-outputs.d.ts.map +0 -1
- package/dist/stack-references.d.ts.map +0 -1
- package/dist/trace-facts.d.ts.map +0 -1
- package/dist/values.d.ts.map +0 -1
- package/dist/workspace-member.d.ts.map +0 -1
- package/src/adopt.ts +0 -202
- package/src/capability-plugin.ts +0 -34
- package/src/change-set.test.ts +0 -245
- package/src/change-set.ts +0 -508
- package/src/changed-units.test.ts +0 -87
- package/src/changed-units.ts +0 -96
- package/src/check-step.test.ts +0 -191
- package/src/check-step.ts +0 -316
- package/src/ci-setup.test.ts +0 -234
- package/src/ci-setup.ts +0 -224
- package/src/codegen/docs-cli.ts +0 -4
- package/src/codegen/docs.ts +0 -58
- package/src/codegen/package.ts +0 -63
- package/src/composites/pulumi-adopt-op.test.ts +0 -258
- package/src/composites/pulumi-adopt-op.ts +0 -193
- package/src/composites/pulumi-watch-op.test.ts +0 -42
- package/src/composites/pulumi-watch-op.ts +0 -85
- package/src/config.ts +0 -43
- package/src/describe-resources.test.ts +0 -112
- package/src/describe-resources.ts +0 -118
- package/src/drift-read.test.ts +0 -178
- package/src/drift-read.ts +0 -94
- package/src/drift-record.test.ts +0 -197
- package/src/drift-record.ts +0 -326
- package/src/engine-events.test.ts +0 -160
- package/src/engine-events.ts +0 -395
- package/src/engine-graph.test.ts +0 -141
- package/src/engine-graph.ts +0 -149
- package/src/exit-codes.test.ts +0 -21
- package/src/exit-codes.ts +0 -71
- package/src/index.ts +0 -139
- package/src/init-templates.ts +0 -85
- package/src/lint/audit-catalog.test.ts +0 -33
- package/src/lint/audit-catalog.ts +0 -174
- package/src/lint/post-synth/index.ts +0 -35
- package/src/lint/post-synth/member-read-helpers.ts +0 -122
- package/src/lint/post-synth/post-synth.test.ts +0 -245
- package/src/lint/post-synth/pul001.ts +0 -38
- package/src/lint/post-synth/pul002.ts +0 -38
- package/src/lint/post-synth/pul003.ts +0 -43
- package/src/lint/post-synth/pul004.ts +0 -32
- package/src/lint/post-synth/pul005.ts +0 -31
- package/src/lint/post-synth/pul006.ts +0 -31
- package/src/lint/post-synth/pul007.ts +0 -35
- package/src/lint/post-synth/pul008.ts +0 -35
- package/src/lint/post-synth/pul009.ts +0 -32
- package/src/lint/post-synth/pul010.ts +0 -42
- package/src/lint/post-synth/pul011.ts +0 -38
- package/src/lint/post-synth/pul012.ts +0 -35
- package/src/lint/post-synth/pul013.ts +0 -35
- package/src/lint/post-synth/pul014.ts +0 -32
- package/src/lint/post-synth/pul015.ts +0 -39
- package/src/lint/rules/index.ts +0 -7
- package/src/lint/rules/member-dir-absolute.test.ts +0 -37
- package/src/lint/rules/member-dir-absolute.ts +0 -83
- package/src/lock-rows.test.ts +0 -60
- package/src/lock-rows.ts +0 -56
- package/src/lsp/completions.test.ts +0 -69
- package/src/lsp/completions.ts +0 -119
- package/src/lsp/documents.ts +0 -48
- package/src/lsp/hover.test.ts +0 -56
- package/src/lsp/hover.ts +0 -83
- package/src/lsp/keys.ts +0 -169
- package/src/lsp/object-path.ts +0 -71
- package/src/lsp/yaml-cursor.ts +0 -85
- package/src/member-engine.test.ts +0 -112
- package/src/member-engine.ts +0 -97
- package/src/member-outputs.test.ts +0 -339
- package/src/member-outputs.ts +0 -157
- package/src/op/activities/index.ts +0 -36
- package/src/op/activities/pulumi-adopt.ts +0 -345
- package/src/op/activities/pulumi.ts +0 -136
- package/src/op/activity-contracts.ts +0 -129
- package/src/op/builders.ts +0 -67
- package/src/package-cli.ts +0 -14
- package/src/plan-shape.test.ts +0 -91
- package/src/plan-shape.ts +0 -105
- package/src/planned-output-changes.test.ts +0 -85
- package/src/planned-output-changes.ts +0 -141
- package/src/plugin.test.ts +0 -96
- package/src/plugin.ts +0 -272
- package/src/plunge-timings.test.ts +0 -241
- package/src/plunge-timings.ts +0 -115
- package/src/plunge-up-failed.test.ts +0 -54
- package/src/pr-note.test.ts +0 -87
- package/src/preview-generated.test.ts +0 -124
- package/src/preview-tips.test.ts +0 -134
- package/src/preview-tips.ts +0 -128
- package/src/pulumi-up.test.ts +0 -581
- package/src/pulumi-up.ts +0 -1102
- package/src/pulumi-urn-node.test.ts +0 -94
- package/src/release-copy.test.ts +0 -162
- package/src/release-copy.ts +0 -223
- package/src/review-stack.test.ts +0 -254
- package/src/review-stack.ts +0 -266
- package/src/run-plan-flags.test.ts +0 -53
- package/src/run.test.ts +0 -540
- package/src/run.ts +0 -1129
- package/src/serializer.test.ts +0 -9
- package/src/serializer.ts +0 -15
- package/src/skills/chant-pulumi-plunge.md +0 -51
- package/src/skills/chant-pulumi-stack-export.md +0 -54
- package/src/skills/chant-pulumi.md +0 -83
- package/src/stack-export-snapshot.test.ts +0 -192
- package/src/stack-export-snapshot.ts +0 -312
- package/src/stack-ops.fake-binary.test.ts +0 -323
- package/src/stack-ops.test.ts +0 -511
- package/src/stack-ops.ts +0 -1082
- package/src/stack-outputs.ts +0 -66
- package/src/stack-references.test.ts +0 -96
- package/src/stack-references.ts +0 -110
- package/src/testdata/plunge-drift/README.md +0 -10
- package/src/testdata/plunge-drift/assets-drifted.ndjson +0 -3
- package/src/testdata/plunge-drift/component-unsupported.ndjson +0 -3
- package/src/testdata/plunge-drift/role-in-sync.ndjson +0 -3
- package/src/testdata/plunge-drift/settled-empty.ndjson +0 -2
- package/src/testdata/plunge-graph/Pulumi.yaml +0 -4
- package/src/testdata/plunge-graph/README.md +0 -12
- package/src/testdata/plunge-graph/engine-graph.json +0 -158
- package/src/testdata/plunge-graph/stack-export.json +0 -49
- package/src/testdata/plunge-member/Pulumi.yaml +0 -4
- package/src/testdata/plunge-member/README.md +0 -3
- package/src/testdata/plunge-member/stack-export.json +0 -480
- package/src/testdata/plunge-outputs/Pulumi.yaml +0 -9
- package/src/testdata/plunge-outputs/README.md +0 -7
- package/src/testdata/plunge-outputs/stack-export.json +0 -2003
- package/src/testdata/plunge-outputs/stack-output.json +0 -19
- package/src/testdata/pulumi-member/Pulumi.yaml +0 -2
- package/src/testdata/pulumi-member/README.md +0 -50
- package/src/testdata/pulumi-member/recording/Pulumi.dev.yaml +0 -19
- package/src/testdata/pulumi-member/recording/Pulumi.yaml +0 -7
- package/src/testdata/pulumi-member/recording/index.js +0 -47
- package/src/testdata/pulumi-member/recording/package-lock.json +0 -2707
- package/src/testdata/pulumi-member/recording/package.json +0 -9
- package/src/testdata/pulumi-member/stack-export.json +0 -746
- package/src/testdata/pulumi-outputs/Pulumi.yaml +0 -7
- package/src/testdata/pulumi-outputs/README.md +0 -9
- package/src/testdata/pulumi-outputs/preview-replaced.json +0 -2894
- package/src/testdata/pulumi-outputs/preview-settled.json +0 -2894
- package/src/testdata/pulumi-outputs/stack-export.json +0 -1919
- package/src/testdata/pulumi-outputs/stack-output.json +0 -19
- package/src/testdata/pulumi-preview/Pulumi.yaml +0 -7
- package/src/testdata/pulumi-preview/README.md +0 -9
- package/src/testdata/pulumi-preview/preview-create.json +0 -992
- package/src/testdata/pulumi-preview/preview.json +0 -2894
- package/src/testdata/pulumi-preview/stack-export.json +0 -1919
- package/src/testdata/pulumi-refresh/Pulumi.yaml +0 -7
- package/src/testdata/pulumi-refresh/README.md +0 -14
- package/src/testdata/pulumi-refresh/all.json +0 -3742
- package/src/testdata/pulumi-refresh/bucket-edited.json +0 -468
- package/src/testdata/pulumi-refresh/policy-deleted.json +0 -95
- package/src/testdata/pulumi-refresh/queue-edited.json +0 -250
- package/src/testdata/pulumi-refresh/role-same.json +0 -242
- package/src/testdata/pulumi-refresh/secret-edited.json +0 -247
- package/src/testdata/pulumi-refresh/stack-export.json +0 -1907
- package/src/testdata/pulumi-stream/README.md +0 -16
- package/src/testdata/pulumi-stream/preview-stream.ndjson +0 -42
- package/src/testdata/pulumi-stream/up-failed-plunge.ndjson +0 -5
- package/src/testdata/pulumi-unexported/Pulumi.yaml +0 -2
- package/src/testdata/pulumi-urn-node/Pulumi.yaml +0 -7
- package/src/testdata/pulumi-urn-node/README.md +0 -9
- package/src/testdata/pulumi-urn-node/preview.json +0 -2894
- package/src/testdata/pulumi-urn-node/stack-export.json +0 -1919
- package/src/trace-facts.test.ts +0 -38
- package/src/trace-facts.ts +0 -83
- package/src/values.ts +0 -147
- package/src/workspace-kinds.test.ts +0 -47
- package/src/workspace-member.test.ts +0 -127
- package/src/workspace-member.ts +0 -304
package/src/serializer.test.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "vitest";
|
|
2
|
-
import { pulumiSerializer } from "./serializer";
|
|
3
|
-
|
|
4
|
-
describe("pulumiSerializer", () => {
|
|
5
|
-
test("a build that names the lexicon gets an empty document: it declares nothing", () => {
|
|
6
|
-
expect(pulumiSerializer.serialize(new Map())).toEqual({ primary: "{}\n", files: {} });
|
|
7
|
-
expect(pulumiSerializer.rulePrefix).toBe("PUL");
|
|
8
|
-
});
|
|
9
|
-
});
|
package/src/serializer.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Declarable } from "@intentius/chant/declarable";
|
|
2
|
-
import type { Serializer, SerializerResult } from "@intentius/chant/serializer";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The pulumi serializer. The lexicon declares no resource types: a Pulumi
|
|
6
|
-
* program is a workspace member chant reads, not something chant writes. A
|
|
7
|
-
* build that names the lexicon gets an empty document.
|
|
8
|
-
*/
|
|
9
|
-
export const pulumiSerializer: Serializer = {
|
|
10
|
-
name: "pulumi",
|
|
11
|
-
rulePrefix: "PUL",
|
|
12
|
-
serialize(_entities: Map<string, Declarable>): SerializerResult {
|
|
13
|
-
return { primary: "{}\n", files: {} };
|
|
14
|
-
},
|
|
15
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
skill: chant-pulumi-plunge
|
|
3
|
-
description: Read a Pulumi member that runs on plunge (a plunge backend URL or engine plunge), with plunge preview, plunge stack output and plunge drift
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# A Pulumi Member on plunge
|
|
8
|
-
|
|
9
|
-
plunge is a Pulumi fork with its own state backends. A member runs on plunge when its `pulumi.member` config says `engine: "plunge"`, or when its `Pulumi.yaml` has a `backend.url` starting with `plunge` (`plunge+file://...`, `plunge://...`). Only `Pulumi.yaml` decides when the config does not; `PULUMI_BACKEND_URL` and the CLI's login state are never read, so every checkout gets the same answer.
|
|
10
|
-
|
|
11
|
-
## What chant runs
|
|
12
|
-
|
|
13
|
-
| Read | Command |
|
|
14
|
-
|---|---|
|
|
15
|
-
| graph | none; the checked-in `stack-export.json`, as for a stock member |
|
|
16
|
-
| change set | `plunge preview --json` |
|
|
17
|
-
| applied outputs | `plunge stack output --json --show-secrets=false` |
|
|
18
|
-
| drift | `plunge drift --resource <urn> --stream --stack <name>`, one per resource |
|
|
19
|
-
| engine facts | `plunge graph --json --stack <name>`, once per member (`describeResources`); the graph read takes a checked-in `engine-graph.json` instead |
|
|
20
|
-
|
|
21
|
-
`plunge graph` runs as exactly one of `plunge graph --json`, `plunge graph --json --stack <stack>`, `plunge graph --json --versions` and `plunge graph --json --stack <stack> --versions`; an outputs or secrets flag is refused. It reads plunge's records, calls no provider and prints no output value. Its facts land on `nodes[].facts`, and nothing in chant decides from them.
|
|
22
|
-
|
|
23
|
-
Nothing else runs. `runAllowedPlunge` refuses any other argv before it reaches the binary, so chant never changes the stack. The drift stream is drift-record NDJSON, which chant places on nodes by the same URN rule the graph uses.
|
|
24
|
-
|
|
25
|
-
## Declaring the member
|
|
26
|
-
|
|
27
|
-
The workspace entry is the same as for a stock member (kind `pulumi`). With a plunge backend URL in `Pulumi.yaml`, nothing else is needed. To read the member into a build, or to say plunge without a plunge URL:
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
import type { ChantConfig } from "@intentius/chant/config";
|
|
31
|
-
import "@intentius/chant-lexicon-pulumi";
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
lexicons: ["pulumi"],
|
|
35
|
-
pulumi: { member: { dir: "./site", label: "site", engine: "plunge" } },
|
|
36
|
-
} satisfies ChantConfig;
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
Do not write `engine: "pulumi"` for a program on a plunge backend: stock `pulumi` cannot open it, and PUL015 reports the mismatch.
|
|
40
|
-
|
|
41
|
-
## Watching it
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
import { PulumiWatchOp } from "@intentius/chant-lexicon-pulumi";
|
|
45
|
-
|
|
46
|
-
export const { op } = PulumiWatchOp({ name: "site-watch", member: "site", dir: "./site", engine: "plunge", schedule: "0 6 * * *" });
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
`chant init --lexicon pulumi --template plunge` writes this project. The stack export is taken the same way, with `plunge stack export --file stack-export.json` (see the `chant-pulumi-stack-export` skill).
|
|
50
|
-
|
|
51
|
-
Never run `plunge up`, `plunge destroy` or any command outside the table for the user, and never point a member at a real cloud account to try it.
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
skill: chant-pulumi-stack-export
|
|
3
|
-
description: Keep a Pulumi member's checked-in stack-export.json current and clean, and fix what PUL001 to PUL015 report about it
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The Pulumi Member's Stack Export
|
|
8
|
-
|
|
9
|
-
chant reads a Pulumi member's graph from `stack-export.json`, checked in beside `Pulumi.yaml`. The graph read never runs the program or `pulumi`, so the file is the whole of what the graph knows. Every build that reads the member (`pulumi.member` in `chant.config.ts`, or the reader project `chant workspace graph` writes) runs PUL001 to PUL015 against it.
|
|
10
|
-
|
|
11
|
-
## Taking the export
|
|
12
|
-
|
|
13
|
-
In the member's directory, with the stack selected:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pulumi stack export --file stack-export.json
|
|
17
|
-
git add stack-export.json
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Take it again after every `pulumi up`, and never with `--show-secrets`. Do not edit the file by hand or merge two exports into one; replace it with a fresh export instead.
|
|
21
|
-
|
|
22
|
-
Never run `pulumi up`, `pulumi destroy`, `pulumi import`, `pulumi stack import` or `pulumi refresh` without `--preview-only` for the user. The fixes below that need one of them are the stack owner's to run; say which command and stop.
|
|
23
|
-
|
|
24
|
-
## What each check means
|
|
25
|
-
|
|
26
|
-
| Id | Severity | What it found | What to do |
|
|
27
|
-
|---|---|---|---|
|
|
28
|
-
| PUL001 | warning | no readable export, so the member has no nodes | take the export |
|
|
29
|
-
| PUL002 | warning | pending operations from an interrupted update | the owner runs `pulumi refresh`, then export again |
|
|
30
|
-
| PUL003 | error | secret values in plaintext (`--show-secrets`) | export again without it; the owner rotates the exposed secrets |
|
|
31
|
-
| PUL004 | warning | `delete: true`, a replaced object whose delete failed | the owner runs `pulumi up` to retry the delete, then export again |
|
|
32
|
-
| PUL005 | warning | `pendingReplacement: true`, deleted for a replace that never finished | the owner runs `pulumi up`, then export again |
|
|
33
|
-
| PUL006 | info | `taint: true`, replaced on the next update | expect the replace in the preview, or `pulumi state untaint` |
|
|
34
|
-
| PUL007 | warning | `pulumi.member.stack` names another stack than the export | export that stack, or fix the config |
|
|
35
|
-
| PUL008 | warning | URNs from more than one stack or project | replace the file with one export |
|
|
36
|
-
| PUL009 | warning | the export's project is not `Pulumi.yaml`'s `name` | export this member's own stack |
|
|
37
|
-
| PUL010 | warning | a parent or dependency the export does not hold | replace the file with a fresh export |
|
|
38
|
-
| PUL011 | warning | two live entries for one URN | replace the file with a fresh export |
|
|
39
|
-
| PUL012 | info | `external: true` resources the program only reads | nothing; drift on them is another owner's |
|
|
40
|
-
| PUL013 | warning | a deployment version other than 3 | export with the Pulumi CLI |
|
|
41
|
-
| PUL014 | info | no resources besides the stack and providers | export again after the stack is deployed |
|
|
42
|
-
| PUL015 | warning | `engine: "pulumi"` on a `plunge` backend | drop `engine` or set it to `"plunge"` |
|
|
43
|
-
|
|
44
|
-
PUL003 is the one error, so it fails `chant build`. A plaintext export already in the history stays there after the fix, so the rotation is not optional.
|
|
45
|
-
|
|
46
|
-
## Checking the result
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
npx chant build
|
|
50
|
-
npx chant lint
|
|
51
|
-
npx chant workspace graph
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
The member's nodes are the export's resources, `<member>/<type>::<name>`. With no export, `meta.pulumiMember` in the graph says why.
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
skill: chant-pulumi
|
|
3
|
-
description: Add a Pulumi program to a chant workspace as a member, read its preview into the change set and its refresh as drift, and watch it with PulumiWatchOp
|
|
4
|
-
user-invocable: true
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# A Pulumi Program as a Workspace Member
|
|
8
|
-
|
|
9
|
-
## What this lexicon covers
|
|
10
|
-
|
|
11
|
-
The pulumi lexicon declares no resource types and writes nothing. The Pulumi program, its `Pulumi.yaml` and its stack config stay the source of truth, and `pulumi up` stays the stack owner's command. chant reads the member and runs only these commands, none of which changes the stack:
|
|
12
|
-
|
|
13
|
-
| Read | Stock member | Member on plunge |
|
|
14
|
-
|---|---|---|
|
|
15
|
-
| graph | the checked-in `stack-export.json` | the same |
|
|
16
|
-
| change set | `pulumi preview --json` | `plunge preview --json` |
|
|
17
|
-
| drift | `pulumi refresh --preview-only --json --target <urn>` | `plunge drift --resource <urn> --stream` |
|
|
18
|
-
| applied outputs | `pulumi stack output --json --show-secrets=false` | `plunge stack output --json`, the same |
|
|
19
|
-
|
|
20
|
-
Any other argv is refused before it reaches the binary.
|
|
21
|
-
|
|
22
|
-
## Adding the member
|
|
23
|
-
|
|
24
|
-
List the directory that holds `Pulumi.yaml` in `chant.workspace.json` with kind `pulumi`, and pin the lexicon:
|
|
25
|
-
|
|
26
|
-
```json
|
|
27
|
-
{
|
|
28
|
-
"name": "shop",
|
|
29
|
-
"schema": 1,
|
|
30
|
-
"pins": [{ "package": "@intentius/chant-lexicon-pulumi", "version": "<version>" }],
|
|
31
|
-
"members": [{ "name": "infra", "dir": "infra", "kind": "pulumi" }]
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Check in the stack's export beside `Pulumi.yaml`, so the graph has nodes:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
cd infra && pulumi stack export --file stack-export.json
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Without it the member has no nodes, and a build that reads it reports PUL001. An export taken after an interrupted update reports PUL002; resolve the pending operations (`pulumi refresh`) and export again.
|
|
42
|
-
|
|
43
|
-
## Plan and drift
|
|
44
|
-
|
|
45
|
-
- `chant workspace plan` puts the member's `pulumi preview --json` in the change set, one entry per URN. Resources a program registers inside an `apply()` the preview could not run are marked `mayAppear`.
|
|
46
|
-
- `chant workspace drift --member infra [--resource <urn>] [--stream]` reads one targeted refresh per resource in the export.
|
|
47
|
-
- Another member reads the stack's outputs as parameters with `member-outputs`; the consumer lists `pulumi` among its lexicons.
|
|
48
|
-
|
|
49
|
-
A member runs on plunge when its config says `engine: "plunge"`, or when `Pulumi.yaml` has a `backend.url` starting with `plunge`. Only `Pulumi.yaml` decides, never `PULUMI_BACKEND_URL` or the CLI's login state.
|
|
50
|
-
|
|
51
|
-
## Watching a member
|
|
52
|
-
|
|
53
|
-
`PulumiWatchOp` previews the member and reads its drift on a schedule. It never applies.
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
import { PulumiWatchOp } from "@intentius/chant-lexicon-pulumi";
|
|
57
|
-
|
|
58
|
-
export const { op } = PulumiWatchOp({
|
|
59
|
-
name: "infra-watch",
|
|
60
|
-
member: "infra",
|
|
61
|
-
dir: "./infra",
|
|
62
|
-
stack: "dev",
|
|
63
|
-
schedule: "0 6 * * *",
|
|
64
|
-
});
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
The run publishes `Changes` (the preview plans something) and `Drift` (resources drifted or missing). `drift: false` leaves the drift phase out. Add `"pulumi"` to `lexicons` in `chant.config.ts` so the `pulumiPreview` and `pulumiDrift` activities load.
|
|
68
|
-
|
|
69
|
-
## Reading the member into a build
|
|
70
|
-
|
|
71
|
-
A project can read the member's graph into its own `chant build`:
|
|
72
|
-
|
|
73
|
-
```ts
|
|
74
|
-
import type { ChantConfig } from "@intentius/chant/config";
|
|
75
|
-
import "@intentius/chant-lexicon-pulumi";
|
|
76
|
-
|
|
77
|
-
export default {
|
|
78
|
-
lexicons: ["pulumi"],
|
|
79
|
-
pulumi: { member: { dir: "./infra", label: "infra" } },
|
|
80
|
-
} satisfies ChantConfig;
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
Write `dir` relative to the project root; PUL101 warns on an absolute path.
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The stack export as the member's snapshot (#4546): `pulumi-up` writes the
|
|
3
|
-
* export, secrets stripped, through the index store after `up`, and the
|
|
4
|
-
* graph and the member's reads take it before a checked-in
|
|
5
|
-
* `stack-export.json`.
|
|
6
|
-
*
|
|
7
|
-
* The runners are fakes answering with the recorded corpus export
|
|
8
|
-
* (`testdata/pulumi-preview/stack-export.json`), and the store is chant's
|
|
9
|
-
* `local` store in a temp directory, so no git ref is written, no engine
|
|
10
|
-
* runs and nothing reaches a backend.
|
|
11
|
-
*/
|
|
12
|
-
import { cpSync, mkdirSync, mkdtempSync, readFileSync } from "node:fs";
|
|
13
|
-
import { tmpdir } from "node:os";
|
|
14
|
-
import { join } from "node:path";
|
|
15
|
-
import { describe, expect, test } from "vitest";
|
|
16
|
-
import type { DeployContext } from "@intentius/chant/components/capability";
|
|
17
|
-
import { createSnapshotStore, type SnapshotStore } from "@intentius/chant/lifecycle/snapshot-store";
|
|
18
|
-
import { createPulumiUpCapability } from "./pulumi-up";
|
|
19
|
-
import { memberExportOf, type PulumiRunner } from "./run";
|
|
20
|
-
import {
|
|
21
|
-
pulumiExportSnapshotKey,
|
|
22
|
-
pulumiStackExportArgs,
|
|
23
|
-
readMemberExportStored,
|
|
24
|
-
readStoredPulumiExport,
|
|
25
|
-
stripPulumiExportSecrets,
|
|
26
|
-
writePulumiExportSnapshot,
|
|
27
|
-
} from "./stack-export-snapshot";
|
|
28
|
-
import { PULUMI_SECRET_SIG } from "./values";
|
|
29
|
-
import { readPulumiMember } from "./workspace-member";
|
|
30
|
-
|
|
31
|
-
const testdata = join(import.meta.dirname, "testdata");
|
|
32
|
-
const exportText = readFileSync(join(testdata, "pulumi-preview", "stack-export.json"), "utf-8");
|
|
33
|
-
const stream = readFileSync(join(testdata, "pulumi-stream", "preview-stream.ndjson"), "utf-8");
|
|
34
|
-
const upStream = stream.replaceAll(',"planning":true', "");
|
|
35
|
-
const stackOutput = readFileSync(join(testdata, "pulumi-outputs", "stack-output.json"), "utf-8");
|
|
36
|
-
const ctx: DeployContext = { env: "prod", component: "site" };
|
|
37
|
-
|
|
38
|
-
const tmp = (): string => mkdtempSync(join(tmpdir(), "pulumi-export-test-"));
|
|
39
|
-
const localStore = (): SnapshotStore => createSnapshotStore({ store: "local", dir: tmp() });
|
|
40
|
-
|
|
41
|
-
/** A stack directory with Pulumi.yaml and no checked-in export. */
|
|
42
|
-
function unexportedStack(): string {
|
|
43
|
-
const dir = tmp();
|
|
44
|
-
cpSync(join(testdata, "pulumi-preview", "Pulumi.yaml"), join(dir, "Pulumi.yaml"));
|
|
45
|
-
// Installed, so the step runs no install before the preview (plywood#22).
|
|
46
|
-
mkdirSync(join(dir, "node_modules"));
|
|
47
|
-
return dir;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function engine(): { run: PulumiRunner; calls: string[][] } {
|
|
51
|
-
const calls: string[][] = [];
|
|
52
|
-
const run: PulumiRunner = async (args) => {
|
|
53
|
-
calls.push(args);
|
|
54
|
-
if (args[0] === "preview") return { stdout: stream };
|
|
55
|
-
if (args[0] === "up") return { stdout: upStream };
|
|
56
|
-
if (args[0] === "stack" && args[1] === "export") return { stdout: exportText };
|
|
57
|
-
return { stdout: stackOutput };
|
|
58
|
-
};
|
|
59
|
-
return { run, calls };
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
describe("stripping secrets", () => {
|
|
63
|
-
test("every secret envelope becomes [secret] and the secrets provider's state is gone", () => {
|
|
64
|
-
const stripped = JSON.stringify(stripPulumiExportSecrets(JSON.parse(exportText)));
|
|
65
|
-
expect(exportText).toContain(PULUMI_SECRET_SIG);
|
|
66
|
-
expect(stripped).not.toContain(PULUMI_SECRET_SIG);
|
|
67
|
-
expect(stripped).not.toContain("ciphertext");
|
|
68
|
-
expect(stripped).not.toContain("salt");
|
|
69
|
-
expect(stripped).toContain('"dbPasswordValue":"[secret]"');
|
|
70
|
-
expect(stripped).toContain('"secrets_providers":{"type":"passphrase"}');
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test("a plaintext envelope is blinded too, and the input is left alone", () => {
|
|
74
|
-
const doc = { deployment: { resources: [{ urn: "u", type: "t", outputs: { p: { "4dabf18193072939515e22adb298388d": PULUMI_SECRET_SIG, plaintext: '"hunter2"' } } }] } };
|
|
75
|
-
const before = JSON.stringify(doc);
|
|
76
|
-
expect(JSON.stringify(stripPulumiExportSecrets(doc))).not.toContain("hunter2");
|
|
77
|
-
expect(JSON.stringify(doc)).toBe(before);
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
describe("writing and reading the snapshot", () => {
|
|
82
|
-
test("the export runs as stack export --stack <s> and lands at <env>/<stack>__pulumi-export", async () => {
|
|
83
|
-
const dir = unexportedStack();
|
|
84
|
-
const store = localStore();
|
|
85
|
-
const pulumi = engine();
|
|
86
|
-
const wrote = await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "pulumi", run: pulumi.run, store });
|
|
87
|
-
expect(pulumi.calls).toEqual([pulumiStackExportArgs({ stack: "floci" })]);
|
|
88
|
-
expect(pulumi.calls[0]).toEqual(["stack", "export", "--stack", "floci"]);
|
|
89
|
-
expect(wrote).toMatchObject({ written: true, key: `prod/${pulumiExportSnapshotKey("floci")}` });
|
|
90
|
-
const text = await store.readLatest("prod", "floci__pulumi-export", { cwd: dir });
|
|
91
|
-
expect(text).not.toBeNull();
|
|
92
|
-
expect(text).not.toContain(PULUMI_SECRET_SIG);
|
|
93
|
-
const snap = JSON.parse(text!);
|
|
94
|
-
expect(snap).toMatchObject({ lexicon: "pulumi", environment: "prod", stack: "floci", engine: "pulumi" });
|
|
95
|
-
expect(Object.keys(snap.resources).length).toBeGreaterThan(0);
|
|
96
|
-
expect(snap.stackExports.floci.dbPasswordValue).toBeUndefined();
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
test("plunge exports with plunge stack export", async () => {
|
|
100
|
-
const dir = unexportedStack();
|
|
101
|
-
const plunge = engine();
|
|
102
|
-
const stock = engine();
|
|
103
|
-
const wrote = await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "plunge", plunge: plunge.run, run: stock.run, store: localStore() });
|
|
104
|
-
expect(wrote.written).toBe(true);
|
|
105
|
-
expect(plunge.calls).toEqual([["stack", "export", "--stack", "floci"]]);
|
|
106
|
-
expect(stock.calls).toEqual([]);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
test("a failed export or a store that keeps nothing never throws", async () => {
|
|
110
|
-
const dir = unexportedStack();
|
|
111
|
-
const failing: PulumiRunner = async () => {
|
|
112
|
-
throw Object.assign(new Error("exit 255"), { code: 255, stderr: "error: no stack named floci" });
|
|
113
|
-
};
|
|
114
|
-
expect(await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "pulumi", run: failing, store: localStore() })).toMatchObject({
|
|
115
|
-
written: false,
|
|
116
|
-
reason: expect.stringMatching(/no stack named floci/),
|
|
117
|
-
});
|
|
118
|
-
const pulumi = engine();
|
|
119
|
-
expect(await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "pulumi", run: pulumi.run, store: createSnapshotStore({ store: "none" }) })).toMatchObject({ written: false });
|
|
120
|
-
expect(await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "pulumi", run: pulumi.run, store: null })).toMatchObject({ written: false });
|
|
121
|
-
expect(pulumi.calls).toEqual([]);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
test("the reads take the store's export, else the checked-in file", async () => {
|
|
125
|
-
const dir = unexportedStack();
|
|
126
|
-
const store = localStore();
|
|
127
|
-
expect(await readMemberExportStored(dir, { store })).toBeUndefined();
|
|
128
|
-
await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "pulumi", run: engine().run, store });
|
|
129
|
-
const read = await readMemberExportStored(dir, { stack: "floci", store });
|
|
130
|
-
expect(read?.source.from).toBe("store");
|
|
131
|
-
expect(JSON.stringify(read?.doc)).not.toContain(PULUMI_SECRET_SIG);
|
|
132
|
-
expect(await memberExportOf(dir, { store })).toEqual(read?.doc);
|
|
133
|
-
expect(await readStoredPulumiExport({ dir, stack: "other", store })).toBeUndefined();
|
|
134
|
-
|
|
135
|
-
const checkedIn = join(testdata, "pulumi-preview");
|
|
136
|
-
expect((await readMemberExportStored(checkedIn, { store: localStore() }))?.source).toEqual({ from: "file", file: "stack-export.json" });
|
|
137
|
-
expect(await memberExportOf(checkedIn, { store: null })).toEqual(JSON.parse(exportText));
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
test("with no stack named, a store holding two stacks' exports gives none", async () => {
|
|
141
|
-
const dir = unexportedStack();
|
|
142
|
-
const store = localStore();
|
|
143
|
-
await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "pulumi", run: engine().run, store });
|
|
144
|
-
await writePulumiExportSnapshot({ dir, stack: "staging", environment: "prod", engine: "pulumi", run: engine().run, store });
|
|
145
|
-
expect(await readStoredPulumiExport({ dir, store })).toBeUndefined();
|
|
146
|
-
expect((await readStoredPulumiExport({ dir, stack: "staging", store }))?.stack).toBe("staging");
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
describe("the graph read", () => {
|
|
151
|
-
test("a member with no stack-export.json reads its nodes from the store's export", async () => {
|
|
152
|
-
const dir = unexportedStack();
|
|
153
|
-
const store = localStore();
|
|
154
|
-
expect(readPulumiMember({ member: { dir, label: "web" } }).report.exported).toBe(false);
|
|
155
|
-
await writePulumiExportSnapshot({ dir, stack: "floci", environment: "prod", engine: "pulumi", run: engine().run, store });
|
|
156
|
-
const stored = await readStoredPulumiExport({ dir, stack: "floci", store });
|
|
157
|
-
const read = readPulumiMember({ member: { dir, label: "web" }, stored: { doc: stored!.doc, where: stored!.where, key: stored!.key } });
|
|
158
|
-
expect(read.report).toMatchObject({ exported: true, exportSource: "store", export: `${store.where}:prod/floci__pulumi-export` });
|
|
159
|
-
expect(read.entities.size).toBeGreaterThan(0);
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
test("a member with only a checked-in export reads as before", () => {
|
|
163
|
-
const read = readPulumiMember({ member: { dir: join(testdata, "pulumi-preview"), label: "web" } });
|
|
164
|
-
expect(read.report).toMatchObject({ exported: true, exportSource: "file", export: "stack-export.json" });
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
describe("pulumi-up writes it after up", () => {
|
|
169
|
-
test("stock: preview, up, stack output, then stack export into the store", async () => {
|
|
170
|
-
const dir = unexportedStack();
|
|
171
|
-
const store = localStore();
|
|
172
|
-
const pulumi = engine();
|
|
173
|
-
const cap = createPulumiUpCapability({ run: pulumi.run, env: {}, tmp: tmp(), snapshots: store });
|
|
174
|
-
const out = await cap.run(ctx, { dir, stack: "floci", engine: "pulumi" });
|
|
175
|
-
expect(pulumi.calls.map((c) => c.slice(0, 2).join(" "))).toEqual(["preview --json", "up --yes", "stack output", "stack export"]);
|
|
176
|
-
expect(out.exportSnapshot).toMatchObject({ written: true, key: "prod/floci__pulumi-export" });
|
|
177
|
-
expect((await readStoredPulumiExport({ dir, stack: "floci", store }))?.environment).toBe("prod");
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
test("a failed export leaves the apply standing", async () => {
|
|
181
|
-
const dir = unexportedStack();
|
|
182
|
-
const base = engine();
|
|
183
|
-
const run: PulumiRunner = async (args, opts) => {
|
|
184
|
-
if (args[0] === "stack" && args[1] === "export") throw Object.assign(new Error("exit 1"), { code: 1, stderr: "error: backend unreachable" });
|
|
185
|
-
return base.run(args, opts);
|
|
186
|
-
};
|
|
187
|
-
const cap = createPulumiUpCapability({ run, env: {}, tmp: tmp(), snapshots: localStore() });
|
|
188
|
-
const out = await cap.run(ctx, { dir, stack: "floci", engine: "pulumi" });
|
|
189
|
-
expect(out.exportSnapshot).toMatchObject({ written: false, reason: expect.stringMatching(/backend unreachable/) });
|
|
190
|
-
expect(out.outputs).toBeDefined();
|
|
191
|
-
});
|
|
192
|
-
});
|