CI: isolate container environment (thin wrapper + environment-independent test runner) - #34
CI: isolate container environment (thin wrapper + environment-independent test runner)#34hguillen wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughChangesContainerized CI tests
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CI
participant run_tests.sh
participant run_docker.sh
participant run_tests_in_container.sh
participant pytest
CI->>run_tests.sh: provide test paths and environment overrides
run_tests.sh->>run_docker.sh: start container with forwarded environment
run_docker.sh->>run_tests_in_container.sh: execute container test runner
run_tests_in_container.sh->>pytest: exec pytest with paths and marker
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
da96cb3 to
f8894e3
Compare
bb2525a to
3b60fbe
Compare
f8894e3 to
8f009f7
Compare
3b60fbe to
8ab287d
Compare
3d9dfc0 to
8b60cba
Compare
- run_docker.sh gains an isolated mode (ISAAC_AUTODATA_ISOLATED=1) that skips the dev-only host bind-mounts (shared $HOME/.cache and X11), so the container no longer inherits the runner's home-directory ownership - scripts/ci/run_tests_in_container.sh holds the environment-independent test logic (test paths, marker, caches) and runs inside the container - scripts/ci/run_tests.sh becomes a thin wrapper that runs isolated by default and delegates to run_tests_in_container.sh
8b60cba to
9b91b59
Compare
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 `@docker/run_docker.sh`:
- Around line 133-139: Update the ISAAC_AUTODATA_ISOLATED parsing case around
ISOLATED so recognized false values such as 0 and false explicitly remain
non-isolated, recognized true values still enable isolation, and any other
non-empty value exits with an error instead of defaulting to ISOLATED=false.
🪄 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: ASSERTIVE
Plan: Enterprise
Run ID: 16c56607-87d5-472b-8d76-2c00e20811f5
📒 Files selected for processing (3)
docker/run_docker.shscripts/ci/run_tests.shscripts/ci/run_tests_in_container.sh
| # Isolated mode (ISAAC_AUTODATA_ISOLATED=1, e.g. CI): skip the dev-only host | ||
| # mounts ($HOME/.cache, X11) whose ownership collides with the container user. | ||
| ISOLATED=false | ||
| case "${ISAAC_AUTODATA_ISOLATED:-}" in | ||
| 1 | true | TRUE | yes) ISOLATED=true ;; | ||
| esac | ||
|
|
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Fail closed on invalid ISAAC_AUTODATA_ISOLATED values.
Unrecognized values currently leave ISOLATED=false, so a typo such as ture silently re-enables $HOME/.cache and X11 mounts. Reject invalid values while preserving explicit 0/false local-dev behavior.
Proposed validation
ISOLATED=false
-case "${ISAAC_AUTODATA_ISOLATED:-}" in
- 1 | true | TRUE | yes) ISOLATED=true ;;
+value="${ISAAC_AUTODATA_ISOLATED:-}"
+case "${value,,}" in
+ 1 | true | yes) ISOLATED=true ;;
+ "" | 0 | false | no) ;;
+ *) echo "Invalid ISAAC_AUTODATA_ISOLATED: ${value}" >&2; exit 2 ;;
esac📝 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.
| # Isolated mode (ISAAC_AUTODATA_ISOLATED=1, e.g. CI): skip the dev-only host | |
| # mounts ($HOME/.cache, X11) whose ownership collides with the container user. | |
| ISOLATED=false | |
| case "${ISAAC_AUTODATA_ISOLATED:-}" in | |
| 1 | true | TRUE | yes) ISOLATED=true ;; | |
| esac | |
| # Isolated mode (ISAAC_AUTODATA_ISOLATED=1, e.g. CI): skip the dev-only host | |
| # mounts ($HOME/.cache, X11) whose ownership collides with the container user. | |
| ISOLATED=false | |
| value="${ISAAC_AUTODATA_ISOLATED:-}" | |
| case "${value,,}" in | |
| 1 | true | yes) ISOLATED=true ;; | |
| "" | 0 | false | no) ;; | |
| *) echo "Invalid ISAAC_AUTODATA_ISOLATED: ${value}" >&2; exit 2 ;; | |
| esac |
🤖 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 `@docker/run_docker.sh` around lines 133 - 139, Update the
ISAAC_AUTODATA_ISOLATED parsing case around ISOLATED so recognized false values
such as 0 and false explicitly remain non-isolated, recognized true values still
enable isolation, and any other non-empty value exits with an error instead of
defaulting to ISOLATED=false.
Summary
Stacked on top of #25 (
hguillen/ci-setup), a sibling to #33. Refactors the CI test path into three clean layers so the container run no longer depends on the runner's home directory, and the test logic lives in one environment-independent place.docker/run_docker.sh— isolated mode. SetISAAC_AUTODATA_ISOLATED=1to skip the dev-only host bind-mounts (shared$HOME/.cacheand X11). Those couple the container to the runner's home directory, whose ownership collides with the recreated container user and broke warp's~/.cache/warp. Local dev is unchanged (mounts on by default).scripts/ci/run_tests.sh— new, environment-independent test logic. Runs inside the container (or any env with the deps). Takes test paths positionally, readsPYTEST_MARK/ISAAC_AUTODATA_SUBPROCESS_TIMEOUTfrom the environment, and pins caches to a writable run-local dir. Single home for the pytest invocation.scripts/ci/run_e2e_tests.sh— now a thin wrapper. Owns only environment setup: picks the image (-c,-ronFORCE_REBUILD), runs isolated by default, and delegates torun_tests.sh..github/workflows/ci.ymlandnightly.ymlcall it exactly as before, so no workflow changes are needed.This supersedes the minimal cache-redirect fix on #25 (the redirect now lives inside
run_tests.sh) and additionally removes the host mount that caused the collision in the first place.Test plan
test_e2eruns thee2e/+interfaces/suites green with no~/.cache/warpPermissionError.test_full(FORCE_REBUILD=true, no marker) runs the whole tree../scripts/ci/run_e2e_tests.shreproduces the run;ISAAC_AUTODATA_ISOLATED=0restores the shared-cache/X11 dev behavior.Summary by CodeRabbit
New Features
ISAAC_AUTODATA_ISOLATED) that skips host cache and X11 coupling when enabled.CI Improvements
FORCE_REBUILDbehavior.