refactor(build_environment): use self.run() in _createenv() - #1277
refactor(build_environment): use self.run() in _createenv()#1277smoparth wants to merge 1 commit into
self.run() in _createenv()#1277Conversation
|
Warning Review limit reached
Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
Estimated code review effort: 1 (Trivial) | ~3 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
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 |
c1a2f23 to
8dd72e0
Compare
`_createenv()` called `external_commands.run()` directly while every other method uses `self.run()`, duplicating ctx-access logic for `network_isolation`. The `--python` CLI flag passed to `uv venv` takes precedence over `UV_PYTHON` set by `get_venv_environ()`, so the swap is safe. Closes: #1276 Co-Authored-By: Claude <claude@anthropic.com> Signed-off-by: Shanmukh Pawan <smoparth@redhat.com>
8dd72e0 to
b9ade11
Compare
tiran
left a comment
There was a problem hiding this comment.
The _createenv function does not use BuildEnvironment.run for a reason. The BuildEnvironment.run assumes that the virtual env exists.
Even I thought same. I understand by the time _createenv() runs VIRTUAL_ENV, PATH, and UV_PYTHON all point to the not-yet-created directory, but I verified that UV_PYTHON is overridden by the explicit --python sys.executable CLI flag I tested this locally by running UV_PYTHON=/nonexistent/bin/python3 uv venv --python $(python3 -c "import sys; print(sys.executable)") --no-project /tmp/test-venv and it succeeds. That said, if the design intent is for self.run() to only be used once the venv exists, that makes sense -- I mainly wanted to understand the reasoning behind keeping it separate. Happy to close the PR if you'd prefer it stays as-is. |
_createenv()calledexternal_commands.run()directly while every other method usesself.run(), duplicating ctx-access logic fornetwork_isolation. The--pythonCLI flag passed touv venvtakes precedence overUV_PYTHONset byget_venv_environ(), so the swap is safe.Having a single entry point for command execution simplifies auditing and future cross-cutting changes like environment filtering or network policy enforcement.
Closes: #1276
Pull Request Description
What
Why