Skip to content

bug(ci): Deploy to Dev goes green when the backend fails its post-deploy health check #2995

Closed

Description

@AndriiPasternak31

Summary

Deploy to Dev reports success even when the backend fails its health check after restart.

Cause

.github/workflows/deploy-dev.yml (~L389 on dev):

curl -sf http://localhost:8000/health && echo "Backend: OK"

Under set -e, a failing command on the left of && does not abort the script. When /health returns 503 (for example a failed migration, which is exactly the case a deploy most needs to catch), the step continues and the job goes green. The scheduler check just below it is also warning-only.

Evidence

Found while reviewing #2986, which copies the same line. There, a stubbed failing curl produced a green run under both bash and POSIX sh. The shell rule was confirmed with a one-liner: set -e; false && echo x; echo still-running prints still-running.

Fix

Fail explicitly, ideally with a short retry window since the backend may still be booting:

for i in $(seq 1 12); do curl -sf http://localhost:8000/health && break; sleep 5; done
curl -sf http://localhost:8000/health || { echo "::error::backend unhealthy after deploy"; exit 1; }

Acceptance

A deploy whose backend /health stays non-2xx fails the job (and therefore the existing deploy-failure issue path).

Activity

  1. added
    priority-p1
    type-bug
    theme-reliability
    complexity-low
    on Sep 23, 2026
  2. added
    status-ready
    on Sep 27, 2026
  3. added
    status-in-progress
    and removed
    status-ready
    on Sep 28, 2026
  4. AndriiPasternak31 commented on Sep 28, 2026

    @AndriiPasternak31
    ContributorAuthor

    /claim. Plan reviewed; building now. The fix is a bounded retry on the post-deploy health probe, then an explicit failure.

  5. github-actions commented on Sep 28, 2026

    @github-actions

    @AndriiPasternak31 This issue is already assigned to AndriiPasternak31. Use /unclaim first if you want to take over.

  6. added
    status-in-dev
    and removed
    status-in-progress
    on Sep 29, 2026
  7. added a commit that references this issue on Sep 30, 2026
  8. removed
    status-in-dev
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

complexity-lowpriority-p1theme-reliabilitytype-bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions