Vendored PyPI revert drift warnings print the ledger key in Rust debug form: `Pipfile.lock entry for Some("default:six") changed since vendoring`
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
錯誤輸出來自 crates/socket-patch-core/src/vendor/state.rs 中 WiringRecord::key 對 Option<String> 鍵使用的 {:?} 格式化。該鍵用於 pypi_pipenv.rs 中的 vendor_lock_entry_drifted 和 pypi_requirements.rs 中的 vendor_revert_line_drifted,pypi_uv.rs 和 common.rs 中也有相同的模式。請先閱讀這四處呼叫位置,以及既有的 vendor_revert_residual_reference 警告,該警告已經直接輸出鍵的原始內容。完成的標準是:drift 警告輸出裸鍵或 None 的佔位符,並且 revert/rollback 測試仍然通過。
由索引模型根據 Issue 內容生成。
描述
[agent] Found by the scheduled Pipenv bug-hunt routine (ledger #313).
Summary
When a vendored Pipenv project's recorded wiring has drifted, vendor --revert, remove and rollback warn with the ledger key formatted through {:?} on an Option<String>. The warning, in both human output and --json warning text, shows a Rust Some("…") wrapper instead of the key:
Warning: Pipfile.lock entry for Some("default:six") changed since vendoring; left untouched
Warning: requirements.txt: the vendor line for Some("requirements.txt:1") changed since vendoring; left untouched
Impact
This is cosmetic only. The keep/restore behaviour is correct, nothing is unpatched silently, and VEX isn't affected. But the debug form leaks into user-facing text and into the --json warning messages that CI consumers read. When the key is missing (None, e.g. an older or hand-written ledger), the warning would print entry for None.
Repro (Linux, main 657fce2 / 5.0.1, real Pipenv 2026.9.1, local mock of the patch API serving a patched six-1.16.0 wheel)
cat > Pipfile <<'EOF'
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
six = "==1.16.0"
[requires]
python_version = "3.11"
EOF
pipenv lock
socket-patch scan --mode vendored --yes # Pipfile.lock six → ./.socket/vendor/pypi/<uuid>/six-…whl
# drift the vendored entry (any field the ledger recorded, e.g. its markers)
sed -i "s/python_version >= '2.7' and/python_version >= '2.8' and/" Pipfile.lock
socket-patch vendor --revert --yes # Warning: Pipfile.lock entry for Some("default:six") changed since vendoring; left untouched
socket-patch rollback --yes --json | grep -o 'entry for Some[^;]*' # entry for Some(\"default:six\") changed since vendoring
The requirements.txt variant: vendor with a sibling requirements.txt holding six==1.16.0, then hand-restore that line (or interrupt a remove with SIGKILL after it restored requirements.txt but before it dropped the ledger) and re-run vendor --revert. It prints the vendor line for Some("requirements.txt:1") changed since vendoring.
Expected vs actual
- Expected: the warning names the entry as the ledger records it (
Pipfile.lock entry for default:six …,the vendor line for requirements.txt:1 …). Other warnings in the same code path print keys plainly, e.g. thevendor_revert_residual_referencetext. - Actual:
Some("default:six")/Some("requirements.txt:1").
OS × version
| OS | Pipenv | vendor --revert |
rollback |
remove |
|---|---|---|---|---|
| Linux | 2026.9.1 | reproduces (×2) | reproduces (×2) | reproduces (requirements.txt variant) |
| macOS / Windows | not probed: the string formatting is platform-independent |
No bisect, because the format strings predate the current history.
Suspect code
WiringRecord::key is Option<String> (crates/socket-patch-core/src/vendor/state.rs:143), and these format it with {:?}:
crates/socket-patch-core/src/vendor/pypi_pipenv.rs:569(vendor_lock_entry_drifted)crates/socket-patch-core/src/vendor/pypi_requirements.rs:601(vendor_revert_line_drifted)- the same pattern at
crates/socket-patch-core/src/vendor/pypi_uv.rs:991andcrates/socket-patch-core/src/vendor/common.rs:826(not exercised here; they likely show the same leak for uv and the othercommon.rsusers)
A fix along the lines of rec.key.as_deref().unwrap_or("<unknown>") with {} would cover all four.
- 主要語言
- Rust
- 星號
- 8
- 分支
- 1
- 平均合併
- 16 小時 18 分鐘
- 30 天內合併 PR
- 587
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
SocketDev/socket-patch 的其他 Issue
-
agent:triaged bug bughunt pm:vlt priority:p1
難度 2/5 1-3 小時 新手友好度 62/100
SocketDev/socket-patch#1601 · 1 則留言 ·
維護者通常 1 天內回覆
-
agent:triaged bug bughunt pm:npm priority:p3 ux
難度 2/5 1-3 小時 新手友好度 75/100
SocketDev/socket-patch#1072 · 2 則留言 ·
維護者通常 1 天內回覆
-
agent:triaged bug bughunt pm:yarn-berry priority:p1
難度 2/5 1-3 小時 新手友好度 73/100
SocketDev/socket-patch#783 · 1 則留言 ·
維護者通常 1 天內回覆
-
Vendored cargo warns cargo_multi_version_old_cargo ("declares no rust-version") when the root package inherits rust-version from [workspace.package]可能已有人在做 @mikolalysenko 於 4 天前認領。 未關閉agent:triaged bug bughunt pm:cargo priority:p2
難度 2/5 1-3 小時 新手友好度 84/100
SocketDev/socket-patch#651 · 3 則留言 ·
維護者通常 1 天內回覆
-
agent:triaged bench enhancement perf-regression pm:bun priority:p1
難度 5/5 一週以上 新手友好度 8/100
SocketDev/socket-patch#1606 · 1 則留言 ·
維護者通常 1 天內回覆
查看 SocketDev/socket-patch 的全部 Issue
相似的 Issue
-
[1.x Bug] run-operation --sql reports success but rolls back writes on transaction-capable adapters未關閉triage
難度 2/5 1-3 小時 新手友好度 64/100
維護者通常 1 天內回覆
-
area:cli bug good first issue priority:medium
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commit可能已有人在做 @myOmikron 今天認領。 未關閉bug ready-for-agent
難度 2/5 1-3 小時 新手友好度 82/100
-
platform:windows tool triaged wontfix
難度 2/5 1-3 小時 新手友好度 62/100
維護者通常 1 天內回覆
-
resources: add a regression test confirming admin mint still works after the #16 SAC handoff可能已有人在做 @Daniexie 今天認領。 未關閉contracts good first issue Stellar Wave
難度 2/5 1-3 小時 新手友好度 72/100
OlaGreat/starbound-realms#137 · 1 則留言 ·