fix(console): block Add-instance on a k8s fleet instead of silently deploying to ECS - #152
Merged
Merged
Conversation
…eploying to ECS studio#146 final-review pass (mirrors studio#83 slice 7): re-reading the merged console/ fresh off main after all 4 slices landed surfaced a newly-reachable bug. Before this issue, a k8s fleet couldn't be selected at all, so its Fleet detail "+ Add instance" button was unreachable. Now that slice 4 lets you drill into one, clicking it opens `deploy.ts`'s compose step — which assumes ECS whenever mode isn't "new-fleet" (the provider <select> only lives in the identity step, skipped for "add instance"; deploy.ts's own comment already flagged this as a known, separate gap). The result wasn't an error: it would silently provision an ECS service into what the operator thinks is a k8s fleet. Guards the button in main.ts instead: if the active fleet's runtime is k8s, show the same "not supported yet" toast pattern the wizard already uses for its own not-yet-supported k8s cases, rather than let the wizard open and do the wrong thing. 🤖 Generated with Claude Code
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
studio#146 final-review pass — the slice-7-style re-read of the merged
console/offmainafter all 4 slices landed (#147-#151), looking for exactly this class of "newly reachable, not caught by any single slice's tests" issue.Before this issue, a k8s fleet couldn't be selected in the Fleets panel at all, so its Fleet detail's "+ Add instance" button was simply unreachable. Slice 4 (#151) fixed the actual bug (drilling into a k8s fleet's roster) — but that also made this button reachable for the first time, and it has a pre-existing, already-self-documented assumption:
deploy.ts's compose step only shows the AWS/k8s provider<select>during the "new-fleet" identity step; "add instance" skips straight to compose and the code comment already says "an add-instance submit always sees 'aws' here regardless of the fleet it's adding to".The practical effect, now that it's reachable: clicking "+ Add instance" on an existing k8s fleet doesn't error — it silently provisions an ECS service while the operator believes they're adding to their k8s fleet.
Fix
Guard it at the click handler in
main.ts: if the active fleet'sruntime === "k8s", show an info toast ("adding an instance to an existing k8s fleet isn't supported yet") and don't open the wizard — the same clear-message pattern the wizard already uses for the New-Fleet k8s-provider case that came before it was wired up. No change todeploy.tsitself; this is a pre-condition check at the one place that decides whether to open it.Test plan
npm test— 107/107 passingnpm run typecheck— cleannpm run build— clean🤖 Generated with Claude Code