ci: make the bread-ecosystem clone in ci/build.sh race-free #18

Closed
Breadway wants to merge 1 commit from fix/ci-clone-race into main
Owner

The runner shares /tmp between concurrent jobs. This script cloned bread-ecosystem into /tmp/bread-ecosystem-ci- with a non-atomic check-then-clone and, in most apps, a glob rm -rf that could delete a checkout another job was building from.

The clone now goes into a private temp dir, is marked .ready and renamed into place under a lock. Other revs are pruned only after a day unused. Tested locally with four concurrent jobs against a fake repo: all built from complete checkouts, a recently used checkout survived, and only a stale one was pruned.

Follow-up to ECO-38.

The runner shares /tmp between concurrent jobs. This script cloned bread-ecosystem into /tmp/bread-ecosystem-ci-<rev> with a non-atomic check-then-clone and, in most apps, a glob rm -rf that could delete a checkout another job was building from. The clone now goes into a private temp dir, is marked .ready and renamed into place under a lock. Other revs are pruned only after a day unused. Tested locally with four concurrent jobs against a fake repo: all built from complete checkouts, a recently used checkout survived, and only a stale one was pruned. Follow-up to ECO-38.
ci: make the bread-ecosystem clone in ci/build.sh race-free
Some checks failed
check / check (push) Failing after 4m20s
4987be672f
The runner's /tmp is shared by concurrent jobs. This script cloned
bread-ecosystem into /tmp/bread-ecosystem-ci-<rev> with a check-then-clone
that was not atomic, and (in most apps) a glob rm -rf of
/tmp/bread-ecosystem-ci-* that could delete a checkout another job was
building from. A job could also start from a half-cloned tree.

The clone now goes into a private temp dir, is marked .ready and renamed
into place under a lock, so a job sees a complete checkout or none, and
two jobs never clone the same rev at once. Nothing deletes a checkout that
may be in use: other revs are pruned only after a day unused, and every run
touches its own. Adds BREAD_CI_TMP and BREAD_ECOSYSTEM_URL overrides so the
logic can be tested without the network. Follow-up to ECO-38.
Author
Owner

Superseded by #19, which carries both changes on a fresh main and passed its check.

Superseded by #19, which carries both changes on a fresh main and passed its check.
Breadway closed this pull request 2026-09-29 20:40:45 +08:00
Some checks failed
check / check (push) Failing after 4m20s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
bug
ci
enhancement
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/breadcrumbs!18
No description provided.