Repository navigation
fix(review): install bubblewrap before the Claude review lanes run - #758
kyle-sexton wants to merge 3 commits into
Conversation
#756 set CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on both review steps. Claude Code v2.1.300 refuses to start on Linux with the scrub on unless bubblewrap is installed, and claude-code-action installs it only when allowed_non_write_users is set, which these lanes never set. Every v0.44.0 lane run failed to install Claude Code three times. Install bubblewrap (and lift Ubuntu 24.04's AppArmor userns restriction) before the lanes, mirroring the action's own isolation step, so the scrub stays on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3zhSKMdk2UotJNUF3cJ4n
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 4m 6s —— View job Security review complete
Reviewed the two added "Install subprocess isolation dependencies" steps (identical in both files) against the CI security-review criteria: logic/trust-boundary reasoning, not generic Actions hardening (zizmor's lane). No CRITICAL or IMPORTANT findings. The new step only runs after the job-level fork check ( One SUGGESTION (posted inline on both files, pr-review.yml#L550, pr-review-security.yml#L507): both steps run The fix itself (installing bubblewrap, matching the upstream action's own approach) is a reasonable and narrowly-scoped resolution to the stated regression. |
|
Claude finished @kyle-sexton's task in 3m 41s —— View job Claude's review
No blocking or important findings. Reviewed Checked for correctness issues and found none that clear this lane's high-signal bar:
Verification: I could not independently run |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d3ad460f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - name: Install subprocess isolation dependencies | ||
| if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' | ||
| continue-on-error: true | ||
| timeout-minutes: 5 |
There was a problem hiding this comment.
Expand the job timeout to cover dependency installation
When apt-get is slow enough to consume the existing two-minute non-review allowance, this new step can run for up to five minutes while the outer jobs remain capped at 13 minutes here and 16 minutes in pr-review-security.yml; their review steps alone may run for 11 and 14 minutes, respectively. GitHub can therefore cancel the job before the outcome and reporting steps execute, so the failure is not classified as the comment promises and the lane produces no usable verdict. Reserve this installation time in both outer job budgets or subtract it from the review-step budgets.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 378b4e1: the step is capped at one minute in both lanes (the 16-minute job ceiling rules out raising the security job). A job that still runs out fails closed, as the job comment already states.
| sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap | ||
| fi | ||
| if [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then | ||
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 |
There was a problem hiding this comment.
SUGGESTION: This sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 mirrors claude-code-action's own step, but that upstream step only fires when allowed_non_write_users is set (a narrow opt-in); here it runs unconditionally on every Linux run of this lane. sysctl -w changes live kernel state with no restore step. runner (pr-review.yml:93-96) is caller-controlled ("the caller's governed managed runner label" — README.md:840-841) and this repo documents (README.md:1095-1101) a past incident where a caller-selected runner landed on a self-hosted image unexpectedly. If this lane ever runs on a persistent/shared self-hosted runner rather than a single-use GitHub-hosted VM, this disables an AppArmor privilege-escalation mitigation for every subsequent job on that machine until it reboots — not just this job's sandbox.
This is conditional on a deployment fact not confirmed in-repo (whether these two lanes are ever actually routed to a shared self-hosted runner), so it's a SUGGESTION rather than a blocking issue: worth either gating this step to confirmed-ephemeral runners, or adding a restore step, so the fix doesn't silently become a fleet-wide hardening regression if the runner selector ever points here at a shared machine.
There was a problem hiding this comment.
Fixed in 378b4e1: the sysctl now runs only when bwrap --ro-bind / / true fails, so a runner where bubblewrap already works keeps its kernel setting.
| sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap | ||
| fi | ||
| if [ -f /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then | ||
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 |
There was a problem hiding this comment.
SUGGESTION: Same concern as the identical step in pr-review.yml (see that file's inline comment): this sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 runs unconditionally here, unlike upstream's narrower allowed_non_write_users-gated equivalent, and has no restore step. Since runner is caller-controlled and this repo documents routing surprises onto self-hosted images (README.md:1095-1101), consider scoping this to confirmed-ephemeral runners or restoring the sysctl afterward so a future self-hosted routing of this lane doesn't leave the host's unprivileged-user-namespace restriction permanently weakened for unrelated jobs.
There was a problem hiding this comment.
Fixed in 378b4e1, same change as in pr-review.yml.
|
claude-review has reviewed this pull request through ae1350a; a later push is reviewed from there. |
|
claude-security-review has reviewed this pull request through ae1350a; a later push is reviewed from there. |
Cap the install step at one minute so it stays inside the job's allowance outside the review step, and change the AppArmor sysctl only when bwrap cannot start, so a runner that already works keeps its kernel setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3zhSKMdk2UotJNUF3cJ4n
|
Claude finished @kyle-sexton's task in 6m 9s —— View job Claude's review (incremental: 4d3ad46 → 378b4e1)
This commit responds to both concerns raised on 4d3ad46 (Codex's timeout-budget finding and the sysctl-scoping suggestion): the sysctl write is now gated on a live One finding carries over, only partially fixed — posted inline on pr-review.yml:545 and pr-review-security.yml:502: both job headers document the time budget outside the review step as 120s, with pre-existing steps already using up to 82s of that (max observed), leaving a documented 38s margin. The new step's own One new SUGGESTION (non-blocking), posted inline on pr-review.yml:547-551 (same in Verification: read the full current |
|
Claude finished @kyle-sexton's task in 1m 12s —— View job Security review complete
No CRITICAL, IMPORTANT, or SUGGESTION findings in this incremental review. Scope: only the diff between This commit changes two things, both narrowing rather than widening the step's effect:
No instruction-surface deletions: the diff only reworders the explanatory comment above the step (still describing the same install/sysctl behavior accurately); no CLAUDE.md/AGENTS.md/rules/guardrail text is touched, and no standing instruction is removed, narrowed, or softened. No injection surface, no secrets/token handling, and no authorization-boundary change in this incremental diff — the added logic is a local, input-free shell test ( |
| - name: Install subprocess isolation dependencies | ||
| if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' | ||
| continue-on-error: true | ||
| timeout-minutes: 1 |
There was a problem hiding this comment.
Budget math: the 1-minute cap doesn't fit the documented slack, so this doesn't fully resolve the prior timing concern.
The job header (pr-review.yml:202-209) documents the budget this step must share: job timeout 13 min (780s), review step reserved 660s, leaving 120s for everything outside the review step, of which measured pre-existing overhead (checkout/scope/record) already used up to 82s max, leaving only 38s of headroom. This step's own timeout-minutes: 1 reserves up to 60s — already larger than the 38s of slack the file's own comment says is available, before even counting compose-args or the outcome/reporting steps that also run outside the review step's 660s.
So on a PR where the pre-existing steps hit their historical max and apt-get update/install genuinely takes close to the full minute (plausible with Acquire::Retries=3 retrying through a flaky mirror), total non-review time can still exceed the 120s the job has to spare while the review step is mid-flight, and GitHub kills the whole job before the outcome/reporting steps run — the same failure mode raised against the original 5-minute version, just less likely, not eliminated. The comment at lines 540-541 ("One minute keeps the step inside the job's allowance outside the review step") isn't actually derived from the numbers two screens up; either the job header's margin needs recomputing against this new step's worst case, or the review step's own timeout-minutes: 11 (pr-review.yml:606) needs to shrink to make room. Same arithmetic applies to the identical step in pr-review-security.yml (960s job, 840s review step, 120s/38s margin).
There was a problem hiding this comment.
Addressed in ae1350a by correcting the comment rather than the budget. The job overruns only if the review step also runs to its own 11/14-minute timeout, and that run fails anyway; shrinking the review step for every run to cover that case costs more than it saves, and the security job is already at the 16-minute ceiling.
| - name: Install subprocess isolation dependencies | ||
| if: steps.scope.outputs.review != 'false' && runner.os == 'Linux' | ||
| continue-on-error: true | ||
| timeout-minutes: 1 |
There was a problem hiding this comment.
Same budget-math concern as the identical step in pr-review.yml (see that file's inline comment): this job's header (pr-review-security.yml:195-199) documents only 120s of slack outside the 840s review step, with pre-existing steps already using up to 82s of it (38s margin). This step's own timeout-minutes: 1 can consume 60s on top of that, exceeding the documented margin before compose-args or the outcome/reporting steps are counted — so a slow apt-get here can still risk the job's 16-minute (960s) ceiling firing before the job reports a result, the same class of issue raised against the original 5-minute version.
| if ! command -v bwrap >/dev/null; then | ||
| sudo apt-get -o Acquire::Retries=3 update -qq | ||
| sudo apt-get -o Acquire::Retries=3 install -y --no-install-recommends bubblewrap | ||
| fi | ||
| if ! bwrap --ro-bind / / true 2>/dev/null && |
There was a problem hiding this comment.
SUGGESTION: The second if only re-tests whether bwrap runs (bwrap --ro-bind / / true), not whether it's present. If the apt-get install above fails silently (package unavailable, mirror down even after Acquire::Retries=3, or the 1-minute timeout cuts it off), bwrap is still missing; invoking a nonexistent command also returns non-zero, so ! bwrap ... is still true, and — since /proc/sys/kernel/apparmor_restrict_unprivileged_userns exists on Ubuntu 24.04 — the step still runs sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0, weakening the host's AppArmor userns restriction for zero benefit (bwrap still can't run either way). Gating this on command -v bwrap >/dev/null && as well would scope the irreversible sysctl write strictly to "bwrap is present but blocked", matching the step's own comment ("here only when bwrap cannot start" — intended to mean "installed but blocked", not "never got installed").
There was a problem hiding this comment.
Fixed in ae1350a: the sysctl now also requires command -v bwrap.
…ut trade-off Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R3zhSKMdk2UotJNUF3cJ4n
|
Claude finished @kyle-sexton's task in 1m 56s —— View job Claude's review (incremental: 378b4e1 → ae1350a)
This commit changes two things in both
No other changes in this diff; no new security-relevant or structural issues found. |
|
Claude finished @kyle-sexton's task in 1m 19s —— View job Security review complete (incremental: 378b4e1 → ae1350a)
No CRITICAL, IMPORTANT, or SUGGESTION findings in this incremental diff. Scope: only the diff between This commit changes two things in the "Install subprocess isolation dependencies" step, identical in both files:
No instruction-surface deletions: no No injection surface, no secrets/token handling, and no new authorization-boundary change in this incremental diff — |
| # install error, which the outcome step classifies. The one-minute cap | ||
| # can push the job past its timeout only when the review step also runs | ||
| # to its own timeout, a run that fails either way. |
There was a problem hiding this comment.
The new comment's claim doesn't follow from the job's own documented numbers — the budget-math concern still isn't closed.
"The one-minute cap can push the job past its timeout only when the review step also runs to its own timeout" isn't right. The job header (pr-review.yml:201-209) documents: job timeout 780s, review step reserved 660s, pre-existing overhead (checkout/scope/record) measured up to 82s max — i.e. 82 + 660 = 742s was already within 780s, with 38s to spare, before this step existed.
Add this step's worst case (60s) and the arithmetic no longer needs the review step to hit its own 660s cap: 82 (overhead) + 60 (install) + 638 (review, 22s under its own timeout) = 780s, exactly at the job ceiling, with compose-args and the outcome/reporting steps still to run. A review that finishes cleanly at, say, 650s — 10s under its own timeout-minutes: 11 — combined with worst-case overhead and install time already totals 792s, over the 780s job cap. GitHub kills the whole job, including the outcome/reporting steps, before they classify anything — the exact failure mode originally flagged by Codex, independent of whether the review step itself ever reaches its own timeout.
The underlying fix is still the one suggested two rounds ago: shrink the review step's own timeout-minutes (or raise the job's) to leave real room for the steps that now run outside it, and update the job-header comment's 120s/38s accounting to include this step. Rewording the comment to assert the risk is bounded, without changing either number, doesn't close it.
|
Superseded by #760, which fixes the same bubblewrap install in pr-review.yml and pr-review-security.yml and already addressed the review threads (Linux-only, step timeout, github-hosted-only sysctl). |
| # install error, which the outcome step classifies. The one-minute cap | ||
| # can push the job past its timeout only when the review step also runs | ||
| # to its own timeout, a run that fails either way. |
There was a problem hiding this comment.
Same issue as the identical comment in pr-review.yml (see that file's inline comment): the job header here documents job timeout 960s, review step reserved 840s, pre-existing overhead up to 82s — 82 + 840 = 922s, 38s of slack, before this step. Add this step's worst case (60s) and 82 + 60 + 818 (22s under the review step's own 840s cap) = 960s, right at the ceiling with compose-args and outcome/reporting still to run — so the job can still be killed before classification without the review step ever reaching its own timeout-minutes: 14. The new wording asserts the risk is bounded on "only when the review step also runs to its own timeout," but neither number actually changed to make that true.
No related issue: urgent regression in v0.44.0; both Claude review lanes fail in every caller.
Summary
v0.44.0 (#756) set
CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: "1"on the review steps. Claude Code v2.1.300 then refuses to install on Linux without bubblewrap:claude-code-action@a26b07d runs its "Install subprocess isolation dependencies" step only when
allowed_non_write_usersis set (action.yml:225-247), which these lanes never set, so the step is skipped. Failing runs: melodic-software/claude-code-plugins runs 39059051881 (pr-review) and 39059051761 (pr-review-security), PR #7781. Runs on v0.42.2 (no scrub) passed.Fix
Add an "Install subprocess isolation dependencies" step before the arguments step in
pr-review.ymlandpr-review-security.yml: installbubblewrapifbwrapis absent and lift Ubuntu 24.04'sapparmor_restrict_unprivileged_userns, mirroring the action's own step. The scrub stays on.continue-on-errorkeeps a failure here classified by the outcome step, as for the review step itself.Verification
node --test .github/scripts/*.test.cjs: 420 pass, 0 fail.actionlinton both workflows: clean.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01R3zhSKMdk2UotJNUF3cJ4n