Repository navigation
Fix Pipenv stale-install remedy built twice (#1878) - #1883
Conversation
Assisted-by: Claude Code:claude-opus-5-5
Hosted scan and vendored pypi each told the user how to reinstall a release Pipenv kept installed, and the copies drifted: hosted asked for `socket-patch vex --product <purl>` with the placeholder left in, hand-split the purl and fell back to a literal `<package>`. Both now call core's pypi_pipenv::stale_install_detail, which sorts the stale sites into the three classes (inherited base site, a venv copy hiding the base one, the venv's own copy) and words each remedy. Vendored text is unchanged; hosted keeps its warning code and lead sentence, names the package via parse_pypi_purl, and ends with the runnable `socket-patch vex` that vendored already used. `--product` takes the project's product purl, not the patched package's, so filling in the package purl would have been wrong. Fixes #1878 Assisted-by: Claude Code:claude-opus-5-5
Review follow-ups for the shared Pipenv remedy: hosted again says the "rewritten" Pipfile.lock (vendor says "wired"), a purl without a version falls back to the bare package name instead of the whole purl, and a name that is not a distribution name prints as `<package>` rather than landing unquoted in the shell commands users copy. The hosted test checks the named-category arguments again, and both callers share one directory-list formatter. Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
|
Burn-down agent: labeled Ready for review at
Generated by Claude Code |
|
Final review brief (head What it does. Hosted scan and vendored pypi each built their own wording for the Pipenv stale-install remedy. This PR moves that wording into one core helper, Risk: low. Only warning text changes. The hosted wording change is described in the PR and covered by a test. Look here
Verified
Changes I made: none. Open questions (non-blocking)
Auto-merge (squash) is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
A decoded purl name such as `--pre` passed the remedy's name guard and would be printed into `pip uninstall -y --pre`, where pip reads it as an option. Names must now start and end with a letter or digit, as PEP 508 requires; anything else prints as `<package>`. Assisted-by: Claude Code:claude-opus-5-5
|
[agent] Thanks. On the open questions:
Generated by Claude Code |
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ 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 e7151f5. Configure here.
Final review briefWhat it does. The Pipenv "unpatched release still installed" remedy was built twice, in hosted Risk: low. It changes advisory warning text only. Vendored output is byte-identical for valid names. The hosted text changes on purpose (the Look here
Verified
Changes I made: none. Open questions (non-blocking follow-up): Auto-merge is armed, so approving sends it straight to the merge queue. Generated by Claude Code |
|
[burn-down agent] Ready for review confirmed at
Generated by Claude Code |
Wenxin Jiang (Wenxin-Jiang)
left a comment
There was a problem hiding this comment.
[agent] Reviewed e7151f5887baff4b825f4d1d5e7b8ee94405bca9. Checked shared Pipenv remediation for own, inherited and shadowing installed copies. No major correctness issues found. Validation: source and regression-test review plus the available exact-head CI checks; no local test pass is claimed.
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1878
Summary
When an unpatched release is still installed, Pipenv won't reinstall it.
Hosted
scanand vendored pypi both tell the user what to run, and nowthey word that remedy through one core helper,
vendor::pypi_pipenv::stale_install_detail.Root cause
The remedy was built twice, in
scan/hosted/python.rsand invendor/pypi.rs::pipenv_stale_install_warning. Each copy sorted the stalesites into the same three classes (inherited base site, a venv copy hiding
the base one, the venv's own copy), and the two copies drifted. Hosted
hand-split the purl, fell back to a literal
<package>, and told the user torun
socket-patch vex --product <purl>with the placeholder left in.Changes
stale_install_detail(lock, name, version, sites, inherited, lock_change)partitions the sites and words each class once.join_dirsis the one directory-list formatter.pipenv_stale_install_warningcalls the helper, and its textis byte-identical. The existing
vendor/pypi.rspipenv stale tests guardthis.
its lead sentence, and the word "rewritten". It reads the package name
with
purl_parts, falling back to the bare name for a purl with noversion.
<package>, so a decoded purl can't put shell metacharacters into thecommands users copy.
A deviation from the issue
The issue suggested substituting the package purl into
socket-patch vex --product <purl>. That would be wrong.--producttakesthe project's product purl, not the patched package's (see
docs/testing/pipenv-compatibility.md). Both paths now end withsocket-patch vex, the command vendored andCLI_CONTRACT.mdalready use.vexitself says when a product must be passed.Not changed (review notes)
purl. The issue's "hosted keeps its own warning code and lead sentence"
covers this, and changing
warnings[]cardinality is a contract change.commands/pypi_reinstall.rskeeps its rollback sentence. It is adifferent message ("restored lock" after an unwind), it already uses
core's
stale_install_remedy, and its own purl split is the A14 cleanup.Tests
scan::hosted::python::tests::pipenv_remedy_is_the_shared_core_wording(equals the helper's text, no<purl>/<package>,--devand--categories "docs"reach hosted)vendor::pypi_pipenv::tests::stale_install_detail_words_each_site_class(own, shadowing, inherited, the mixedFor <dirs>:lead, unsafe name)vendor::pypipipenv stale testsThe CLI test that re-tested core's category logic is folded into the hosted
test above.
Commands run locally:
cargo fmt --all -- --checkandcargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-cli --all-features --lib --test in_process_redirect_pipenv: 940 + 11 passed.cargo test -p socket-patch-core --all-features --lib: 6995 passed and 4 failed. The 4 failures arecopy_tree::relax_loop_must_not_traverse_symlinked_root,vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry,pypi_poetry::wire_write_failure_*andpypi_requirements::wire_failure_rolls_back_*. They make dirs read-only withchmod, which root ignores (this container runs as uid 0), and they are in files this PR doesn't touch./code-review highran on the diff. Its confirmed findings are fixed ind35ba44: the hosted lock wording, the name fallback, the name guard,
purl_partsreused instead of wideningparse_pypi_purl, the hosted testcoverage, and the duplicate dir join.
https://claude.ai/code/session_011f9aeRsZjPSuB7GuzgvqyS
Generated by Claude Code