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 vendored Hatch refs in %/#/;/? checkouts (#547) by mikolalysenko · Pull Request #1428 · SocketDev/socket-patch Conversation
|
| Issue | Test | Without the fix | With the fix |
|---|---|---|---|
#547 (scan in an unsafe path: %2F, %20, #, ;, ?) |
mode_migration_pypi::hatch_vendored_refuses_a_root_hatch_cannot_expand |
FAILED (exit 0, wiring written) | ok |
#547 (checkout relocated to app_feature%2Fsix-patch) |
mode_migration_pypi::hatch_vendored_rerun_refuses_after_relocation_to_unsafe_root |
FAILED (exit 0, in sync) | ok |
#547 (load/preflight, symlinked root, 100%/@/'/space controls, tab) |
socket-patch-core vendor::pypi_hatch::tests::root_hatch_cannot_expand_is_refused |
FAILED (load must refuse) |
ok |
Local runs:
cargo fmt --all -- --check: clean.cargo clippy --workspace --all-features -- -D warnings: clean.cargo test --workspace --all-features --no-fail-fast: every Hatch andcovgap_commands_vendor state-writerepair and in_process_redirect cleanup-failure tests, ande2e_bun_lockb fails because there is nomissing_blob). CI runs as a normal user.e2e_vex_build hatch::) uses temp paths with none/code-review high raised 7 findings. These were fixed in 8d4e9ea:
check the real path, not the path as written; allow a % that starts no
escape; refuse whitespace and control characters; ignore the Windows
\\?\ prefix; stop the error message from repeating the character
list by hand.
Not fixed: when the root is refused in the supersede path, load and
then preflight both run the check. This only happens on a refusal and
costs one extra read of two small files, so it isn't worth a new
refusal code.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Gw7nKi8mXGzQ2JucUXxYRF
Generated by Claude Code
Note
Medium Risk
Changes vendored Hatch preflight/load behavior for checkouts under unusual paths; failures are explicit refusals rather than silent broken installs, with no impact on hosted/agent flows.
Overview
Fixes #547 by refusing vendored Hatch vendor / scan work when the project’s canonical checkout path contains characters Hatch’s {root:uri} does not escape (%XX, #, ?, ;, control/whitespace other than space). load and preflight now call require_expandable_root (via root_uri_unsafe_char) and return pypi_hatch_unsupported without writing files or reporting in-sync after a move to an unsafe path. Hosted/agent modes are unchanged.
Integration and unit tests cover unsafe Jenkins-style paths (app_feature%2Fsix-patch), symlink resolution, and safe paths (@, ', space, bare %). docs/testing/hatch.md documents the restriction.
Separately, test cache_env ambient scrubs snapshot the parent environment once through scrub_parent_vars so self-tests match the scrub and avoid races when in-process tests mutate env between reads.
Reviewed by Cursor Bugbot for commit 272c022. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
Vendored Hatch wiring points at {root:uri}/.socket/vendor/..., but
Hatch expands {root:uri} escaping only spaces. In a checkout whose path
holds %, #, ? or ; (a Jenkins multibranch workspace like
app_feature%2Fx), pip decodes, truncates or rejects the URL, so every
Hatch env failed to install while the scan reported success.
vendor and scan --mode vendored now refuse such a root with
pypi_hatch_unsupported before writing anything, including a re-run of a
checkout that was vendored elsewhere and then moved. The hatch testing
doc notes the relocation limit.
Fixes #547
Assisted-by: Claude Code:claude-opus-5-5
Hatch builds {root:uri} from the real project path, so a checkout
reached through a symlink is now checked at its target. Only a % that
starts a %XX escape is refused (pip leaves 100% alone), and a tab or
other non-space whitespace or control character, which the PEP 508
parser stops at, is refused too. A Windows \\?\ prefix no longer counts
as a ?.
Refs #547
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 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.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Labeled Ready for review at head
Slack announcement not sent this run (Slack send unavailable); the next run will retry. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Final review briefWhat it does. Vendored Hatch wiring writes Risk: low. It only adds a refusal on the vendored Hatch path, which runs in Look here
Verified
Changes I made: none. Open questions: none. Nit, not blocking: on a supersede refusal the check runs twice, once in Auto-merge is armed, so approving this sends it 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.
The coverage job failed this PR's merge-queue run (2ea36d6). That job flakes in in_process_edge_cases (#1416): the cache_env scrub self-tests read the parent env twice while in-process tests set SOCKET_OFFLINE. Port #1418's fix (one snapshot of the parent env) so the queue run is not at the mercy of that race. It no-ops once #1418 lands. Refs #1416 Assisted-by: Claude Code:claude-opus-5-5
|
[agent] This PR was dequeued because I can't read the job log from this sandbox: the log host returns 403, which is the same block noted on #1416. The annotation only says #1418 fixes that flake and is still open, so I ported its one-file test change in 272c022. It becomes a no-op once #1418 merges. Auto-merge was disarmed when the PR was dequeued. It needs to be re-queued once CI is green on 272c022. Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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 272c022. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Final reviewer: re-enqueued once after the 16:02 merge-queue eviction. Head 272c022 (carries the ported #1418 coverage-flake fix) is approved on head, 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.
Vendored Hatch wiring makes every Hatch install fail when the checkout path contains %XX, # or ; (e.g. a Jenkins "feature%2Fx" workspace), because Hatch's {root:uri} only escapes spaces
There was an error while loading. Please reload this page.