Skip to content

feat(cloud-assembly-api): expose property mutation sites - #2082

Open
proton0210 wants to merge 1 commit into
aws:explorer_2_assembly_loadingfrom
proton0210:feature/property-mutation-sites
Open

proton0210 wants to merge 1 commit into
aws:explorer_2_assembly_loadingfrom
proton0210:feature/property-mutation-sites

Conversation

@proton0210

Copy link
Copy Markdown
Contributor

Expose aws:cdk:propertyAssignment metadata as AssemblyIndexNode.propertyMutationStacks, grouped by CloudFormation property name. Preserve every recorded trace and make it available through both construct-path and template-location lookups, including nested stacks and assemblies.

Fixes #2064.

This PR targets explorer_2_assembly_loading and depends on #2055, which introduces AssemblyIndex. The diff contains only the mutation-site follow-up.

Validation:

  • Schema jsii compilation and assembly API TypeScript compilation pass.
  • All 41 assembly-index tests pass, including repeated traces, missing debug metadata, prototype-like property names, nested stacks and nested assemblies. The new mutation cases fail against the unmodified base implementation.
  • Full assembly API suite: 196/197 tests pass; all 8 snapshots pass. The unchanged test assembly with tree metadata having no file property specified also fails on base commit e61caab: it expects Invalid assembly manifest, while the base throws Invalid TreeCloudArtifact. Missing "file" property.
  • Focused ESLint and git diff --check pass.

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

@maintainer-for-aws

Copy link
Copy Markdown

Automated review

A maintainer will still review this — treat the notes below as a starting point.

📌 Commit f031958

This PR surfaces property-mutation traces on AssemblyIndex nodes in the @aws-cdk/cloud-assembly-api package, addressing a feature request to query mutation-site metadata that aws-cdk-lib emits in debug mode. It adds an optional propertyMutationStacks field on AssemblyIndexNode (keyed by CloudFormation property name) and fills in the previously-reserved PROPERTY_ASSIGNMENT metadata case, along with README documentation and tests.

The change is purely additive, with no modification to existing exports or behavior. The accumulation logic uses a null-prototype map to neutralize prototype-pollution from user-controlled property names, preserves traces in metadata order, and the destructured entry shape matches the schema's PropertyMutationMetadataEntry. Test coverage is thorough, including prototype-like names, repeated and empty traces, and reachability through both byPath() and byTemplateLocation() for nested stacks and assemblies. No issues found on this change.

🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional


Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews.

This branch is waiting to be deployed

1 failed and 1 waiting deployments
integ-approval — f0319586 Waiting Oct 23, 2026 by proton0210 via prepare #7434
automation — f0319586 Deployed Oct 23, 2026 by proton0210 via Triage Pull Requests #2239
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant