Skip to content

fix(dashboard): enable rollback for success-mapped deployment rows - #414

Open
santhiprakash wants to merge 1 commit into
oblien:mainfrom
santhiprakash:fix/deployment-rollback-success-status
Open

fix(dashboard): enable rollback for success-mapped deployment rows#414
santhiprakash wants to merge 1 commit into
oblien:mainfrom
santhiprakash:fix/deployment-rollback-success-status

Conversation

@santhiprakash

Copy link
Copy Markdown
Contributor

Fixes #410

Problem

On the deployments list, finished deploys show status success because mapRowToDeployment normalizes the API's terminal ready value for display/filtering. DeploymentMenu only enabled Rollback and Pin when deployment.status === "ready", so canRollback was always false for normally completed deployments — even when the row showed the Snapshotted chip and had a retained artifact or commit SHA.

Triage / Root cause

  • API persists ready (deployment-lifecycle.ts).
  • List mapping converts ready → success in apps/dashboard/src/app/(dashboard)/deployments/utils.ts.
  • Rollback/pin gating in DeploymentMenu.tsx still checked only for ready.

Fix

  • Add isDeploymentRollbackEligible() beside the status map in utils.ts, accepting ready, success, and partial_failure.
  • Use it for rollback enablement and pin visibility in DeploymentMenu.tsx.

Verification

bun run --cwd apps/dashboard test src/utils/project-status.test.ts

11 tests passed, including new coverage that a ready API row mapped to success is rollback-eligible.

Notes / Risks

  • Dashboard-only change; server-side rollbackDeployment() was already ungated.
  • No behavior change for in-flight or failed rows.

- Problem: mapRowToDeployment normalizes API `ready` to list status `success`, but DeploymentMenu only gated rollback/pin on `ready`, so every finished deploy stayed disabled.
- Fix: centralize rollback eligibility in isDeploymentRollbackEligible and use it for rollback + pin affordances.
- Verification: bun run --cwd apps/dashboard test src/utils/project-status.test.ts (11 passed).
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.

Rollback action permanently disabled on every deployment — status string mismatch ("ready" vs "success")

1 participant