Skip to content

Fix docker and CI tooling issues - #167

Open
DaveLiddament wants to merge 1 commit into
masterfrom
chore/ci-tooling
Open

DaveLiddament wants to merge 1 commit into
masterfrom
chore/ci-tooling

Conversation

@DaveLiddament

@DaveLiddament DaveLiddament commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Docker: root-owned artifacts

The containers ran as root, so anything they wrote to the mounted volume (vendor/ files, reports/, .phpunit.cache/, tests/scratchpad/ — 67 accumulated root-owned dirs) was root-owned on the host, breaking subsequent non-docker runs (composer install, phpunit report writes, even a unit test that writes a scratch file).

  • Compose services now run as ${UID:-1000}:${GID:-1000} with HOME=/tmp and a tmp composer cache.
  • XDEBUG_MODE=off by default in the containers — Xdebug was active for every in-container run; the composer test scripts already enable it where coverage is needed. Verified: composer ci in the rebuilt php84 container passes end-to-end as the mapped user.
  • safe.directory moved from --global (root's HOME, invisible to the mapped user) to --system.

⚠️ One-time manual cleanup needed after merging: existing root-owned artifacts can't be deleted by the mapped user — run sudo chown -R $(id -u):$(id -g) reports .phpunit.cache tests/scratchpad vendor once.

Broken scratchpad exclusions

.php-cs-fixer.php used ->exclude('/tests/scratchpad'), but Finder exclude() takes paths relative to each in() dir — it matched nothing, so cs-fixer was scanning 60+ files inside generated test git repos (verified: finder picked up 63 scratchpad files; after the fix the scan drops from 289 to 222 files). Same gap fixed for parallel-lint.

GitHub Actions

  • actions/checkout@v2 → v4 (v2 runs a deprecated Node runtime scheduled for forced failure).
  • ::set-output (removed command syntax) → $GITHUB_OUTPUT.
  • Added permissions: contents: read and a concurrency group that cancels superseded PR runs.
  • restore-keys was identical to the primary key (useless) — now a proper prefix fallback.
  • ubuntu-22.04 → ubuntu-24.04.

Misc

  • The report filenames were swapped: junit XML went to reports/coverage.xml and clover coverage to reports/phpunit.xml. Now reports/junit.xml / reports/clover.xml.
  • Deleted the dead ci/cache/ directory (unreferenced since the pre-Actions CI setup).

- Docker containers now run as the host user (UID/GID mapping) so files
  written to the mounted volume (vendor, reports, test scratchpad,
  caches) are no longer owned by root on the host, which broke
  subsequent non-docker runs. Xdebug is now off by default in the
  containers (the composer test scripts enable it when needed).
- The php-cs-fixer exclusion of tests/scratchpad did not work (exclude()
  takes paths relative to the in() directories), so generated test
  repos were being style checked; parallel-lint had the same gap.
- GitHub Actions: update actions/checkout@v2 (deprecated runtime) to v4,
  replace the removed ::set-output syntax with GITHUB_OUTPUT, add
  minimal permissions, cancel superseded PR runs, fix restore-keys
  (previously identical to the primary key), move to ubuntu-24.04.
- Swap the confusingly named test reports: junit output was written to
  reports/coverage.xml and clover coverage to reports/phpunit.xml. Now
  reports/junit.xml and reports/clover.xml.
- Delete the unused ci/cache directory (left over from a previous CI
  setup).

Co-authored-by: Dave Liddament <dave.liddament@gmail.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1b0cd-7fda-7462-b558-ec2129f1544a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant