fix(deploy): restore stack selection strategy for deploy and diff#1222
Merged
Conversation
Contributor
Coverage Report
|
agentcore-cli-automation
suggested changes
May 13, 2026
agentcore-cli-automation
left a comment
There was a problem hiding this comment.
The fix correctly restores stack selection on deploy() and diff() and matches the pattern used in teardown.ts. One concern below about scope: the same root cause (the CDK app synthesizes a stack per target) also affects how stackName is selected from stackNames further up, and that selection is now inconsistent with the explicitly-targeted targetStackName used in this PR. Consider tightening this in the same change.
Adds StackSelectionStrategy.PATTERN_MUST_MATCH with targetStackName to toolkitWrapper.deploy() and toolkitWrapper.diff() calls. Without this, the CDK toolkit fails with "NoStack: CloudFormationStack object does not hold a stack" when deploying projects with HTTP gateways. Also fixes multi-target consistency: uses targetStackName (derived from project name + target name) as the canonical stackName throughout the function, and scopes checkStackDeployability to the target stack only. Adds a guard that fails early if the target stack isn't found in the synthesized assembly.
23a07c1 to
d86170d
Compare
tejaskash
approved these changes
May 13, 2026
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.
Summary
Fixes e2e
http-gateway-targets.test.tsfailure by restoringStackSelectionStrategy.PATTERN_MUST_MATCHtotoolkitWrapper.deploy()andtoolkitWrapper.diff().Without stack selection, the CDK toolkit fails with:
Test plan
http-gateway-targets.test.tspasses