Skip to content

api: Prefer the live deployment over superseded redeploys - #5

Merged
yekta merged 1 commit into
masterfrom
fix/stuck-launching-status
Oct 7, 2026
Merged

yekta merged 1 commit into
masterfrom
fix/stuck-launching-status

Conversation

@yekta

@yekta yekta commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

If a redeploy was created while a build was running, it could stay the newest deployment even after the build went live and replaced it. Service cards took their status from that superseded redeploy and stayed on "Launching" even though the service was running.

  • LastDeployment now falls back to the current deployment when the newest deployment succeeded but isn't the one running.
  • LastSuccessfulDeployment is now the current deployment while it's still up. Otherwise it falls back to the newest successful deployment.
  • Builds that are running or have failed still show on top, as before.
  • The selection logic moved out of TransformServiceEntity into the lastDeployment and lastSuccessfulDeployment helpers.

Testing

Added table tests in service_response_test.go for TransformServiceEntity. They cover:

  • a superseded redeploy
  • the current deployment being the newest
  • a running build
  • a failed build
  • a removed current deployment, with and without an older success
  • no current deployment
  • no deployments

A redeploy created while a build was running could end up as the newest deployment even after the build replaced it when it went live. Service cards then took their status from that superseded redeploy and stayed on "Launching".

The last deployment now falls back to the current deployment when the newest one succeeded but isn't the one running. The last successful deployment is now the current deployment when it is still up. Builds that are running or failed still show on top.
@yekta
yekta merged commit 9e2a9c8 into master Oct 7, 2026
8 checks 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.

1 participant