GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — Fix hosted Hatch ignoring uv sources (#673) by mikolalysenko · Pull Request #1706 · SocketDev/socket-patch Conversation
|
| Issue | Regression test | red → green |
|---|---|---|
| #673 | utils::hatch::tests::uv_sources_refuse_project_rewrites_under_the_uv_installer (url / path / git / case-folded name / marker array × project deps / optional deps × installer / uv-path × pyproject / hatch.toml; plus the allowed shapes, the env-var switch, an empty array and a mixed batch) |
fails on main, passes here |
| #673 | patch::redirect::hatch_tests::hatch_uv_source_leaves_the_dep_unconfirmed (lane-level: no pyproject write, uuid unconfirmed, redirect_hatch_unsupported) |
fails on main, passes here |
Run locally:
cargo fmt --all -- --check: okcargo clippy --workspace --all-features -- -D warnings: okcargo test -p socket-patch-core --lib hatch: 64 passed. With the fix disabled, both new tests fail.cargo test --workspace --all-features --no-fail-fast: 234 targets ok. 11 tests fail only in this container, and the same tests fail on main here. They are chmod-based write-failure tests, which can't fail while the container runs as root (in_process_redirect, repair, 4 core lib tests). The other two are e2e_bun_lockb tests, because the container has bun 1.4.4 instead of CI's version. None touch Hatch.SOCKET_PATCH_HATCH_E2E_VERSION=1.18.1 cargo test -p socket-patch-cli --all-features --test e2e_vex_build hatch:: -- --ignored: 6 passedsix = { index = "internal" } with Hatch 1.18.1 + uv and the direct URL won ("pass"), so refusing would be a false refusal. The reviewer's claim is unmeasured.no-sources isn't consulted. The refusal fails closed (agent mode still works), so this costs a false refusal, never an unpatched install.envs still counts as uv. This is the existing require_pip_installer_documents behavior shared with vendored mode, and it also fails closed.vex already omits the package after inspecting the env.Note
Medium Risk
Changes hosted Hatch redirect preconditions for uv + [tool.uv.sources]; behavior is fail-closed with new tests, but misclassification could block valid scans or leave edge cases (workspace-only sources) unhandled.
Overview
Fixes #673, where hosted Hatch scans could look successful while uv still installed the unpatched wheel when a Hatch env uses the uv installer and [tool.uv.sources] overrides the rewritten project pin.
The Hatch planner now reads [tool.uv.sources] when uv is active (installer = "uv", uv-path, or HATCH_ENV_TYPE_VIRTUAL_UV_PATH). For packages with a non-index source (url, path, git, mixed marker arrays, empty arrays), it refuses rewriting [project].dependencies and optional-dependencies before any write—same fail-closed pattern as other unsupported Hatch shapes. Hosted redirect leaves the dep unconfirmed, emits redirect_hatch_unsupported, and does not touch pyproject.toml. Environment dependency tables, index-only sources, the pip installer, and other packages in a batch still rewrite as before.
docs/testing/hatch.md documents this refusal. Regression coverage spans utils/hatch (matrix of source shapes and mixed batches) and redirect lane test hatch_uv_source_leaves_the_dep_unconfirmed.
Reviewed by Cursor Bugbot for commit 84d95a4. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
When a Hatch environment uses the uv installer, uv resolves a project dependency through the project's [tool.uv.sources] entry instead of the direct reference hosted mode writes. A url or path source then installs the unpatched wheel while the scan reports "redirected", and a git source breaks every install with conflicting URLs. Hosted Hatch now refuses such a pin before writing, as it already does for Hatch's own source tables, and reports redirect_hatch_unsupported. Environment dependencies, index-only sources and the pip installer are unaffected and still rewrite. Fixes #673 Assisted-by: Claude Code:claude-opus-5-5
HATCH_ENV_TYPE_VIRTUAL_UV_PATH switches Hatch to the uv installer with no file setting, so a url or path source still shadowed the hosted pin there. An empty source array is no longer treated as index-only. Refs #673 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 84d95a4. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Labeled Ready for review by the burn-down agent.
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does. When a Hatch environment uses the uv installer, uv resolves a project requirement through Risk: low–medium. The change only adds refusals, so the worst case is a false refusal: the user is pointed to agent mode and never gets an unpatched install. The uv detection reuses the existing Look here
Verified. I read the full diff and the check/apply round logic around it. A target refused in the check pass is skipped in the apply pass, so a partial write can't happen. Changes I made. None. Open questions. None. Auto-merge (squash) is armed: approving sends this PR straight to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
[agent] The merge queue removed this PR at 15:23 UTC with Re-arming auto-merge from this session was not permitted, so it needs to be re-queued by hand: re-enable auto-merge or add it to the merge queue. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[final reviewer] Re-added to the merge queue at 15:50 UTC (squash auto-merge re-enabled). The 15:23 eviction was a lost self-hosted runner in Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Hosted Hatch scan exits 0 "redirected" when [tool.uv.sources] pins the patched package, but Hatch's uv installer obeys the source: url/path sources install the unpatched wheel and git sources break every install
There was an error while loading. Please reload this page.