Skip to content

fix(mixin): use withMixin in Stack to set mixin metadata in its constructs#37269

Merged
mergify[bot] merged 3 commits intomainfrom
stack-mixin-metadata
Mar 24, 2026
Merged

fix(mixin): use withMixin in Stack to set mixin metadata in its constructs#37269
mergify[bot] merged 3 commits intomainfrom
stack-mixin-metadata

Conversation

@Abogical
Copy link
Copy Markdown
Member

Reason for this change

Previously, if a stack has a mixin applied (using with), the stack's child constructs will not have its mixin metadata set. Stack used applyTo directly instead of applyMixin which adds the metadata via addMetadata in https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/mixins/private/mixin-metadata.ts#L30.

Description of changes

Use withMixins, which calls the correct applyMixin function. Reflects the behaviour in CfnElement and Resource.

Describe any new or updated permissions being added

No new permissions are added.

Description of how you validated changes

No new permissions are added.

Checklist


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

Previously, if a stack has a mixin applied, the stack's constructs will
not have its mixin metadata applied  as Stack used applyTo directly
instead of applyMixin which adds the metadata. Using withMixins calls
the correct applyMixin function.
@Abogical Abogical requested a review from a team as a code owner March 17, 2026 16:00
@github-actions github-actions bot added p2 star-contributor [Pilot] contributed between 25-49 PRs to the CDK labels Mar 17, 2026
@aws-cdk-automation aws-cdk-automation requested a review from a team March 17, 2026 16:01
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 17, 2026
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)

@Abogical Abogical added the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Mar 17, 2026
@Abogical Abogical had a problem deploying to deployment-integ-test March 17, 2026 17:30 — with GitHub Actions Error
@aws-cdk-automation aws-cdk-automation dismissed their stale review March 17, 2026 17:31

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results48 ran48 passed
TestResult
No test annotations available

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 17, 2026

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
This security report is NOT a review blocker. Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates48 ran48 passed
TestResult
No test annotations available

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 17, 2026
@aws-cdk-automation aws-cdk-automation temporarily deployed to deployment-integ-test March 19, 2026 19:26 — with GitHub Actions Inactive
@Abogical Abogical removed the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Mar 20, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Mar 24, 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 Mar 24, 2026

Merge Queue Status

  • Entered queue2026-03-24 11:57 UTC · Rule: default-squash
  • Checks passed · in-place
  • Merged2026-03-24 12:43 UTC · at 92874912c5402159bdbafa0eef1af71644d84c89

This pull request spent 45 minutes 48 seconds in the queue, including 45 minutes 37 seconds running CI.

Required conditions to merge

@mergify mergify bot merged commit 293ce90 into main Mar 24, 2026
23 of 24 checks passed
@mergify mergify bot deleted the stack-mixin-metadata branch March 24, 2026 12:43
@github-actions
Copy link
Copy Markdown
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 Mar 24, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Mar 24, 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 star-contributor [Pilot] contributed between 25-49 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants