Strip credentials from editable VCS URLs in pip freeze #14340
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.44) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.44 · 225 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.324
Real PR Conversation Timeline
1 comments
"Review active on #14340"
general
weight: 0.35
sepehr-rs
What does this PR do?
pip freezebuilt the line for an editable VCS install from the checkout's live remote URL and never stripped user info, so a clone made withhttps://user:token@host/repoprinted the token (-e git+https://user:token@host/repo@<sha>#egg=name), and it ends up in committed requirements files. The non-editable path already emits the PEP 610-stripped URL fromdirect_url.json.This applies the same PEP 610 rule in
VersionControl.get_src_requirement, the one place every backend goes through: dropuser:password@unless it is${VAR}references or thegituser. Thegituser is kept on any scheme, matching whatdirect_url.jsonalready records; happy to restrict it to ssh schemes if preferred. Percent-encoded user names such as%67%69%74@are stripped, as they are fordirect_url.jsontoday.remove_auth_from_urlwas not used because it would also stripgit@from ssh URLs and${TOKEN}references (see #12365).Tests: parametrized unit test in
tests/unit/test_vcs.py(6 cases, fails without the change) and a functional test intests/functional/test_freeze.pythat adds a credentialedoriginremote to the test package and checks the freeze output. News fragmentnews/11410.bugfix.rst.Fixes #11410. Earlier attempt: #14222.
PR Checklist:
Assisted-by: Claude