Skip to content

fix(core): tree.json unintentionally includes telemetry metadata#36748

Merged
mergify[bot] merged 3 commits intomainfrom
mrgrain/fix/tree-json-includes-telemetry-metadata
Jan 22, 2026
Merged

fix(core): tree.json unintentionally includes telemetry metadata#36748
mergify[bot] merged 3 commits intomainfrom
mrgrain/fix/tree-json-includes-telemetry-metadata

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Jan 21, 2026

Reason for this change

The ConstructInfo interface is used both for telemetry analytics (sent to AWS) and for the tree.json output. Previously, telemetry metadata was being added to ConstructInfo, which caused it to leak into tree.json - a file that should only contain basic construct information (fqn and version).

Description of changes

This PR separates the concerns by:

  1. Keeping ConstructInfo clean with only fqn and version - this is the public contract for tree.json
  2. Introducing a new ConstructAnalytics interface that extends ConstructInfo with optional telemetryMetadata
  3. Moving the analytics-specific logic from runtime-info.ts to a new stack-metadata.ts file
  4. The telemetry metadata is now only collected and used within the analytics pipeline, never touching tree.json

The feature flag ENABLE_ADDITIONAL_METADATA_COLLECTION continues to control whether telemetry metadata is included in the analytics sent to AWS.

Description of how you validated changes

  • Existing unit tests updated and passing
  • Added new test for metadata type filtering
  • Moved jsii-dependent tests to framework-integ package where they can properly test against compiled aws-cdk-lib

Checklist


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

@mrgrain mrgrain requested a review from a team as a code owner January 21, 2026 11:28
@github-actions github-actions bot added the p2 label Jan 21, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team January 21, 2026 11:28
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 21, 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.

(This review is outdated)

@mrgrain mrgrain added the pr-linter/exempt-integ-test The PR linter will not require integ test changes label Jan 21, 2026
@mrgrain mrgrain changed the title fix(core): tree.json includes telemetry metadata fix(core): tree.json unintentionally includes telemetry metadata Jan 21, 2026
@aws-cdk-automation aws-cdk-automation dismissed their stale review January 21, 2026 11:37

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

@mrgrain mrgrain force-pushed the mrgrain/fix/tree-json-includes-telemetry-metadata branch 2 times, most recently from dbc105c to d4e926a Compare January 21, 2026 11:39
@mrgrain mrgrain force-pushed the mrgrain/fix/tree-json-includes-telemetry-metadata branch 4 times, most recently from 3b5a2f0 to f4d70c0 Compare January 21, 2026 16:42
@mrgrain mrgrain force-pushed the mrgrain/fix/tree-json-includes-telemetry-metadata branch from f4d70c0 to 3e23d39 Compare January 21, 2026 16:59
Copy link
Contributor Author

Choose a reason for hiding this comment

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

split-out from runtime-info.test.ts

Copy link
Contributor Author

@mrgrain mrgrain Jan 21, 2026

Choose a reason for hiding this comment

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

adjusted and moved into metadata-resource.test.ts

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 21, 2026
@rix0rrr rix0rrr added the pr/do-not-merge This PR should not be merged at this time. label Jan 22, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jan 22, 2026
@mrgrain mrgrain removed the pr/do-not-merge This PR should not be merged at this time. label Jan 22, 2026
@mrgrain
Copy link
Contributor Author

mrgrain commented Jan 22, 2026

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Jan 22, 2026

update

✅ Branch has been successfully updated

@mergify
Copy link
Contributor

mergify bot commented Jan 22, 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 87fd86b into main Jan 22, 2026
17 of 18 checks passed
@mergify mergify bot deleted the mrgrain/fix/tree-json-includes-telemetry-metadata branch January 22, 2026 12:19
@mergify
Copy link
Contributor

mergify bot commented Jan 22, 2026

Merge Queue Status

✅ The pull request has been merged at 039741f

This pull request spent 6 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

@github-actions
Copy link
Contributor

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 Jan 22, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants