Repository navigation
fix(ci): re-enable unprivileged user namespaces for the browser gates - #2
Merged
Merged
Conversation
Ubuntu 24.04 runners ship an AppArmor policy that blocks unprivileged user namespaces, and Chrome's zygote sandbox requires them. The budget gate's headless Chrome has aborted at launch with 'No usable sandbox!' (zygote_host_impl_linux.cc:128) on every run since the runner image rolled forward, failing @memhtml/docs#test:budget while all other tasks pass. Setting kernel.apparmor_restrict_unprivileged_userns=0 for the job restores the namespace the sandbox needs. The gate itself is healthy: run locally, lhci autorun passes all assertions on all four URLs. The alternative, --no-sandbox in lighthouserc.json, was rejected because that file also drives local runs and would remove the sandbox everywhere to fix one CI image.
laithalsaadoon
added a commit
that referenced
this pull request
Oct 16, 2026
apps/docs no longer depends on @lhci/cli, and `mise run check` no longer runs `test:budget`. The accessibility gate (axe through Playwright) and the layout-stability probe keep the WCAG 2.2 AA and CLS checks; no Lighthouse score gates the build. Removed with it, each proven before removal: - apps/docs/lighthouserc.json and the three built-site cases that read it. The URL-parity case is moot with one config; the base-segment case stays and the browser-suite registration case stays. - test:budget in apps/docs/package.json, the root package.json, turbo.json and mise.toml; `lint` no longer names lighthouserc.json. - The apparmor sysctl step in check.yml and release-please.yml. It existed for lhci's sandboxed Chrome (#2). Playwright 1.64.0 passes --no-sandbox unless chromiumSandbox is true (coreBundle.js:44764), and neither a11y.test.ts nor layout-stability.test.ts sets it, so the remaining gate never needed the namespace. - The tmp and uuid pnpm overrides, and the extract-zip OpenVEX statement with its generated osv-scanner.toml entries. `pnpm why -r` on main shows all three reach the lockfile through @lhci/cli alone (tmp also via inquirer, itself under @lhci/cli), and the refreshed lockfile carries none of them. The ledger keeps its document fields with an empty statements list (version 2, last_updated set); grype 0.120.1, trivy 0.75.0 and osv-scanner 2.7.0 each accept the empty ledger and report the finding again against a probe lockfile. - .gitignore entries for .lighthouseci/ and .lhci-site/. The lockfile loses 370 package entries and gains none; the five keys that show as added are unchanged entries git re-anchored. Why: the lhci tree has cost upkeep since the gate landed. lighthouse's trace_engine resolves two dependencies from `latest`, which moved the lockfile on 2026-09-24 and 2026-10-12, and the 2026-09-30 qs advisories needed an express refresh through @lhci/cli (#230). verdict-bench item 57 (sod-0914:memhtml-lhci-drop-pr): Laith ruled go at 15:12 CT 2026-10-12.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
@memhtml/docs#test:budgetfails on every CI run (the last four pushes tomain, plus PR #1) withUnable to connect to Chrome. The chrome-err.log in the Lighthouse output has the actual cause:The
ubuntu-latestrunner image restricts unprivileged user namespaces through AppArmor, and Chrome's zygote sandbox requires them, so headless Chrome aborts with SIGABRT before Lighthouse can connect.Fix
One step in
check.ymlbeforemise run check:This restores the namespace the sandbox needs, so CI drives the same sandboxed Chrome a laptop does.
Alternative considered
chromeFlags: --no-sandboxinlighthouserc.jsonalso fixes it (verified locally: with the flag,lhci autorunpasses all assertions on all four URLs). Rejected because that file drives local runs too, and it would remove Chrome's sandbox everywhere to work around one CI image's policy.Verification
pnpm run test:budgetpasses locally on the currentdist, all assertions, 4 URLs x 3 runs.checkrun is the real test: the budget gate should go green on the runner for the first time in four pushes.