Skip to content

fix(core): correct nested stack metadata collection boundary#36893

Open
Ashutosh0x wants to merge 2 commits intoaws:mainfrom
Ashutosh0x:fix/nested-stack-metadata
Open

fix(core): correct nested stack metadata collection boundary#36893
Ashutosh0x wants to merge 2 commits intoaws:mainfrom
Ashutosh0x:fix/nested-stack-metadata

Conversation

@Ashutosh0x
Copy link

This PR fixes an issue where metadata from nested stacks was not being correctly collected or was leaking into the parent stack's artifact.

Problem

The collectStackMetadata function was traversing into nested stacks, causing incorrect metadata association and potential duplication in the cloud assembly.

Solution

Corrects the collectStackMetadata traversal to respect stack boundaries, ensuring metadata is associated with the correct stack artifact.

Split from #36871

@Ashutosh0x Ashutosh0x requested a review from a team as a code owner February 5, 2026 14:10
@aws-cdk-automation aws-cdk-automation requested a review from a team February 5, 2026 14:10
@github-actions github-actions bot added p2 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK labels Feb 5, 2026
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Fixes must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

✅ A exemption request has been requested. Please wait for a maintainer's review.

@Ashutosh0x
Copy link
Author

Exemption Request

I have added a unit test metadata from nested stack is not collected in parent stack in
ew-style-synthesis.test.ts to verify the fix. This change affects internal metadata collection logic during synthesis and is best verified via unit tests checking the cloud assembly manifest, rather than a full integration test snapshot.

@aws-cdk-automation aws-cdk-automation added the pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback. label Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr-linter/exemption-requested The contributor has requested an exemption to the PR Linter feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants