Fix: oxlint/oxfmt binaries are fetched from github.com, unlike ruff/ty which resolve via PyPI - #125
Open
pullapprove5[bot] wants to merge 1 commit into
Open
Fix: oxlint/oxfmt binaries are fetched from github.com, unlike ruff/ty which resolve via PyPI#125pullapprove5[bot] wants to merge 1 commit into
pullapprove5[bot] wants to merge 1 commit into
Conversation
…y which resolve via PyPI Reproduced the finding by installing uv (absent in this sandbox) and simulating a GitHub-blocked-but-PyPI-reachable environment (HTTPS_PROXY/HTTP_PROXY pointed at a closed port, since this container's real network could actually reach github.com). `uv run plain-code fix .` crashed with a raw httpx.ConnectError traceback when oxc's install step tried to hit api.github.com/github.com, and — unlike `plain code check`, which already has a `--skip-oxc` flag — `plain code fix` had no way to skip it and degrade gracefully.\n\nFixed plain-code/plain/code/oxc.py by wrapping the two GitHub-hitting calls (`get_latest_version`'s `httpx.get`, `download`'s `httpx.stream`) in try/except httpx.HTTPError, re-raising as `click.ClickException` with an actionable message pointing at `--skip-oxc` or pinning a version — Click renders just that message, no traceback. Added a `--skip-oxc` flag to the `fix` command in cli.py (mirroring the one `check` already had) so there's an actual escape hatch, not just a nicer error.\n\nRan the same simulated-block repro before/after: before, a full httpx traceback; after, a one-line `Error: Couldn't download oxlint from github.com (...). ... pass --skip-oxc.` and exit 1, with `--skip-oxc` now succeeding (exit 0) without any network access. Ran `uv run plain-code check .` and `uv run plain-code fix plain-code` unblocked afterward — ruff, ty, oxlint/oxfmt, and annotations all pass, confirming the normal path (including a real oxc download) still works. plain-code has no pytest suite (not in scripts/test's package list, no tests/ dir), so this check/fix run is the package's own validation.\n\nDid not pursue the finding's other suggested option (mirroring oxc binaries through PyPI wheels) — that's a much larger publishing/design change, not a minimal fix.
Author
|
Next steps:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reproduced the finding by installing uv (absent in this sandbox) and simulating a GitHub-blocked-but-PyPI-reachable environment (HTTPS_PROXY/HTTP_PROXY pointed at a closed port, since this container's real network could actually reach github.com).
uv run plain-code fix .crashed with a raw httpx.ConnectError traceback when oxc's install step tried to hit api.github.com/github.com, and — unlikeplain code check, which already has a--skip-oxcflag —plain code fixhad no way to skip it and degrade gracefully.\n\nFixed plain-code/plain/code/oxc.py by wrapping the two GitHub-hitting calls (get_latest_version'shttpx.get,download'shttpx.stream) in try/except httpx.HTTPError, re-raising asclick.ClickExceptionwith an actionable message pointing at--skip-oxcor pinning a version — Click renders just that message, no traceback. Added a--skip-oxcflag to thefixcommand in cli.py (mirroring the onecheckalready had) so there's an actual escape hatch, not just a nicer error.\n\nRan the same simulated-block repro before/after: before, a full httpx traceback; after, a one-lineError: Couldn't download oxlint from github.com (...). ... pass --skip-oxc.and exit 1, with--skip-oxcnow succeeding (exit 0) without any network access. Ranuv run plain-code check .anduv run plain-code fix plain-codeunblocked afterward — ruff, ty, oxlint/oxfmt, and annotations all pass, confirming the normal path (including a real oxc download) still works. plain-code has no pytest suite (not in scripts/test's package list, no tests/ dir), so this check/fix run is the package's own validation.\n\nDid not pursue the finding's other suggested option (mirroring oxc binaries through PyPI wheels) — that's a much larger publishing/design change, not a minimal fix.Opened by a PullApprove implementation run (implement-finding v5) for:
Merging this is what closes them as fixed.