fix(ci): gate deploys on tests, pip install in backend deploy, job timeouts#111
Merged
Conversation
…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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
2a. Backend deploy installs Python deps. The SSH deploy script now runs
api/.venv/bin/pip install --quiet -r api/requirements.txtaftergit pulland beforesystemctl restart, mirroringscripts/deploy-api.sh. Previously the two deploy paths had diverged: a mergedrequirements.txtchange 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
testjob and thedeployjob now hasneeds: 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 ofworkflow_runon ci.yml:workflow_runfires 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-workflowneeds:keeps the existingon.push.pathsfilters 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-minuteson 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-gnuand@tailwindcss/oxide-linux-x64-gnu(macOS-generated, npm optional-deps bug), sonpm ciwould 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
.github/workflows/deploy-backend.yml, a trigger path) will be watched to completion.🤖 Generated with Claude Code