Fix Playwright artifact ownership under rootless Docker #6

Code

Clone this repository

Checkout

From your project repository, check out a new branch and test the changes.

git fetch -u origin "fix/playwright-rootless-chown:fix/playwright-rootless-chown"
git switch "fix/playwright-rootless-chown"
Open
indi/soliton-panel
indi wants to merge 1 commit into develop from fix/playwright-rootless-chown
Owner

Problem

scripts/playwright.sh runs the Playwright container as root and then chowns the artifacts back to $(id -u):$(id -g). Under rootless Docker those UIDs live inside the container user namespace: container UID 0 maps to the invoking user, while container UID 1000 maps to host UID 100999. The cleanup therefore left web/e2e/.auth, web/test-results and web/playwright-report owned by an unmapped id, and git worktree remove / rm -rf could not delete them.

Change

Detect rootless Docker with docker info --format '{{json .SecurityOptions}}' and chown to 0:0 there. Rootful Docker keeps the host uid.

Verification

  • bash -n scripts/playwright.sh
  • Rootless detection on the development host resolved to 0:0; a chown with that owner produced artifacts owned by 1000:1000.
  • Rootful path checked with a stubbed docker info, resolving to 1000:1000.
  • Removed a leftover worktree whose web/e2e/.auth and web/test-results were owned by 100999; no 100999 files remain outside Docker storage.

The full Playwright suite was not rerun: this change affects only the post-run ownership cleanup.

Documentation

No documentation change: the script behavior and the documented commands stay the same.

Migrations and rollback

No schema or data changes.

### Problem `scripts/playwright.sh` runs the Playwright container as root and then chowns the artifacts back to `$(id -u):$(id -g)`. Under rootless Docker those UIDs live inside the container user namespace: container UID 0 maps to the invoking user, while container UID 1000 maps to host UID 100999. The cleanup therefore left `web/e2e/.auth`, `web/test-results` and `web/playwright-report` owned by an unmapped id, and `git worktree remove` / `rm -rf` could not delete them. ### Change Detect rootless Docker with `docker info --format '{{json .SecurityOptions}}'` and chown to `0:0` there. Rootful Docker keeps the host uid. ### Verification - `bash -n scripts/playwright.sh` - Rootless detection on the development host resolved to `0:0`; a chown with that owner produced artifacts owned by `1000:1000`. - Rootful path checked with a stubbed `docker info`, resolving to `1000:1000`. - Removed a leftover worktree whose `web/e2e/.auth` and `web/test-results` were owned by `100999`; no `100999` files remain outside Docker storage. The full Playwright suite was not rerun: this change affects only the post-run ownership cleanup. ### Documentation No documentation change: the script behavior and the documented commands stay the same. ### Migrations and rollback No schema or data changes.
Fix Playwright artifact ownership under rootless Docker
Some checks failed
ci / security (pull_request) Successful in 30s
ci / e2e (pull_request) Successful in 1m24s
ci / go (pull_request) Successful in 2m45s
ci / go-static (pull_request) Successful in 3m23s
ci / web (pull_request) Successful in 1m23s
ci / playwright (pull_request) Successful in 5m45s
ci / docker-build (pull_request) Failing after 2s
71e6c4d744
Rootless Docker shifts container UIDs into the subuid range, so chowning to
the host uid from inside the test container left .auth, test-results and
playwright-report owned by an unmapped id such as 100999. That blocked
worktree cleanup. Detect rootless Docker and chown to 0:0 there; rootful
Docker keeps the host uid.

Some checks were not successful

1 failing, 6 successful checks

16

1 failing check
ci / docker-build (pull_request) Failing after 2s
Required
Details
6 successful checks
ci / security (pull_request) Successful in 30s
Required
Details
ci / e2e (pull_request) Successful in 1m24s
Required
Details
ci / go (pull_request) Successful in 2m45s
Required
Details
ci / go-static (pull_request) Successful in 3m23s
Required
Details
ci / web (pull_request) Successful in 1m23s
Required
Details
ci / playwright (pull_request) Successful in 5m45s
Required
Details
Some required checks were not successful.
You are not authorized to merge this pull request.
You can also merge this with the command line.View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'fix/playwright-rootless-chown:fix/playwright-rootless-chown'
git switch 'fix/playwright-rootless-chown'
Sign in to join this conversation.
No reviewers
No assignees
No labels
No project
No milestone
Dependencies

No dependencies set

Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
indi/soliton-panel!6
No description provided.