fix: rollback plan shows new fleet IPs instead of old fleet - #945
Open
CSTRSK wants to merge 1 commit into
Open
Conversation
In 'sh1pt scale rollout --rollback <id>', the rollback plan computed 'oldIps' by filtering fleet instances against target.newInstanceIds, so the displayed IPs were the NEW instances being torn down rather than the OLD fleet being restored. The actual rollback action correctly reactivates target.oldInstanceIds (blue-green), so the plan output contradicted what the command did. Extract rollbackPlanIps() which filters against oldInstanceIds and add regression tests covering publicIp, privateIp fallback and the missing-IP placeholder.
Author
|
Submitted to ugig.net bounty (c3137a9d) — bug fix PR for sh1pt. |
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.
Bug
In
sh1pt scale rollout --rollback <id>, the rollback plan displayedoldIpsby filtering the fleet againsttarget.newInstanceIds:The plan therefore showed the IPs of the new instances being torn down, while the actual rollback action (lines below) correctly reactivates
target.oldInstanceIdsfor blue-green. The displayed IPs list contradicted what the command did.Fix
Extract a tested
rollbackPlanIps()helper that filters againsttarget.oldInstanceIds, and use it in the rollback plan. Adds regression tests for publicIp, privateIp fallback, and the missing-IP placeholder.Verification
pnpm vitest run packages/cli/src/commands/scale.test.ts→ 53 tests passed (3 new)build-actions.ts/ship.ts(missing built workspace packages), unchanged by this PR