@intentius/chant-lexicon-pulumi 0.124.97 → 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/change-set.test.ts
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The Pulumi change-set adapter (#4453): `pulumi preview --json` into a
|
|
3
|
-
* change-set part, planner `pulumi`.
|
|
4
|
-
*
|
|
5
|
-
* `testdata/pulumi-preview` is recorded (#4475; see its README): pulumi
|
|
6
|
-
* 3.272.0 against the plunge corpus's aws-ts program on floci. `stack-export.json`
|
|
7
|
-
* is the settled stack; `preview.json` is `preview --json --show-sames` after
|
|
8
|
-
* the stack config dropped a worker queue, raised the events queue's
|
|
9
|
-
* retention, set a new secret and the program moved the VPC's CIDR (a
|
|
10
|
-
* replace, and a replace of the security group that reads its id);
|
|
11
|
-
* `preview-create.json` is the first preview of a fresh stack. Nothing here
|
|
12
|
-
* runs Pulumi.
|
|
13
|
-
*/
|
|
14
|
-
import { readFileSync } from "node:fs";
|
|
15
|
-
import { join } from "node:path";
|
|
16
|
-
import { describe, expect, test } from "vitest";
|
|
17
|
-
import { composeChangeSet, isEmptyChangeSet, lifecyclePlanPart, readChangeSetPartFile, verifyChangeSetDigest } from "@intentius/chant/change-set";
|
|
18
|
-
import { mapChangeSetToGraph } from "@intentius/chant/change-set-graph";
|
|
19
|
-
import type { ChangeSet as LifecycleChangeSet } from "@intentius/chant/lifecycle/change-set";
|
|
20
|
-
import { pulumiMayAppearAddress } from "@intentius/chant/pulumi-urn";
|
|
21
|
-
import { contract, REPO } from "../../../packages/core/src/workspace/__fixtures__/contract-repo";
|
|
22
|
-
import schema from "../../../packages/core/src/workspace/change-set.schema.json";
|
|
23
|
-
import { pulumiPreviewDigest, pulumiPreviewPart } from "./change-set";
|
|
24
|
-
import { pulumiPlannedStackOutputs, pulumiExportedStackOutputs } from "./stack-outputs";
|
|
25
|
-
import { readPulumiMember } from "./workspace-member";
|
|
26
|
-
|
|
27
|
-
const dir = join(import.meta.dirname, "testdata", "pulumi-preview");
|
|
28
|
-
const read = (name: string): unknown => JSON.parse(readFileSync(join(dir, name), "utf-8"));
|
|
29
|
-
const preview = read("preview.json");
|
|
30
|
-
const created = read("preview-create.json");
|
|
31
|
-
const prior = read("stack-export.json");
|
|
32
|
-
const urn = (type: string, name: string) => `urn:pulumi:floci::corpus-aws-ts::${type}::${name}`;
|
|
33
|
-
const DOCS = urn("corpus:index:Site", "docs");
|
|
34
|
-
const EVENTS = urn("aws:sqs/queue:Queue", "events");
|
|
35
|
-
|
|
36
|
-
const part = () => pulumiPreviewPart({ member: "site", preview, prior, stack: "floci" });
|
|
37
|
-
const createPart = () => pulumiPreviewPart({ member: "site", preview: created, stack: "floci" });
|
|
38
|
-
const entryIn = (p: ReturnType<typeof part>, address: string) => p.entries.find((e) => e.address === address && e.mayAppear === undefined) ?? p.entries.find((e) => e.address === address)!;
|
|
39
|
-
const entry = (address: string) => entryIn(part(), address);
|
|
40
|
-
|
|
41
|
-
const { expectValid } = contract(schema);
|
|
42
|
-
|
|
43
|
-
describe("pulumi preview --json to a change-set part (#4453)", () => {
|
|
44
|
-
test("the member: planner pulumi, planned, the preview's digest, no holes", () => {
|
|
45
|
-
const { member } = part();
|
|
46
|
-
expect(member).toEqual({
|
|
47
|
-
member: "site",
|
|
48
|
-
lexicon: "pulumi",
|
|
49
|
-
planner: "pulumi",
|
|
50
|
-
scope: "floci",
|
|
51
|
-
status: "planned",
|
|
52
|
-
planDigest: pulumiPreviewDigest(preview),
|
|
53
|
-
holes: [],
|
|
54
|
-
});
|
|
55
|
-
expect(member.planDigest).toMatch(/^jcs1-sha256:/);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
test("a resource that reads an output of one being created or replaced shows the dependent input as unknown", () => {
|
|
59
|
-
const policy = entryIn(createPart(), urn("aws:s3/bucketPolicy:BucketPolicy", "site-bucket-policy"));
|
|
60
|
-
expect(policy.action).toBe("create");
|
|
61
|
-
expect(policy.attributes).toEqual([
|
|
62
|
-
{ path: "bucket", unknown: true },
|
|
63
|
-
{ path: "policy", unknown: true },
|
|
64
|
-
{ path: "region", after: "us-east-1" },
|
|
65
|
-
]);
|
|
66
|
-
// The security group reads the VPC being replaced: its vpcId keeps the value before and is unknown after.
|
|
67
|
-
const sg = entry(urn("aws:ec2/securityGroup:SecurityGroup", "app-sg"));
|
|
68
|
-
expect(sg).toMatchObject({ action: "replace", disruption: "replace", id: "sg-68951e51c2f001baa" });
|
|
69
|
-
expect(sg.attributes).toEqual([{ path: "vpcId", before: "vpc-05097b38", unknown: true, forcesReplacement: true }]);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
test("a create writes every input but Pulumi's __defaults", () => {
|
|
73
|
-
expect(entryIn(createPart(), urn("aws:s3/bucket:Bucket", "site-bucket")).attributes).toEqual([
|
|
74
|
-
{ path: "bucket", after: "rec-ts-site" },
|
|
75
|
-
{ path: "region", after: "us-east-1" },
|
|
76
|
-
{ path: "tags", after: { "corpus-owner": "plunge", "corpus-program": "aws-ts" } },
|
|
77
|
-
{ path: "tagsAll", after: { "corpus-owner": "plunge", "corpus-program": "aws-ts" } },
|
|
78
|
-
]);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
test("an in-place update names the changed input, before and after", () => {
|
|
82
|
-
expect(entry(EVENTS)).toMatchObject({ action: "update", disruption: "in-place" });
|
|
83
|
-
expect(entry(EVENTS).attributes).toEqual([{ path: "messageRetentionSeconds", before: 3600, after: 7200 }]);
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
test("a secret is sensitive with neither value; a computed output the diff names is known only after apply", () => {
|
|
87
|
-
// The preview prints the secret as the blinded "[secret]".
|
|
88
|
-
expect(entry(urn("aws:ssm/parameter:Parameter", "db-password")).attributes).toEqual([
|
|
89
|
-
{ path: "value", sensitive: true },
|
|
90
|
-
{ path: "version", before: 3, unknown: true },
|
|
91
|
-
]);
|
|
92
|
-
expect(entryIn(createPart(), urn("aws:ssm/parameter:Parameter", "db-password")).attributes).toContainEqual({ path: "value", sensitive: true });
|
|
93
|
-
expect(JSON.stringify(part())).not.toContain("[secret]");
|
|
94
|
-
expect(JSON.stringify(createPart())).not.toContain("[secret]");
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
test("a replace is one step at preview, one replace entry, forced by the CIDR", () => {
|
|
98
|
-
const vpc = part().entries.filter((e) => e.address === urn("aws:ec2/vpc:Vpc", "main"));
|
|
99
|
-
expect(vpc).toHaveLength(1);
|
|
100
|
-
expect(vpc[0]).toMatchObject({ action: "replace", disruption: "replace", id: "vpc-05097b38" });
|
|
101
|
-
expect(vpc[0].attributes).toEqual([{ path: "cidrBlock", before: "10.42.0.0/16", after: "10.43.0.0/16", forcesReplacement: true }]);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test("same steps are no-ops, the stack, a component and an explicit provider included; a top-level delete is a plain delete", () => {
|
|
105
|
-
expect(entry(urn("pulumi:pulumi:Stack", "corpus-aws-ts-floci")).action).toBe("no-op");
|
|
106
|
-
expect(entry(urn("pulumi:providers:aws", "west")).action).toBe("no-op");
|
|
107
|
-
expect(entry(DOCS).action).toBe("no-op");
|
|
108
|
-
const worker = entry(urn("aws:sqs/queue:Queue", "worker-2"));
|
|
109
|
-
expect(worker).toMatchObject({ action: "delete", disruption: "destroy" });
|
|
110
|
-
expect(worker.mayAppear).toBeUndefined();
|
|
111
|
-
// Registered inside vpc.id.apply(...) at the top level: with the VPC replaced the callback does not run, and the
|
|
112
|
-
// preview prints a delete. Nothing tells it from a removed resource, so it stays a plain delete (adapter header).
|
|
113
|
-
expect(entry(urn("aws:ssm/parameter:Parameter", "vpc-id"))).toMatchObject({ action: "delete", disruption: "destroy" });
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
test("what preview cannot list may appear, never omitted", () => {
|
|
117
|
-
// A component creating children at a first preview: an apply() inside it may be waiting, so its children may appear.
|
|
118
|
-
expect(createPart().entries.filter((e) => e.mayAppear === true).map((e) => [e.address, e.action])).toEqual([[pulumiMayAppearAddress(DOCS), "create"]]);
|
|
119
|
-
expect(pulumiMayAppearAddress(DOCS)).toBe("urn:pulumi:floci::corpus-aws-ts::corpus:index:Site$*::docs/*");
|
|
120
|
-
// With --show-sames every resource the export holds is listed, so the change preview marks nothing.
|
|
121
|
-
expect(part().entries.filter((e) => e.mayAppear === true)).toEqual([]);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
test("without --show-sames a preview lists no unchanged resource, so each one the export holds would read as may-appear", () => {
|
|
125
|
-
const doc = preview as { steps: { op: string; urn: string }[] };
|
|
126
|
-
const sameless = { ...doc, steps: doc.steps.filter((s) => s.op !== "same" || s.urn.includes("pulumi:pulumi:Stack")) };
|
|
127
|
-
const marked = pulumiPreviewPart({ member: "site", preview: sameless, prior, stack: "floci" }).entries.filter((e) => e.mayAppear === true);
|
|
128
|
-
expect(marked.map((e) => e.address)).toContain(urn("aws:iam/role:Role", "app-role"));
|
|
129
|
-
expect(marked.every((e) => e.action === "update" && e.disruption === "unknown")).toBe(true);
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test("a targeted preview lists only its targets, so the export's other resources are not marked", () => {
|
|
133
|
-
const one = { steps: (preview as { steps: { urn: string }[] }).steps.filter((s) => s.urn === EVENTS) };
|
|
134
|
-
const targeted = pulumiPreviewPart({ member: "site", preview: one, prior, targeted: true });
|
|
135
|
-
expect(targeted.entries.map((e) => e.address)).toEqual([EVENTS]);
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
test("a may-appear entry keeps the set from reading empty", () => {
|
|
139
|
-
const sameOnly = { steps: [{ op: "same", urn: DOCS, newState: { urn: DOCS, custom: false, type: "corpus:index:Site" } }] };
|
|
140
|
-
expect(isEmptyChangeSet(composeChangeSet([pulumiPreviewPart({ member: "site", preview: sameOnly })]))).toBe(true);
|
|
141
|
-
const withPrior = composeChangeSet([pulumiPreviewPart({ member: "site", preview: sameOnly, prior })]);
|
|
142
|
-
expect(withPrior.entries.some((e) => e.mayAppear === true)).toBe(true);
|
|
143
|
-
expect(isEmptyChangeSet(withPrior)).toBe(false);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
test("an op the change set has no action for is a hole, not a guess", () => {
|
|
147
|
-
const odd = pulumiPreviewPart({ member: "site", preview: { steps: [{ op: "frobnicate", urn: urn("aws:s3/bucket:Bucket", "x") }] } });
|
|
148
|
-
expect(odd.entries).toEqual([]);
|
|
149
|
-
expect(odd.member.holes).toEqual([{ address: urn("aws:s3/bucket:Bucket", "x"), type: "aws:s3/bucket:Bucket", reason: expect.stringMatching(/frobnicate/) }]);
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
test("a failed preview is a failed member with no digest; a document with no steps and no error is refused", () => {
|
|
153
|
-
const failed = pulumiPreviewPart({ member: "site", preview: {}, error: "boom" });
|
|
154
|
-
expect(failed.member).toMatchObject({ status: "failed", error: "boom", planDigest: null });
|
|
155
|
-
expect(() => pulumiPreviewPart({ member: "site", preview: { nope: true } })).toThrow(/no top-level "steps"/);
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
const moveRetention = () => {
|
|
159
|
-
const moved = JSON.parse(JSON.stringify(preview)) as { steps: { urn: string; newState?: { inputs?: Record<string, unknown> } }[] };
|
|
160
|
-
moved.steps.find((s) => s.urn === EVENTS)!.newState!.inputs!.messageRetentionSeconds = 9000;
|
|
161
|
-
return moved;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
test("the digest ignores step order, duration and diagnostics, and moves with an input", () => {
|
|
165
|
-
const doc = preview as { steps: unknown[]; duration: number };
|
|
166
|
-
const shuffled = { ...doc, steps: [...doc.steps].reverse(), duration: 1, diagnostics: [{ severity: "info", message: "hi" }] };
|
|
167
|
-
expect(pulumiPreviewDigest(shuffled)).toBe(pulumiPreviewDigest(preview));
|
|
168
|
-
expect(pulumiPreviewDigest(moveRetention())).not.toBe(pulumiPreviewDigest(preview));
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
test("a Pulumi part joins a multi-engine change set under one document digest", () => {
|
|
172
|
-
const lifecycle = lifecyclePlanPart({
|
|
173
|
-
member: "dns",
|
|
174
|
-
plan: JSON.parse(readFileSync(join(REPO, "packages", "core", "src", "__fixtures__", "change-set", "lifecycle-plan.floci.json"), "utf-8")) as LifecycleChangeSet,
|
|
175
|
-
});
|
|
176
|
-
const doc = composeChangeSet([lifecycle, part()]);
|
|
177
|
-
expectValid(doc);
|
|
178
|
-
expect(doc.members.map((m) => [m.member, m.planner])).toEqual([
|
|
179
|
-
["dns", "chant"],
|
|
180
|
-
["site", "pulumi"],
|
|
181
|
-
]);
|
|
182
|
-
expect(verifyChangeSetDigest(doc)).toBe(true);
|
|
183
|
-
expect(doc.summary.byMember.site).toBeDefined();
|
|
184
|
-
// The Pulumi member's plan is in the one digest: changing an input moves the document's.
|
|
185
|
-
const other = composeChangeSet([lifecycle, pulumiPreviewPart({ member: "site", preview: moveRetention(), prior, stack: "floci" })]);
|
|
186
|
-
expect(other.members.find((m) => m.member === "site")!.planDigest).not.toBe(doc.members.find((m) => m.member === "site")!.planDigest);
|
|
187
|
-
expect(other.digest).not.toBe(doc.digest);
|
|
188
|
-
// Order of the parts makes no difference.
|
|
189
|
-
expect(composeChangeSet([part(), lifecycle]).digest).toBe(doc.digest);
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
test("a part written to a file reads back as planner pulumi", () => {
|
|
193
|
-
const back = readChangeSetPartFile(JSON.parse(JSON.stringify(part())), "pulumi", "site-renamed");
|
|
194
|
-
expect(back.member.member).toBe("site-renamed");
|
|
195
|
-
expect(back.entries.every((e) => e.member === "site-renamed" && e.planner === "pulumi")).toBe(true);
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
test("entries land on the member graph's nodes by the URN rule; a may-appear entry on its component", () => {
|
|
199
|
-
const ids = [...readPulumiMember({ member: { dir, label: "site" } }).entities.keys()];
|
|
200
|
-
const nodeIn = (p: ReturnType<typeof part>, address: string) => {
|
|
201
|
-
const mapped = mapChangeSetToGraph(composeChangeSet([p]), { member: null, at: null, ids });
|
|
202
|
-
expect(verifyChangeSetDigest(mapped)).toBe(true);
|
|
203
|
-
return mapped.entries.find((e) => e.address === address)!.node;
|
|
204
|
-
};
|
|
205
|
-
expect(nodeIn(part(), EVENTS)).toBe("site/aws:sqs/queue:Queue::events");
|
|
206
|
-
expect(nodeIn(part(), urn("corpus:index:Site$aws:s3/bucket:Bucket", "docs-assets"))).toBe("site/corpus:index:Site$aws:s3/bucket:Bucket::docs-assets");
|
|
207
|
-
expect(nodeIn(createPart(), pulumiMayAppearAddress(DOCS))).toBe("site/corpus:index:Site::docs");
|
|
208
|
-
// The stack and providers are on no node.
|
|
209
|
-
expect(nodeIn(part(), urn("pulumi:pulumi:Stack", "corpus-aws-ts-floci"))).toBeNull();
|
|
210
|
-
expect(nodeIn(part(), urn("pulumi:providers:aws", "west"))).toBeNull();
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
describe("stack outputs, the seam for engine outputs into chant parameters (#4455)", () => {
|
|
215
|
-
test("a real preview's stack step carries no outputs, so none are planned", () => {
|
|
216
|
-
expect(pulumiPlannedStackOutputs(preview)).toBeUndefined();
|
|
217
|
-
expect(pulumiPlannedStackOutputs(created)).toBeUndefined();
|
|
218
|
-
// A step that does carry them is read, unknowns and secrets marked.
|
|
219
|
-
const STACK = urn("pulumi:pulumi:Stack", "corpus-aws-ts-floci");
|
|
220
|
-
const carrying = { steps: [{ op: "same", urn: STACK, newState: { urn: STACK, type: "pulumi:pulumi:Stack", outputs: { a: "x", b: "04da6b54-80e4-46f7-96ec-b56ff0331ba9", c: "[secret]" } } }] };
|
|
221
|
-
expect(pulumiPlannedStackOutputs(carrying)).toEqual([
|
|
222
|
-
{ name: "a", value: "x" },
|
|
223
|
-
{ name: "b", unknown: true },
|
|
224
|
-
{ name: "c", secret: true },
|
|
225
|
-
]);
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
test("exported outputs are what the last apply produced", () => {
|
|
229
|
-
const outputs = pulumiExportedStackOutputs(prior);
|
|
230
|
-
expect(outputs).toContainEqual({ name: "vpcId", value: "vpc-05097b38" });
|
|
231
|
-
expect(outputs).toContainEqual({ name: "siteBucketName", value: "rec-ts-site" });
|
|
232
|
-
expect(outputs).toContainEqual({ name: "dbPasswordValue", secret: true });
|
|
233
|
-
expect(outputs).toHaveLength(13);
|
|
234
|
-
});
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
describe("the digest of a replacement", () => {
|
|
238
|
-
const replacement = (id: string) => ({
|
|
239
|
-
steps: [{ op: "replace", urn: "urn:pulumi:prod::shop::command:local:Command::rotate", oldState: { id: "rotate-recorded", inputs: {} }, newState: { id, inputs: {} } }],
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
test("leaves out the id a preview makes up, so two previews of one change agree (plywood#44)", () => {
|
|
243
|
-
expect(pulumiPreviewDigest(replacement("rotate2d1f5adb"))).toBe(pulumiPreviewDigest(replacement("rotated545265a")));
|
|
244
|
-
});
|
|
245
|
-
});
|