ci: smoke-test CDK synth to catch cloud-assembly schema mismatches#1467
Open
aidandaly24 wants to merge 1 commit into
Open
ci: smoke-test CDK synth to catch cloud-assembly schema mismatches#1467aidandaly24 wants to merge 1 commit into
aidandaly24 wants to merge 1 commit into
Conversation
#1465 fixed a deploy break that no test caught: aws-cdk-lib@2.258.0 bumped the cloud-assembly schema to 54, but the bundled CDK reader only read up to 53, so freshly-created projects failed at synth with AssemblyVersionMismatch. Unit tests run against the pinned shrinkwrap, so they never exercise the floating aws-cdk-lib range a customer's `npm install` resolves. The existing sanity check stops at `agentcore create` and never synthesizes. The e2e suite does synth but only on push-to-main / a weekly cron — the upstream publish landed between runs. Add a credential-free `cdk synth` smoke test right after `agentcore create` in the always-on PR build job. `create` auto-installs the generated CDK app against the template's floating range (resolving the latest aws-cdk-lib), so this step writes a manifest at the newest schema and reads it back through the bundled aws-cdk binary — going red the moment upstream CDK outruns our reader. Verified: with the pre-#1465 binary (aws-cdk@2.1100.1) against aws-cdk-lib@2.258.0 this step fails with the exact schema mismatch; with the shipped 2.1126.0 it passes. synth performs no AWS calls, so no credentials are required.
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
Package TarballHow to installgh release download pr-1467-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.17.0.tgz |
agentcore-cli-automation
approved these changes
Jun 5, 2026
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
Looks good to merge.
Tightly-scoped CI hardening that closes a real gap exposed by #1465. Verified the mechanics:
agentcore create --name sanitytest --language Python --framework Strands --model-provider Bedrock --memory none --jsonrunsCDKRendererwhich performsnpm installinagentcore/cdk/(noAGENTCORE_SKIP_INSTALLset in CI), so the floatingaws-cdk-lib@^2.248.0resolves to whatever is latest on npm at PR time — exactly what's needed to surface upstream schema bumps.agentcore createalready writes an emptyaws-targets.jsonviawriteAWSDeploymentTargets([]); the workflow'sechooverwrites it with one target so synth has work to do. The path../aws-targets.jsonfromsanitytest/agentcore/cdkmatches whatbin/cdk.tsreads viaConfigIO(configRoot = path.resolve(process.cwd(), '..')). ✓deployed-state.jsonabsence is handled (try/catch inbin/cdk.ts), Bedrock provider path skips credential strategy resolution, so no API key / AWS calls needed. ✓npm run cdk -- synth --quietrunsnpm run build && cdk synth --quiet— gives a free TypeScript compile check on the generated project as a bonus.- Gating on
matrix.node-version == '20.x'is correct: the bundledaws-cdkreader is the same across Node versions, so running this on each would just add ~minutes for no extra signal.
No blocking issues.
Contributor
Coverage Report
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Follow-up to #1465. That PR fixed a customer-facing deploy break —
aws-cdk-lib@2.258.0bumped the cloud-assembly schema to 54, but the bundled CDK reader only read up to 53, so freshly-created projects failed at Synthesize CloudFormation withAssemblyVersionMismatch. No test caught it. This PR adds the guard that would have.Why nothing caught #1465
aws-cdk-lib?build-and-testsanitycreateonlyThe break came from an upstream transitive publish (
aws-cdk-lib@2.258.0, 2026-06-04) sliding into the generated template's floating^2.248.0range — not from a commit. Unit tests run against the pinned shrinkwrap tree, so they test a different dependency graph than a customer's freshnpm installresolves. The one always-on job that touches a generated project stops atcreateand never synthesizes.Change
Add a credential-free
cdk synthsmoke test immediately afteragentcore createin the always-on PR build job (Node 20.x).agentcore createalready auto-installs the generated CDK app against the template's floating range — resolving the latest publishedaws-cdk-lib— so this step writes a manifest at the newest schema and reads it back through the bundledaws-cdkbinary. It goes red the moment upstream CDK's schema outruns the bundled reader.synthperforms no AWS calls. (deploy --dry-runcan't be used here — its STSGetCallerIdentityvalidation runs before synth, so it would fail on missing credentials in CI without ever reaching the schema path.)aws-cdkbinary reader; fix(deploy): bump @aws-cdk/toolkit-lib to read cloud-assembly schema 54 #1465's break was thetoolkit-libreader. Both lag the same upstream schema, so one synth smoke test guards either reader falling behind.Type of Change
Testing
Verified the guard's exact command against a freshly-created project:
Pre-fix binary (
aws-cdk@2.1100.1) +aws-cdk-lib@2.258.0(schema 54) → fails:Cloud assembly schema version mismatch: Maximum schema version supported is 49.x.x, but found 54.0.0— i.e. it would have caught fix(deploy): bump @aws-cdk/toolkit-lib to read cloud-assembly schema 54 #1465.Shipped binary (
aws-cdk@2.1126.0, from fix(deploy): bump @aws-cdk/toolkit-lib to read cloud-assembly schema 54 #1465) +aws-cdk-lib@2.258.0→ passes, manifest written at schema 54.Confirmed
agentcore create --jsonauto-installs the CDK app (no--skip-install), resolving the floatingaws-cdk-lib@2.258.0.Confirmed the synth runs with all AWS credential env unset.
I ran
npm run typecheck(via pre-commit hook)I ran
npm run lint(prettier + secretlint via pre-commit hook)No
src/changes — workflow-only, no snapshots affectedChecklist
run:block uses only static literals — no untrustedgithub.event.*interpolation