chore: run aws-cdk-lib gen before mixins gen in spec-update workflow#37558
Merged
mergify[bot] merged 1 commit intomainfrom Apr 9, 2026
Merged
chore: run aws-cdk-lib gen before mixins gen in spec-update workflow#37558mergify[bot] merged 1 commit intomainfrom
mergify[bot] merged 1 commit intomainfrom
Conversation
The spec-update workflow runs gen for aws-cdk-lib, mixins-preview, and cfn-property-mixins in parallel via a single lerna command. This causes a race condition: cfn-property-mixins and mixins-preview read scope-map.json to determine which services to generate for, but aws-cdk-lib gen is the step that writes new service entries to scope-map.json. When cfn-property-mixins finishes before aws-cdk-lib, it misses the new services, and the PR build fails with uncommitted changes in cfn-property-mixins/package.json. Split into two sequential steps so aws-cdk-lib gen runs first and updates scope-map.json before the mixins packages read it.
aws-cdk-automation
previously requested changes
Apr 9, 2026
mrgrain
approved these changes
Apr 9, 2026
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Contributor
|
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). |
Contributor
Merge Queue Status
This pull request spent 12 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
Contributor
|
Comments on closed issues and PRs are hard for our team to see. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Fixes the recurring build failure on L1 spec update PRs (e.g. #37530) where
git diff-indexdetects uncommitted changes inpackages/@aws-cdk/cfn-property-mixins/package.json.Supersedes #37556 which added
cfn-property-mixinsto the gen step but didn't fix the ordering issue.Root Cause: Race Condition in Parallel Gen
The spec-update workflow runs
lerna run genfor all three packages (aws-cdk-lib,@aws-cdk/mixins-preview,@aws-cdk/cfn-property-mixins) in a single command. Lerna executes them in parallel. This creates a race condition:aws-cdk-libgen writes new service entries (e.g.aws-novaact,aws-securityagent) toscope-map.jsonviawriteModuleMap()cfn-property-mixinsgen readsscope-map.jsonvialoadModuleMap()to determine which services to generate exports for — see the filter at line 23:if (moduleMap[service.name])mixins-previewgen has the same dependency onscope-map.jsonEvidence from workflow run #354
The gen step logs show
cfn-property-mixinsfinished beforeaws-cdk-lib:cfn-property-mixinsgenerated for 278 services because it readscope-map.jsonbeforeaws-cdk-libadded the 4 new service entries. During the CI build,cdk-buildruns gen again with the updatedscope-map.json, producing 2 new export entries inpackage.jsonthat weren't in the commit →git diff-indexfails.Description of changes
Split the single
lerna run gencommand into two sequential steps:aws-cdk-libonly, which updatesscope-map.jsonmixins-previewandcfn-property-mixins, which now read the updatedscope-map.jsonDescription of how you validated changes
cfn-property-mixins/package.json | 2 ++after the workflow re-runChecklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license