ci: local Linux check-ubuntu reproducer (#813 follow-up)#824
Conversation
Adds ci/docker-linux-verify/ — a one-shot reproducer for the check-ubuntu.yml lane (cargo check + clippy + subprocess lint + cargo test) that runs locally inside Docker on a Windows host. Reuses the existing fbuild-mac-cross image (already ubuntu:24.04 with soldr + zccache + uv pre-installed) so there is no second Dockerfile to keep in sync. Named Docker volumes back the cargo /target and CARGO_HOME so no-op rebuilds are single-digit seconds instead of the 4-6 min that host bind-mounts incur under WSL2's 9P mtime rewriting. Used to verify the #813 async migration is platform-clean before admin-merging on Windows — the Linux lane on the merged commit will go green for the same reason. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds a new ChangesLocal Linux CI verification harness
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ci/docker-linux-verify/verify.py`:
- Around line 65-69: The _wipe_volumes helper is treating every non-zero result
from docker volume rm as a missing volume, which hides real failures like
“volume in use” or Docker errors. Update _wipe_volumes to distinguish the “does
not exist” case from other failures by inspecting the command result from _run,
and only print the skip message when the volume is actually absent. For any
other failure, surface the error and make the wipe path fail so --wipe does not
incorrectly report success; use the existing _wipe_volumes and _run symbols to
keep the fix localized.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4ab48dc6-c27a-4899-b23d-bcc82ef2f41b
📒 Files selected for processing (3)
ci/docker-linux-verify/README.mdci/docker-linux-verify/verify.pyci/docker-linux-verify/verify.sh
| def _wipe_volumes() -> None: | ||
| for vol in (VOLUME_TARGET, VOLUME_CARGO_HOME): | ||
| rc = _run(["docker", "volume", "rm", vol], check=False) | ||
| if rc != 0: | ||
| print(f" (volume {vol} did not exist — skipping)", flush=True) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Don’t collapse every volume-removal failure into “did not exist.”
Line 67 can also fail when the volume is still in use or Docker itself errors. In those cases this branch still prints a benign skip message and, with --wipe alone, exits 0, so users can think they forced a cold rebuild while the old cache is still intact.
Proposed fix
def _wipe_volumes() -> None:
for vol in (VOLUME_TARGET, VOLUME_CARGO_HOME):
- rc = _run(["docker", "volume", "rm", vol], check=False)
- if rc != 0:
- print(f" (volume {vol} did not exist — skipping)", flush=True)
+ result = subprocess.run(
+ ["docker", "volume", "rm", vol],
+ check=False,
+ capture_output=True,
+ text=True,
+ )
+ if result.returncode == 0:
+ continue
+ if "no such volume" in result.stderr.lower():
+ print(f" (volume {vol} did not exist — skipping)", flush=True)
+ continue
+ sys.stderr.write(result.stderr)
+ sys.exit(result.returncode)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| def _wipe_volumes() -> None: | |
| for vol in (VOLUME_TARGET, VOLUME_CARGO_HOME): | |
| rc = _run(["docker", "volume", "rm", vol], check=False) | |
| if rc != 0: | |
| print(f" (volume {vol} did not exist — skipping)", flush=True) | |
| def _wipe_volumes() -> None: | |
| for vol in (VOLUME_TARGET, VOLUME_CARGO_HOME): | |
| result = subprocess.run( | |
| ["docker", "volume", "rm", vol], | |
| check=False, | |
| capture_output=True, | |
| text=True, | |
| ) | |
| if result.returncode == 0: | |
| continue | |
| if "no such volume" in result.stderr.lower(): | |
| print(f" (volume {vol} did not exist — skipping)", flush=True) | |
| continue | |
| sys.stderr.write(result.stderr) | |
| sys.exit(result.returncode) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ci/docker-linux-verify/verify.py` around lines 65 - 69, The _wipe_volumes
helper is treating every non-zero result from docker volume rm as a missing
volume, which hides real failures like “volume in use” or Docker errors. Update
_wipe_volumes to distinguish the “does not exist” case from other failures by
inspecting the command result from _run, and only print the skip message when
the volume is actually absent. For any other failure, surface the error and make
the wipe path fail so --wipe does not incorrectly report success; use the
existing _wipe_volumes and _run symbols to keep the fix localized.
Release the #813 full-async tokio runtime migration. The work landed across PR #823 (the migration itself, admin-merged), #824 (the local Docker Linux verify infra), and #825 (cargo fmt + LOC gate fixes for the migration's wide-ranging edits). This is the first release on the unified async runtime — every per-TU compile, every per-platform deploy, every subprocess invocation now drives through the daemon's single tokio runtime, making tokio-console visibility complete and removing the rayon / std::thread::scope hybrid that the migration replaced. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
ci/docker-linux-verify/— one-shot Docker reproducer for thecheck-ubuntu.ymllane (cargo check + clippy + subprocess lint +cargo test).
fbuild-mac-crossimage as the base(
ubuntu:24.04+ soldr + zccache + uv) so we don't add a secondDockerfile to maintain.
/targetandCARGO_HOMEsono-op rebuilds are seconds instead of the 4-6 min host-bind-mount
cost under WSL2 9P.
Why
While admin-merging #823 (the full-async tokio migration for #813)
from a Windows dev box, I needed a fast local proof that the Linux
lane would be green before pushing. The mac-cross Dockerfile already
shipped everything check-ubuntu needs — this PR formalizes a
one-command 'verify on Linux locally' loop on top of it.
Test plan
uv run --no-project python ci/docker-linux-verify/verify.py→cargo check + clippy passed on Linux against the merged audit: go fully async — whole-app tokio runtime sharing for tokio-console (meta) #813 commit
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation