Repository navigation
fix(review): install bubblewrap before the Claude review lanes run #758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4d3ad46
378b4e1
ae1350a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -486,6 +486,31 @@ jobs: | |
| core.setOutput("scope", "whole"); | ||
| } | ||
|
|
||
| # Claude Code refuses to start with CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on | ||
| # Linux unless bubblewrap is installed. The action installs it only when | ||
| # allowed_non_write_users is set (claude-code-action@a26b07d action.yml | ||
| # "Install subprocess isolation dependencies"), which these lanes never | ||
| # set, so this repeats that step. Ubuntu 24.04's AppArmor can block the | ||
| # unprivileged user namespaces bubblewrap needs; the action's sysctl lifts | ||
| # it, here only when bwrap cannot start, so a runner that works as it is | ||
| # keeps its kernel setting. A failure here surfaces as the review step's | ||
| # 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. | ||
| - 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same budget-math concern as the identical step in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the pr-review.yml thread, ae1350a. |
||
| run: | | ||
| 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 command -v bwrap >/dev/null && ! bwrap --ro-bind / / true 2>/dev/null && | ||
| [ -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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SUGGESTION: Same concern as the identical step in
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 378b4e1, same change as in pr-review.yml. |
||
| fi | ||
|
|
||
| # The model, effort, inline-comment and plugin-command Skill grants go | ||
| # after the caller's args so replacing claude-args cannot drop them, and | ||
| # so does the schema, which makes the action return the findings count | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -529,6 +529,31 @@ jobs: | |
| echo "note=FULL DIFF: the whole pull request's diff ($files files) is in $DIFF_FILE. Read it to see every change; \`gh pr diff\` and the API can return only part of a large pull request." | ||
| } >> "$GITHUB_OUTPUT" | ||
|
|
||
| # Claude Code refuses to start with CLAUDE_CODE_SUBPROCESS_ENV_SCRUB=1 on | ||
| # Linux unless bubblewrap is installed. The action installs it only when | ||
| # allowed_non_write_users is set (claude-code-action@a26b07d action.yml | ||
| # "Install subprocess isolation dependencies"), which these lanes never | ||
| # set, so this repeats that step. Ubuntu 24.04's AppArmor can block the | ||
| # unprivileged user namespaces bubblewrap needs; the action's sysctl lifts | ||
| # it, here only when bwrap cannot start, so a runner that works as it is | ||
| # keeps its kernel setting. A failure here surfaces as the review step's | ||
| # 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. | ||
|
Comment on lines
+540
to
+542
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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: The underlying fix is still the one suggested two rounds ago: shrink the review step's own |
||
| - 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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 So on a PR where the pre-existing steps hit their historical max and
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| run: | | ||
| 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 command -v bwrap >/dev/null && ! bwrap --ro-bind / / true 2>/dev/null && | ||
| [ -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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SUGGESTION: This 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.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 378b4e1: the sysctl now runs only when |
||
| fi | ||
|
|
||
| # The model, effort, inline-comment and plugin-command Skill grants go | ||
| # after the caller's args so replacing claude-args cannot drop them, and | ||
| # so does the schema, which makes the action return the findings count | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) and82 + 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 owntimeout-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.