Repository navigation
fix(deploy): verify + cache-correct the frontend so deploys actually reach users #1576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
271967e
fix(deploy): gate on lucky-frontend + verify served dashboard spa
LucasSantana-Dev 328faf0
fix(deploy): no-cache index.html + immutable assets so ui isn't stale
LucasSantana-Dev b26188c
fix(music): block spotifyextractor in youtube/soundcloud fallbacks
LucasSantana-Dev 99ebffb
fix(deploy): include frontend and bot in print_targeted_logs
LucasSantana-Dev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # Deploy: gate on lucky-frontend + verify the served dashboard SPA | ||
|
|
||
| - Status: accepted | ||
| - Date: 2026-06-24 | ||
| - Method: /deep-research (deploy root-cause investigation) | ||
|
|
||
| ## Context | ||
|
|
||
| The v2.23.0 release deployed and every signal was green — the "Deploy to Homelab" | ||
| workflow's `Validate deployed version` (backend SHA via `/api/health/version`), | ||
| auth-config + OAuth-redirect smoke checks all passed, and the bot's `/version` | ||
| reported v2.23.0 — yet the deploy was observably "not done" (the dashboard surface). | ||
|
|
||
| Root cause: `scripts/deploy.sh` **pulls and starts** `lucky-frontend` | ||
| (`docker compose pull/up … frontend …`) but **never verifies it**: | ||
|
|
||
| - `require_running_containers()` listed `lucky-backend lucky-nginx lucky-postgres | ||
| lucky-redis lucky-bot` — **`lucky-frontend` was absent**. | ||
| - `run_health_checks()` only probed backend endpoints (`/api/health`, | ||
| `/api/health/auth-config`) — **nothing checked the dashboard**. | ||
|
|
||
| `lucky-frontend` is a long-running nginx (`Dockerfile` target `production-frontend`: | ||
| `CMD ["nginx","-g","daemon off;"]`, `restart: unless-stopped`) that serves the built | ||
| SPA from its image; the main `lucky-nginx` reverse-proxies `/` to it. So a frontend | ||
| that was down, crashed, or pulled a stale image would leave the dashboard broken | ||
| (502 / old assets) while the deploy reported full success — and the deploy verifies | ||
| only the bot + backend, neither of which reflects the frontend. | ||
|
|
||
| This is a **recurrence of "Gap E"** — the same "service in the prod compose but | ||
| missing from `require_running_containers`" defect that | ||
| `decisions/2026-05-24-deploy-lock-contention-signal.md` fixed for `lucky-bot`. | ||
|
|
||
| ## Decision | ||
|
|
||
| In `scripts/deploy.sh`: | ||
|
|
||
| 1. Add `lucky-frontend` to `require_running_containers()` (safe: it's long-running | ||
| with `restart: unless-stopped`, so requiring `State.Running` cannot false-fail a | ||
| healthy deploy). | ||
| 2. Add an HTTP readiness check in `run_health_checks()` that fetches `http://nginx:8080/` | ||
| (the dashboard, via the reverse proxy) and matches the React mount point | ||
| `id="root"` — confirming the SPA actually renders end-to-end (main nginx → | ||
| lucky-frontend → index.html), not just that a container is up. | ||
|
|
||
| Both run before the success signal, so a broken frontend now fails health checks and | ||
| triggers the existing auto-rollback path. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - A down/crashed/unreachable frontend now **fails the deploy** instead of passing. | ||
| - **Not covered:** a frontend that is _running but serving a stale image_ (old build | ||
| still has `id="root"`). Detecting staleness needs a build-version marker in the | ||
| served HTML/assets compared against the expected release — tracked as follow-up. | ||
|
|
||
| ## Prevention rule | ||
|
|
||
| Any new **long-running** service added to the production `docker-compose.yml` MUST be | ||
| added to `require_running_containers()` (and HTTP-health-checked if user-facing). To | ||
| stop this class recurring a 3rd time, prefer **deriving** the required list from | ||
| `docker compose config --services` (minus known one-shots) rather than a hand-maintained | ||
| array. Tracked in the follow-up issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.