Repository navigation
fix(lifecycle): observed nodes carry their own properties, stack exports stay on the stack (#1279) - #1821
Merged
Conversation
…rts stay on the stack (#1279) The AWS observation copied the stack's CloudFormation outputs onto every resource's `attributes`. A VPC came out carrying `expVpcId`, `expWebIp` and twenty-odd other keys every member of the stack also carried, and a plain `attr:` query on an observed node answered with the stack's exports rather than the resource's properties. The per-resource describe from #1279's first half already joined `CidrBlock`/`IsDefault` on top, but the exports stayed underneath, on every node. The outputs are the stack's. They now ride the observation envelope once, under `stackExports`, keyed by the stack that publishes them and scrubbed the same way they were before. `normalizeObservation`/`mergeObservations` carry the field, `observe` passes it onto the `LiveObservation`, and `buildLiveGraphIr` projects it onto the IR's `exports` with `value` and `stack`, which is where the declared graph already keeps what a stack publishes. `sourceOverlayGraphs` joins observed values onto the declared exports by name. Snapshots record it beside `resources` and replay it back through the same path, so a recorded estate and a live one agree. A node's `attrs` are now that resource's own properties and nothing else. Lexicons with no notion of a stack export are untouched.
… stackExports on the envelope)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The AWS
describeResourcescopied the stack's CloudFormation outputs onto every resource'sattributes. Every node in a stack carried the sameexpVpcId/expWebIp/... set, and a VPC'sattrswere the stack's exports rather than its ownCidrBlock/IsDefault.Stack exports now travel once, on the observation envelope, keyed by stack. A node's
attrsare the resource's own properties and nothing else. Same shape as #1267 gave snapshots.Changes
ObservationResult.stackExports(coreobservation.ts), carried bynormalizeObservation/mergeObservationsand theobservation()helper.LiveObservation.stackExports;buildLiveGraphIrprojects it ontoGraphIR.exportsas{ name, value, stack }.IRExportgains optionalvalue/stack.sourceOverlayGraphsjoins observed export values onto the declared exports by name and appends the stack-only ones.LifecycleSnapshot.stackExportsrecorded bytakeSnapshotand replayed byreplay.ts, so--atand--liveagree.describeResourcesstops copying outputs onto each resource and returns them understackExports[stackName](still scrubbed).describeOwnPropertiesunchanged in behaviour; its header comment no longer claims outputs are kept on the node.Tests
lexicons/aws/src/lifecycle-integration.test.ts: a live-observed VPC exposesCidrBlock/IsDefault, carries noexp*keys, and the stack carries the (scrubbed) exports; throughbuildLiveGraphIrthe exports land onir.exports, not the node.packages/core/src/graph-ir-live.test.ts: exports projection, omitted when none, and the source-overlay join.properties.test.tscase reworded: prior attrs are kept, own property wins the name.Full
npx vitest run: 975 files, 12342 tests passing. Coretsc --noEmitclean.Closes #1279