ci: make the bread-ecosystem clone in ci/build.sh race-free #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/ci-clone-race"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
Superseded by #19, which carries both changes on a fresh main and passed its check.
Pull request closed