Run the E2E runner as the invoking user so its artifacts aren't root-owned #62
Reference in New Issue
Block a user
Delete Branch "e2e-artifact-ownership"
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 Playwright runner ran as root with
e2e-tests/artifactsbind-mounted into the checkout, so every run left root-owned files needingsudoto delete.Every documented invocation now passes
--user "$(id -u):$(id -g)"— the idiom README already uses for lockfile edits. Two supporting pieces: the mount point is tracked (.gitkeep), since an absent bind-mount source is daemon-created as root and an unprivileged runner then cannot write it; and the runner image pointsHOME+ npm's cache at/tmp, since an arbitrary uid has no home in the Playwright image.Baking a
USERinto the image was tried first and dropped:pwuseris 1001 in the noble image, so it EACCES'd on a 1000-owned checkout, and no fixed uid matches every host.Guards:
src/compose.test.tscovers every documented command plus the tracked mount point,src/ci-gate.test.tsthe gate's own two runs.