Skip to content

fix(ci): gate deploys on tests, pip install in backend deploy, job timeouts#111

Merged
miquelmatoses merged 1 commit into
mainfrom
fix/deploy-gating
Jul 5, 2026
Merged

fix(ci): gate deploys on tests, pip install in backend deploy, job timeouts#111
miquelmatoses merged 1 commit into
mainfrom
fix/deploy-gating

Conversation

@miquelmatoses

Copy link
Copy Markdown
Collaborator

What

2a. Backend deploy installs Python deps. The SSH deploy script now runs api/.venv/bin/pip install --quiet -r api/requirements.txt after git pull and before systemctl restart, mirroring scripts/deploy-api.sh. Previously the two deploy paths had diverged: a merged requirements.txt change would auto-deploy code importing packages not present in the server venv and crash-loop the service (caught only by the smoke test, after the old process was already down).

2b. Deploys gated on tests. Both deploy workflows get a first test job and the deploy job now has needs: test:

  • deploy-backend.yml: pytest (same invocation as ci.yml) + Caddy snippet validation, since the deploy job installs that exact snippet.
  • deploy-frontend.yml: vitest run.

Why needs: instead of workflow_run on ci.yml: workflow_run fires on the workflow completing, not on the paths of the triggering push, so keeping "frontend deploys must not run on api/-only changes" would require re-implementing path detection inside the deploy workflow. Same-workflow needs: keeps the existing on.push.paths filters untouched and the gate is visible in the same run. Cost: each deploy re-runs its ~30s test suite; acceptable.

2c. Hygiene (in-scope only). timeout-minutes on every job: tests 10, backend deploy 15, frontend deploy 35 (prerender historically takes 16-22 min; previously a hang could burn the 6-hour default).

Deliberately NOT done: npm install -> npm ci. Verified the current lockfile still lacks @rollup/rollup-linux-x64-gnu and @tailwindcss/oxide-linux-x64-gnu (macOS-generated, npm optional-deps bug), so npm ci would fail on Ubuntu runners. Regenerating the lockfile with platform entries is a separate change. No lint steps added, mm-design pin untouched (both out of scope).

Verification

  • YAML parses (no actionlint available locally; careful line-by-line review done).
  • Deploy workflows cannot be fully exercised without deploying; the post-merge run of this very PR (it touches .github/workflows/deploy-backend.yml, a trigger path) will be watched to completion.

🤖 Generated with Claude Code

…ob timeouts

Three deploy-pipeline gaps closed:

1. deploy-backend.yml now runs pip install -r api/requirements.txt in
   the server venv before systemctl restart, mirroring
   scripts/deploy-api.sh. Previously a merged requirements.txt change
   would restart the service against a stale venv and crash-loop it.

2. Both deploy workflows gain a test job (backend: pytest + Caddy
   snippet validation; frontend: vitest) and the deploy job depends on
   it via needs:. Until now deploys raced ci.yml on every push to main
   and a red commit still shipped. Same-workflow needs: was chosen over
   workflow_run because it keeps the existing path filtering intact.

3. timeout-minutes on every job (tests 10, backend deploy 15, frontend
   deploy 35 to cover the historical 16-22 min prerender).

npm install is deliberately NOT switched to npm ci: the lockfile still
lacks @rollup/rollup-linux-x64-gnu and @tailwindcss/oxide-linux-x64-gnu
(macOS-generated, npm optional-deps bug), so npm ci would fail on the
Ubuntu runners. Kept documented in the workflow comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@miquelmatoses miquelmatoses merged commit b6e037a into main Jul 5, 2026
7 checks passed
@miquelmatoses miquelmatoses deleted the fix/deploy-gating branch July 5, 2026 11:08
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