You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The mapping rule for Pulumi resources in the graph, change sets and drift records. Accepted when the stack-export render and the preview-based change set map the same resource to the same node.
Acceptance: read verdict lines and recorded artifacts, never exit codes alone. Anything that needs an emulator corpus, an estate run or a real cloud is run by the maintainer by hand. Red-first only for new guards.
Merged into integration/pulumi-engine as b7a2b96 (unit branch unit/c6-pulumi-urn-node, commit fe818c9).
What landed
The rule lives in packages/core/src/pulumi-urn.ts, imported as @intentius/chant/pulumi-urn (core's ./* export). The node key is the URN without its stack and project, <qualified type>::<name> (for example aws:s3/bucket:Bucket::assets, my:web:Site$my:web:Cdn$aws:cloudfront/distribution:Distribution::site-cdn). Inside a workspace the id is <member>/<key>, the same as the terraform lexicon's <root>/<block key>. Provider resources (pulumi:providers:* at any depth, checked on the last type in the $ chain) and the root pulumi:pulumi:Stack get null, so a change-set entry or drift record for one ends up with node: null. Exports: parsePulumiUrn, pulumiNodeKey, pulumiNodeId, isPulumiNodeless, pulumiNodeCandidates({member, address}) (the same shape as changeSetNodeCandidates in change-set-graph.ts:108) and pulumiPreviewNodes(previewJson, member). Like change-set.ts, it has no runtime imports, so the change-set and drift-record bundles can include it.
The stack-export render (lexicons/terraform/src/workspace-member.ts:86-88) now calls the rule instead of its local urnTail. Node ids are the same as before, with one change: the root stack node <member>/pulumi:pulumi:Stack::<name> is gone, and so are the parent edges that pointed at it. workspace-member.test.ts and the pulumi row in docs/.../reference/workspace-kinds.mdx are updated to match.
The fixtures are in lexicons/terraform/src/testdata/pulumi-urn-node/: stack-export.json and preview.json of the same program. The program has a top-level bucket, a component with a component-scoped provider, a child policy, a nested component with a distribution that gets replaced (three steps on one URN), a create that isn't in the export yet, and a delete. lexicons/terraform/src/pulumi-urn-node.test.ts checks that every resource present in both files maps to the same node, that the three replace steps land on one node, that the new create maps to an id the graph doesn't hold, that providers and the stack map to nothing, and that the key ignores stack and project. The test was written but not run.
Decision on the node id
The recommendation was to nest ids by component name (<component name>/<child name>). I didn't do that. The id is a function of the URN alone, because:
change-set mapping takes only {member, planner, address} (change-set-graph.ts:108);
a drift record carries only the URN in address;
a component's name isn't part of its children's URNs, and a --targeted preview or a delete step need not include the parents' records, so an id built from names could differ between the export and the change set.
The parent type chain is still in the key through the qualified type. A child sits under its component in the graph through the parent edge, which the render already draws. This also kept every existing node id unchanged apart from the stack root.
Still missing
The change-set planner value pulumi and its case in changeSetNodeCandidates are C3's (multi-engine C3: the pulumi lexicon #4453). The adapter should set address to the URN and return pulumiNodeCandidates(entry) there.
When C3 moves the member kind into lexicons/pulumi, workspace-member.ts, its two tests and both testdata directories move with it. pulumi-urn.ts stays in core.
The maintainer has to run the tests by hand: npx vitest run lexicons/terraform/src/pulumi-urn-node.test.ts lexicons/terraform/src/workspace-member.test.ts.
preview.json is hand-written from the documented pulumi preview --json shape (steps[].op/urn/oldState/newState), not recorded from a real run.
Compile check: npx tsc --noEmit -p packages/core is clean. npx tsc --noEmit -p lexicons/terraform only reports TS6059/TS6307 rootDir errors for core files this change doesn't touch (yaml.ts, which-chant). With --rootDir . it's clean.
Path 2 of the multi-engine engine tier is on main: plunge d6db28acdf, chant 867a12c, behold 9f7066ee (merge commits of integration/pulumi-engine, trees identical to the tested tips; path 1 was already on main). Acceptance met at epic-ready: pulumi-urn-node.test.ts passes (the stack-export render and the preview-based change set map each resource to the same node).
Activity
pulumi: one URN-to-node rule for the graph, change sets and drift (#4456
Merge unit/c6-pulumi-urn-node: #4456 Pulumi URN to graph node
lex00 commentedon Oct 25, 2026
Merged into
integration/pulumi-engineas b7a2b96 (unit branchunit/c6-pulumi-urn-node, commit fe818c9).What landed
The rule lives in
packages/core/src/pulumi-urn.ts, imported as@intentius/chant/pulumi-urn(core's./*export). The node key is the URN without its stack and project,<qualified type>::<name>(for exampleaws:s3/bucket:Bucket::assets,my:web:Site$my:web:Cdn$aws:cloudfront/distribution:Distribution::site-cdn). Inside a workspace the id is<member>/<key>, the same as the terraform lexicon's<root>/<block key>. Provider resources (pulumi:providers:*at any depth, checked on the last type in the$chain) and the rootpulumi:pulumi:Stackget null, so a change-set entry or drift record for one ends up withnode: null. Exports:parsePulumiUrn,pulumiNodeKey,pulumiNodeId,isPulumiNodeless,pulumiNodeCandidates({member, address})(the same shape aschangeSetNodeCandidatesinchange-set-graph.ts:108) andpulumiPreviewNodes(previewJson, member). Likechange-set.ts, it has no runtime imports, so the change-set and drift-record bundles can include it.The stack-export render (
lexicons/terraform/src/workspace-member.ts:86-88) now calls the rule instead of its localurnTail. Node ids are the same as before, with one change: the root stack node<member>/pulumi:pulumi:Stack::<name>is gone, and so are theparentedges that pointed at it.workspace-member.test.tsand the pulumi row indocs/.../reference/workspace-kinds.mdxare updated to match.The fixtures are in
lexicons/terraform/src/testdata/pulumi-urn-node/:stack-export.jsonandpreview.jsonof the same program. The program has a top-level bucket, a component with a component-scoped provider, a child policy, a nested component with a distribution that gets replaced (three steps on one URN), a create that isn't in the export yet, and a delete.lexicons/terraform/src/pulumi-urn-node.test.tschecks that every resource present in both files maps to the same node, that the three replace steps land on one node, that the new create maps to an id the graph doesn't hold, that providers and the stack map to nothing, and that the key ignores stack and project. The test was written but not run.Decision on the node id
The recommendation was to nest ids by component name (
<component name>/<child name>). I didn't do that. The id is a function of the URN alone, because:{member, planner, address}(change-set-graph.ts:108);address;--targeted preview or a delete step need not include the parents' records, so an id built from names could differ between the export and the change set.The parent type chain is still in the key through the qualified type. A child sits under its component in the graph through the
parentedge, which the render already draws. This also kept every existing node id unchanged apart from the stack root.Still missing
pulumiand itscaseinchangeSetNodeCandidatesare C3's (multi-engine C3: the pulumi lexicon #4453). The adapter should setaddressto the URN and returnpulumiNodeCandidates(entry)there.lexicons/pulumi,workspace-member.ts, its two tests and both testdata directories move with it.pulumi-urn.tsstays in core.npx vitest run lexicons/terraform/src/pulumi-urn-node.test.ts lexicons/terraform/src/workspace-member.test.ts.preview.jsonis hand-written from the documentedpulumi preview --jsonshape (steps[].op/urn/oldState/newState), not recorded from a real run.Compile check:
npx tsc --noEmit -p packages/coreis clean.npx tsc --noEmit -p lexicons/terraformonly reports TS6059/TS6307 rootDir errors for core files this change doesn't touch (yaml.ts,which-chant). With--rootDir .it's clean.Merge integration/choudoufu-engine into integration/pulumi-engine (ch…
pulumi lexicon: the member kind, a preview change set and refresh dri…
lex00 commentedon Oct 25, 2026
Path 2 of the multi-engine engine tier is on main: plunge d6db28acdf, chant 867a12c, behold 9f7066ee (merge commits of integration/pulumi-engine, trees identical to the tested tips; path 1 was already on main). Acceptance met at epic-ready: pulumi-urn-node.test.ts passes (the stack-export render and the preview-based change set map each resource to the same node).