Skip to content

fix: rollback plan shows new fleet IPs instead of old fleet - #945

Open
CSTRSK wants to merge 1 commit into
profullstack:masterfrom
CSTRSK:fix/rollback-plan-old-ips
Open

fix: rollback plan shows new fleet IPs instead of old fleet#945
CSTRSK wants to merge 1 commit into
profullstack:masterfrom
CSTRSK:fix/rollback-plan-old-ips

Conversation

@CSTRSK

@CSTRSK CSTRSK commented Aug 8, 2026

Copy link
Copy Markdown

Bug

In sh1pt scale rollout --rollback <id>, the rollback plan displayed oldIps by filtering the fleet against target.newInstanceIds:

const oldIps = fleet.instances
  .filter(i => target.newInstanceIds.includes(i.id))   // BUG: filters NEW ids
  .map(i => i.publicIp || i.privateIp || '?.?.?.?');

The plan therefore showed the IPs of the new instances being torn down, while the actual rollback action (lines below) correctly reactivates target.oldInstanceIds for blue-green. The displayed IPs list contradicted what the command did.

Fix

Extract a tested rollbackPlanIps() helper that filters against target.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)
  • Typecheck: only pre-existing errors in build-actions.ts/ship.ts (missing built workspace packages), unchanged by this PR

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.
@CSTRSK

CSTRSK commented Aug 8, 2026

Copy link
Copy Markdown
Author

Submitted to ugig.net bounty (c3137a9d) — bug fix PR for sh1pt.

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.

1 participant