Skip to content

feat(core): add source tracing for L1 construct property mutations#37543

Merged
mergify[bot] merged 2 commits intomainfrom
otaviom/property-tracing-2
Apr 7, 2026
Merged

feat(core): add source tracing for L1 construct property mutations#37543
mergify[bot] merged 2 commits intomainfrom
otaviom/property-tracing-2

Conversation

@otaviomacedo
Copy link
Copy Markdown
Contributor

Re-roll of #37285.

Add traceProperty utility that records metadata with stack traces on CfnResource property setters when CDK_DEBUG=1 is enabled.

Update spec2cdk code generation to emit getter/setter pairs (instead of plain fields) for mutable L1 properties, calling traceProperty in each setter to capture the call site.

The main difference in comparison with the previous attempt is that this time we are using the backing property (this._propertyName) instead of the getter (this.propertyName) in cfnProperties(). To make sure this regression doesn't happen again, there is a new test that verifies that we can create an L1 without deprecated properties.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Add `traceProperty` utility that records metadata with stack traces on CfnResource property setters when CDK_DEBUG=1 is enabled.

Update spec2cdk code generation to emit getter/setter pairs (instead of plain fields) for mutable L1 properties, calling traceProperty in each setter to capture the call site.

The main difference in comparison with the previous attempt is that this time we are using the backing property (`this._propertyName`) instead of the getter (`this.propertyName`) in `cfnProperties()`. To make sure this regression doesn't happen again, there is a new test that verifies that we can create an L1 without deprecated properties.
@otaviomacedo otaviomacedo requested a review from a team as a code owner April 7, 2026 12:06
@github-actions github-actions bot added the p2 label Apr 7, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team April 7, 2026 12:07
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Apr 7, 2026
@mergify mergify bot temporarily deployed to automation April 7, 2026 12:07 Inactive
@mergify mergify bot temporarily deployed to automation April 7, 2026 12:07 Inactive
Copy link
Copy Markdown
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.

(This review is outdated)

@otaviomacedo otaviomacedo added pr-linter/exempt-readme The PR linter will not require README changes pr-linter/exempt-integ-test The PR linter will not require integ test changes labels Apr 7, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 7, 2026 12:54

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 7, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 7, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 7, 2026

Merge Queue Status

  • Entered queue2026-04-07 13:03 UTC · Rule: default-squash
  • Checks passed · in-place
  • Merged2026-04-07 13:33 UTC · at d7bdbf5094331a5b94f025f3b54b2b4364520a18

This pull request spent 29 minutes 57 seconds in the queue, including 28 minutes 59 seconds running CI.

Required conditions to merge

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 7, 2026

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 8f38378 into main Apr 7, 2026
19 of 20 checks passed
@mergify mergify bot deleted the otaviom/property-tracing-2 branch April 7, 2026 13:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Apr 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2 pr-linter/exempt-integ-test The PR linter will not require integ test changes pr-linter/exempt-readme The PR linter will not require README changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants