Repository navigation
Give the pip case of the quoted-URL credential test its own venv, so it passes off Ubuntu - #2457
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Conversation
`a_hosted_warning_quotes_a_lock_entry_without_its_token` (#2445) scans a project that declares `six` by a direct reference and has no venv. A scan reads the installed packages, so without a venv it read the Python on PATH. That Python holds `six` 1.16.0 on Ubuntu, which ships it, so the test passed in PR CI. On the Windows runner and on a Mac without `six` the scan ends with "No packages found" and never quotes the entry, and the three `scan` runs of the case fail. The project now has its own venv with `six` 1.16.0 in it, laid out as the crawler looks for it on each platform. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Python crawler reads an activated virtualenv (`VIRTUAL_ENV`) ahead of the project's own venv, and the test ran the binary with that variable passed through. Run from a shell with a virtualenv activated, the pip case read that one and failed the same way as before. The child now runs without the variable, as the other scan tests do. The module's header no longer calls every project file-only. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PR SummaryLow Risk Overview Test execution no longer uses Reviewed by Cursor Bugbot for commit 20d65df. Configure here. |
…tials-test-own-venv The head 20d65df never got a pull_request CI run, so the required checks were missing; this merge brings in main and runs them. Assisted-by: Claude Code:claude-opus-5-5
|
[agent] PR shepherd: review brief for the approver What it does. Fixes the test from #2445 that checks a scan doesn't print the credential of a URL quoted from a lockfile. Its pip case had no venv, so the scan read the machine's own Python. That passed only where Risk. Low. No product code changes. The child runs with the same scrubbing as Look here.
Verified.
Changes I made. I merged Generated by Claude Code |
Problem
quoted_url_credentials::a_hosted_warning_quotes_a_lock_entry_without_its_token(tests/scan, added by #2445) fails off Ubuntu. Its pip case scans a project that declaressixby a direct reference and has no venv. A scan reads the installed packages, so without a venv it reads the Python on PATH:six1.16.0 (the distribution ships it), so the test passed in PR CI, which runs on Linux.six, the scan ends with "No packages found: the N packages installed in the Python on PATH are not ones this project declares" and never quotes the entry. The threescanruns of the case fail.PR CI has no Windows or macOS job, so the first run to show it was a dispatched Windows run of
ci.yml(46922142757,test (windows-latest, 2)). Every Windows run fails on it, and so does the nightly.Fix
The project of the pip case gets its own venv with
six1.16.0 in it, laid out as the crawler looks for it on each platform (.venv/Lib/site-packageson Windows,.venv/lib/python3.12/site-packageselsewhere). The scan then reads the project's own packages on every machine.The test also runs the binary without
VIRTUAL_ENV, as the other scan tests do: the Python crawler reads an activated virtualenv ahead of the project's own venv.Only the test changes.
Proof
six: the test failed before (3 of 10 runs, "No packages found"), and passes with the change, with the other tests of the file.six: the test fails with the venv alone and passes onceVIRTUAL_ENVis kept from the binary.ci.ymlwithos=windowson20d65dfeapassed (24 jobs passed, 24 skipped by the OS filter, none failed). The shard that failed before,test (windows-latest, 2), has 2,702 tests passed and 0 failed, the three ofquoted_url_credentialsamong them.Code review
/code-review highfound two things, both fixed in the second commit: an activated virtualenv still reached the binary and was read ahead of the project's venv, and the module's header still called every project file-only.🤖 Generated with Claude Code
Generated by Claude Code