fix(ci): build and push only after lint and tests pass #138

Open
Sebi wants to merge 1 commits from fix/ci-order into main
pull from: fix/ci-order
Owner

CI order: build now needs: [lint, test] (and image already needs build), so nothing is built or pushed from code that fails lint or tests. Before, the jobs ran side by side and a failing test did not stop the images from main being pushed.

Flaky TestBackgroundRefresh (TempDir RemoveAll cleanup: directory not empty on CI): a refresh started by a visit puts the new snapshot into the cache before writing it to disk, so the test saw the new page, ended, and Go removed the cache directory while the snapshot was being written. Visit-triggered refreshes are now tracked (sync.WaitGroup), Server.Wait waits for them, and the test harness registers it as cleanup, which runs before the TempDir's. Not reproducible locally (300 runs without the fix passed on a fast disk); -race -count=30 passes with it.

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

**CI order**: `build` now `needs: [lint, test]` (and `image` already needs `build`), so nothing is built or pushed from code that fails lint or tests. Before, the jobs ran side by side and a failing test did not stop the images from main being pushed. **Flaky TestBackgroundRefresh** (`TempDir RemoveAll cleanup: directory not empty` on CI): a refresh started by a visit puts the new snapshot into the cache before writing it to disk, so the test saw the new page, ended, and Go removed the cache directory while the snapshot was being written. Visit-triggered refreshes are now tracked (`sync.WaitGroup`), `Server.Wait` waits for them, and the test harness registers it as cleanup, which runs before the TempDir's. Not reproducible locally (300 runs without the fix passed on a fast disk); `-race -count=30` passes with it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added 1 commit 2026-11-23 18:55:51 +00:00
fix(ci): build and push only after lint and tests pass
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (pull_request) Waiting for needed jobs
ci / image (push) Skipped
ci / lint (pull_request) Successful in 12m8s
ci / test (pull_request) Successful in 12m14s
ci / build (pull_request) In progress
4acea46736
The build job, and so the image job after it, now needs lint and test:
a failing test no longer lets CI go on to push images from main.

TestBackgroundRefresh failed on CI now and then with "TempDir RemoveAll
cleanup: directory not empty": a refresh started by a visit updates the
cache before writing the snapshot to disk, so the test could end and
remove the directory mid-write. Visit-triggered refreshes are tracked,
and the test harness waits for them before its directory is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Some checks are pending
ci / lint (push) Skipped
Required
ci / test (push) Skipped
Required
ci / build (push) Skipped
Required
ci / image (pull_request) Waiting for needed jobs
Required
Details
ci / image (push) Skipped
Required
ci / lint (pull_request) Successful in 12m8s
Required
Details
ci / test (pull_request) Successful in 12m14s
Required
Details
ci / build (pull_request) In progress
Required
Details
Some required checks are missing.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/ci-order:fix/ci-order
git checkout fix/ci-order
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#138