Skip to content

Release 2.14: fix LSIO PUID/PGID permission race - #452

Merged
ptr727 merged 3 commits into
mainfrom
develop
Jun 25, 2026
Merged

ptr727 merged 3 commits into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Jun 25, 2026 •

Copy link
Copy Markdown
Owner

Promote develop to main for the 2.14 release.

Included

Validated via the :develop tag before promotion; the publish run on develop was green across the full matrix.

Closes #449.

🤖 Generated with Claude Code

ptr727 and others added 3 commits June 25, 2026 09:47
Converge this repo onto
[ptr727/ProjectTemplate](https://github.com/ptr727/ProjectTemplate): the
carried artifacts (`CODESTYLE.md`, `AGENTS.md`,
`.github/copilot-instructions.md`, `.vscode`, `.gitattributes`, and the
orchestration-layer workflows) are taken by full-file replacement, and
this repo's task list is folded in. Where this repo's multi-image Docker
product genuinely cannot use the template shape, the deviation is
documented below rather than left as silent drift.

## What this does

- Re-pins every orchestration-layer action to the template's exact SHAs
(`actions/checkout`, `dorny/paths-filter`,
`softprops/action-gh-release`, `RubbaBoy/BYOB`,
`peter-evans/dockerhub-description`); `dotnet/nbgv@master` stays
floating to match the template. Repo-owned build-layer leaves keep their
own `docker/*` pins (see adaptations).
- Converges the `github-release` job in `publish-release.yml` to the
template's generic release semantics: tag on the built commit, auto
source zip + README + LICENSE, pinned `target_commitish`, skip-existing
guard, and the main-only `Verify public release version` backstop.
- Carries `publish-docker-readme-task.yml` and
`build-datebadge-task.yml` verbatim from the template.
- Carries `CODESTYLE.md` whole - General section plus the per-language
.NET and Python sections, with the droppable per-language model intact.
- Sets line endings via `.gitattributes`: Dockerfiles, `*.sh`, the
`Docker/s6-overlay/**` tree, and `.husky/pre-commit` are pinned LF;
carried workflow YAML stays CRLF to match the template's checked-in
form.

Validation: actionlint clean, markdownlint 0 errors.

## Documented adaptations (for review)

These are the only intentional deviations from the template; everything
else is verbatim carry (modulo the line-ending pins above). Sourced from
`AGENTS.md` -> Template adaptations.

- **Base + per-branch Docker build structure.** `publish-release.yml`
keeps a `build-base` job plus separate `build-main` / `build-develop`
legs (calling repo-owned `build-base-images-task.yml` and
`build-docker-task.yml`) instead of the template's single per-branch
matrix, because the shared `nx-base` / `nx-base-lsio` images are built
once from `main` and reused by both legs (`build_base: false`) - a
fan-out the template matrix can't express.
- **Docker-only GitHub release (no `release-asset-*` files).** This repo
ships Docker Hub images as its release artifacts, not binary/package
assets, so there is no `release-asset-*` download step and
`fail_on_unmatched_files` is omitted (no files to guard); all other
release semantics follow the template.
- **Docker Hub readme repositories derived from `Matrix.json`.**
`publish-docker-readme-task.yml` is carried verbatim; because the image
set is repo-specific the caller passes `manifest: ./Make/Matrix.json` +
a `manifest-jq` program (lowercased `ptr727/<image>` plus the shared
base repos) so the task's own `get-repos` job resolves the list.
- **Husky.Net pre-commit hooks.** This repo installs Husky.Net Git hooks
(pre-commit formatting/codegen), inverting the template's no-hooks
default; the hooks run the same checks CI enforces, surfaced earlier.
- **`.vscode` Benchmark -> Husky.Net Run task.** The carried
`.vscode/tasks.json` swaps the template's Benchmark task for a Husky.Net
Run task, matching this repo's hook tooling.
- **Build-layer action pins stay repo-owned.** Orchestration-layer
workflows pin shared actions to the template's SHAs; the repo-owned
build-layer leaves (`build-docker-task.yml`,
`build-base-images-task.yml`, `test-release-task.yml`) own their
`docker/*` and other action versions and track them via Dependabot.

Held for maintainer end-gate review (no auto-merge).

---------

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
## Problem

Fixes #449. On LSIO images, upgrading could leave `/media` chowned to
the build-time UID while the mediaserver ran as the remapped `PUID`,
breaking writes (`QIODevice::write ... device not open`) and triggering
a full chown sweep on every start.

Root cause: the `init-nx-permissions` chown sweep had **no s6-rc
dependency on the base `init-adduser` oneshot** that remaps
`PUID`/`PGID` onto the renamed account. As a dependency-free graph
source, s6-rc could run the recursive chown of `/config` and `/media`
*before* the remap, locking files to the pre-remap UID.

## Changes

- **Fix the race:** add
`init-nx-permissions/dependencies.d/init-adduser` so the chown sweep
(and, transitively, `init-nx-relocate`) runs strictly after the
`PUID`/`PGID` remap. With correct ordering the `stat` guard sees
`/media` already owned by the account and skips the sweep entirely.
- **Extract RUN blocks to shell scripts:** the installer download and
the LSIO `abc`→account rename move from large inline `RUN` blocks into
`Docker/download.sh` and `Docker/lsio-rename-user.sh`, copied and run
with parameters (shellcheck-able, single-quote-clean, pinned LF).
- **Harden the unsupported `abc` rename:** the rename script asserts the
expected `init-adduser` signature before and after patching and fails
the build if upstream changes it, rather than silently regressing
`PUID`/`PGID` handling. (LSIO still does not support renaming `abc`.)
- **Codegen LF output:** `WriteDockerfile` normalizes generated
Dockerfiles to LF + a single trailing newline regardless of OS
(raw-string literals inherit CRLF from the CRLF-encoded C# source, and
CRLF breaks `RUN` line continuations).

## Validation

- Built `NxMeta-LSIO` (amd64) end-to-end: account renamed, `abc`
removed, `init-adduser` repointed, new ordering dependency present,
`/temp` clean.
- Rename script verified against `nx-base-lsio:ubuntu-noble`; **fails
closed** (exit 1, clear message) when the signature is broken or the
file is missing.
- All 12 Dockerfiles LF; 21/21 unit tests pass; CSharpier + `dotnet
format style --verify-no-changes` clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Prep for the 2.14 `develop -> main` release.

- Bump `version.json` NBGV floor 2.13 -> 2.14.
- Add the `Version 2.14` release note to HISTORY.md and the README
Release Notes for the LSIO PUID/PGID permission-ordering fix (#450).

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Copilot AI review requested due to automatic review settings June 25, 2026 21:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Promotes develop to main for the 2.14 release, centering on fixing the LSIO PUID/PGID ordering race and aligning generated Dockerfile output + CI/release workflows to the updated pipeline patterns.

Changes:

  • Bump the NBGV version floor to 2.14 and document the LSIO permissions race fix in README/HISTORY.
  • Refactor generated product Dockerfiles to use shared shell scripts (download.sh, lsio-rename-user.sh) and add an s6-rc dependency to order init-nx-permissions after init-adduser.
  • Update multiple GitHub Actions workflows (SHA pinning, cache strategy changes, concurrency tweaks, publish/readme/badge tasks).

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
version.json Bump NBGV version floor to 2.14.
README.md Update release notes summary for 2.14.
HISTORY.md Add 2.14 release entry describing the LSIO fix.
NxWitness.code-workspace Add CSpell words related to new scripts/behavior.
Docker/download.sh New shared installer download/staging script used by generated Dockerfiles.
Docker/lsio-rename-user.sh New shared script to rename LSIO abc user/group and repoint init-adduser safely.
CreateMatrix/Dockerfile.cs Centralize Dockerfile writing (LF normalization) and update generated Dockerfile content patterns.
Docker/NxBase.Dockerfile Base image cleanup adjustments (e.g., autoremove --yes) and line-ending normalization via codegen.
Docker/NxBase-LSIO.Dockerfile Same as NxBase for LSIO base image.
Docker/NxWitness.Dockerfile Switch to shared download script; normalize generated output.
Docker/NxWitness-LSIO.Dockerfile Switch to shared download + rename scripts; normalize generated output.
Docker/NxMeta.Dockerfile Switch to shared download script; normalize generated output.
Docker/NxMeta-LSIO.Dockerfile Switch to shared download + rename scripts; normalize generated output.
Docker/NxGo.Dockerfile Switch to shared download script; normalize generated output.
Docker/NxGo-LSIO.Dockerfile Switch to shared download + rename scripts; normalize generated output.
Docker/DWSpectrum.Dockerfile Switch to shared download script; normalize generated output.
Docker/DWSpectrum-LSIO.Dockerfile Switch to shared download + rename scripts; normalize generated output.
Docker/WisenetWAVE.Dockerfile Switch to shared download script; normalize generated output.
Docker/WisenetWAVE-LSIO.Dockerfile Switch to shared download + rename scripts; normalize generated output.
Docker/s6-overlay/s6-rc.d/init-nx-permissions/dependencies.d/init-adduser Add s6-rc dependency edge for correct startup ordering.
.gitattributes Pin LF endings for scripts/Dockerfiles/s6 tree to avoid CRLF execution issues.
CODESTYLE.md Update carried style-guide content (notably expanded cross-language sections).
AGENTS.md Update guidance text and document template adaptations.
.github/workflows/test-release-task.yml SHA-pin key actions.
.github/workflows/test-pull-request.yml SHA-pin actions used in PR checks.
.github/workflows/run-periodic-codegen-pull-request.yml Adjust schedule and concurrency grouping to avoid branch races.
.github/workflows/run-codegen-pull-request-task.yml Comment refinements + action version updates.
.github/workflows/get-version-task.yml Add ref input and update checkout/action pins (but needs a ref fallback fix).
.github/workflows/build-docker-task.yml Move caches to registry-based buildcache tags; SHA-pin actions; adjust cache computation.
.github/workflows/build-base-images-task.yml Move caches to registry-based buildcache tags; SHA-pin actions.
.github/workflows/publish-release.yml Add main-release SemVer guard; derive Docker Hub repos from manifest; SHA-pin actions.
.github/workflows/publish-docker-readme-task.yml Generalize readme publishing: static repos or manifest-derived list, optional transform.
.github/workflows/build-datebadge-task.yml Add caller-gating comment; SHA-pin BYOB action.
.github/workflows/merge-bot-pull-request.yml Switch to pull_request_target, tighten concurrency grouping, and shorten documentation blocks.

Comment thread .github/workflows/get-version-task.yml Resolved
Comment thread CODESTYLE.md Resolved
@ptr727
ptr727 merged commit a81e760 into main Jun 25, 2026
11 checks passed
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.

Upgrading nxwitness-LSIO - PUID/PGID errors

2 participants