Skip to content

ci(deploy): wait for homelab-deploy status after docker rebuild (Gap F) - #1056

Merged
LucasSantana-Dev merged 1 commit into
mainfrom
fix/ci-deploy-race-condition
May 25, 2026
Merged

LucasSantana-Dev merged 1 commit into
mainfrom
fix/ci-deploy-race-condition

Conversation

@LucasSantana-Dev

Copy link
Copy Markdown
Owner

Summary

On the docker_rebuilt=true path, the 'Validate deployed version' step exits as soon as /api/health/version returns the expected SHA. But deploy.sh keeps running (bot health poll, up to 90s). If the bot health gate then fails, CI is already green while deploy.sh posts failure — signals diverge.

This adds a 'Wait for homelab deploy completion' step after all smoke checks (conditioned on docker_rebuilt=true). It polls the homelab-deploy commit status for up to 3 minutes before the job completes, making both rebuild paths consistent.

Outcomes:

  • success → CI passes
  • failure → CI fails with explicit error
  • No status after 90s (GITHUB_DEPLOY_STATUS_TOKEN not configured) → warn + proceed
  • Timeout (3 min) → warn + proceed (bot health gate is warn-on-timeout by design)

ADR: docs/decisions/2026-05-24-deploy-ci-deploy-completion-wait.md

Part of the CI/deploy audit (Gaps A–F across PRs #1045–this)

Prerequisites: GITHUB_DEPLOY_STATUS_TOKEN must be configured on homelab webhook container (already required by #1046).

On the docker_rebuilt=true path, 'Validate deployed version' exits as
soon as /api/health/version returns the expected SHA. But deploy.sh
continues running (bot health poll, up to 90s). If the bot health gate
then fails, CI is already green while deploy.sh posts failure — signals
diverge.

Add 'Wait for homelab deploy completion' step (docker_rebuilt=true only).
Polls homelab-deploy commit status up to 3 min; fails CI on failure
status; warns and proceeds on token-not-configured or timeout.

The docker_rebuilt=false path already had equivalent logic in 'Validate
deployed version'; this makes both paths consistent.

ADR: docs/decisions/2026-05-24-deploy-ci-deploy-completion-wait.md
@vercel

vercel Bot commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lucky Ready Ready Preview, Comment May 25, 2026 12:21am

Request Review

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@LucasSantana-Dev, we couldn't start this review because you've used your available PR reviews for now.

Your plan includes 1 review of capacity. Refill in 48 minutes and 22 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 83c0058c-65ae-40f5-a612-78425b62fedf

📥 Commits

Reviewing files that changed from the base of the PR and between b0838ac and e903f94.

📒 Files selected for processing (2)
  • .github/workflows/deploy.yml
  • docs/decisions/2026-05-24-deploy-ci-deploy-completion-wait.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-deploy-race-condition

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@sonarqubecloud

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit b82208b into main May 25, 2026
35 of 36 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the fix/ci-deploy-race-condition branch May 25, 2026 00:29
LucasSantana-Dev added a commit that referenced this pull request May 25, 2026
## Summary

- Bumps all package.json files from `2.14.1` → `2.15.0`
- Populates `CHANGELOG.md` with everything since v2.14.1
- Adds ADR `docs/decisions/2026-05-24-ci-runtime-baseline-accepted.md`
(CI runtime baseline: 3–4 min accepted, Jest sharding deferred)

### Changes included in this release

**Added**
- ServerLogs + ServerSettings UI pages (#965)
- AutoMessages executor wiring into execution service (#950)

**Changed**
- 4 UI redesigns: Admin, Config, Login, ServersPage, CustomCommands,
GuildAutomation, Spotify, LastFm (#967–#970)
- 5 refactors: AutoplayContext VO (#983),
GuildAutomationOrchestrator/Repository split (#982), MessagePipeline
chain (#981), ArtistSuggestionService (#980), recommendTracks entrypoint
(#979)

**Fixed** — deploy CI gap sweep (A–F)
- Gap A: hard-fail on OAuth 429 (#1045)
- Gap B: surface async deploy via commit statuses (#1046)
- Gap C: bot healthcheck polls Discord gateway, not Redis TCP (#1047)
- Gap D: post error status on lock contention (#1052)
- Gap E: add bot to required containers, remove dead unhealthy grep
(#1054)
- Gap F: wait for homelab-deploy completion on docker_rebuilt=true path
(#1056)
- lockfile-hash BuildKit cache key (#1016)
- squash-merged release branch archive (#946)

**Internal**
- Phase 4 test cleanup — 93 tests removed (#956–#1035)
- Pre-commit hooks: husky + lint-staged + tsc (#1007)
- madge gate promoted to blocking
- Dependabot routine bumps (#971–#977, #1042)

> **Note:** #1054 (Gap E) may still be in CI — merge this PR after #1054
lands.

This branch was successfully deployed

1 active deployment
Preview — e903f949 Deployed May 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant