Skip to content

fix(deploy): restore stack selection strategy for deploy and diff#1222

Merged
tejaskash merged 1 commit into
previewfrom
fix/deploy-stack-selection
May 13, 2026
Merged

fix(deploy): restore stack selection strategy for deploy and diff#1222
tejaskash merged 1 commit into
previewfrom
fix/deploy-stack-selection

Conversation

@notgitika

Copy link
Copy Markdown
Contributor

Summary

Fixes e2e http-gateway-targets.test.ts failure by restoring StackSelectionStrategy.PATTERN_MUST_MATCH to toolkitWrapper.deploy() and toolkitWrapper.diff().

Without stack selection, the CDK toolkit fails with:

NoStack: CloudFormationStack object does not hold a stack

Test plan

  • E2E http-gateway-targets.test.ts passes

@notgitika notgitika requested a review from a team May 13, 2026 14:51
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label May 13, 2026
@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 43.52% 10011 / 23001
🔵 Statements 42.78% 10639 / 24864
🔵 Functions 40.37% 1688 / 4181
🔵 Branches 40.23% 6482 / 16112
Generated in workflow #2871 for commit d86170d by the Vitest Coverage Report Action

@agentcore-cli-automation agentcore-cli-automation left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/cli/commands/deploy/actions.ts
@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label May 13, 2026
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.
@notgitika notgitika force-pushed the fix/deploy-stack-selection branch from 23a07c1 to d86170d Compare May 13, 2026 15:37
@tejaskash tejaskash merged commit 99239f4 into preview May 13, 2026
17 checks passed
@tejaskash tejaskash deleted the fix/deploy-stack-selection branch May 13, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants