fix(deploy): add harness teardown to TUI deploy flow#1394
Conversation
The TUI deploy path (useDeployFlow.ts) was missing the imperative harness deployment and teardown logic that exists in the CLI deploy path (actions.ts). This caused "remove all and deploy" to skip harness deletion when run through the TUI. Add post-CDK harness deploy during normal deploys so harness state is persisted to deployed-state.json, and add imperative teardown before stack destroy during teardown deploys. Constraint: Must be gated behind isPreviewEnabled() to match CLI path Rejected: Ungated harness deploy | would expose harness features in GA builds Confidence: high Scope-risk: narrow
Package TarballHow to installgh release download pr-1394-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.15.0.tgz |
|
Claude Security Review: no high-confidence findings. (run) |
Coverage Report
|
|
Consider folding the remove-all teardown verification into the existing |
Move the remove-all → deploy → verify-deleted assertions from the standalone harness-remove-all.test.ts into createHarnessE2ESuite so all harness e2e tests (bedrock, gemini, openai) verify teardown, saving an entire deploy cycle in CI. Rejected: Keep separate test file | wastes ~10min CI time duplicating deploy Confidence: high Scope-risk: narrow
|
Claude Security Review: no high-confidence findings. (run) |
|
Claude Security Review: no high-confidence findings. (run) |
… build - Replace separate build+CDK steps with `npm run bundle` which produces both GA and preview tarballs with CDK embedded - GA e2e: install GA tarball, run strands-bedrock baseline + extras - Preview e2e: install preview tarball, run harness-bedrock baseline + extras - Detect helper file changes to trigger all e2e tests Confidence: high Scope-risk: moderate
c692e75 to
61a5f2c
Compare
|
Claude Security Review: no high-confidence findings. (run) |
| echo "extra_tests=$CHANGED" >> "$GITHUB_OUTPUT" | ||
| echo "Changed e2e tests: ${CHANGED:-none}" | ||
| # If any helper file changed, run all e2e tests | ||
| HELPERS_CHANGED=$(git diff --name-only "$BASE_SHA"..HEAD -- 'e2e-tests/*.ts' \ |
There was a problem hiding this comment.
This changes the e2e tests on pr so that if any helper files change it runs all the tests on the pr. This is important as when people are changing tests we want to see the changes for the tests.
| cfg.modelProvider === 'open_ai' ? 'OpenAI' : cfg.modelProvider === 'gemini' ? 'Gemini' : 'Bedrock'; | ||
|
|
||
| describe.sequential(`e2e: harness/${providerLabel} — create → deploy → invoke`, () => { | ||
| describe.sequential(`e2e: harness/${providerLabel} — create → deploy → invoke → teardown`, () => { |
There was a problem hiding this comment.
Add a check in these tests that remove all and deploy actually deletes the harness
| const existingState = await configIO.readDeployedState().catch(() => undefined); | ||
|
|
||
| // Post-CDK: deploy imperative resources (harness) — preview mode only | ||
| let deployedHarnesses: Record<string, HarnessDeployedState> | undefined; |
There was a problem hiding this comment.
Since this let is outside the feature flag it becomes dead code in the GA release.
I think this specific pattern isn't very dangerous, but I'm worried this pattern may make it harder to cleanup since the codepaths are no longer isolated.
| const teardownConfigIO = new ConfigIO(); | ||
| const existingTeardownState = await teardownConfigIO | ||
| .readDeployedState() | ||
| .catch(() => ({ targets: {} }) as DeployedState); |
There was a problem hiding this comment.
nit: why do we need to cast the type here? is there something we're assuming?
Summary
useDeployFlow.ts) was missing imperative harness deployment and teardown logic, causing "remove all and deploy" to skip harness deletiondeployed-state.json)Root Cause
When the feature flag PR (#1341) consolidated preview/main into a single branch, the TUI deploy hook was not updated to include the imperative harness manager calls. The CLI path (
actions.ts) had them butuseDeployFlow.tsdid not.Test plan
ResourceNotFoundExceptionfromget-harnessAPIharness-remove-all.test.ts) passes withBUILD_PREVIEW=1