Gradle --global-prefix e2e tests pass without --global-prefix: the harness always sets GRADLE_USER_HOME, and no test asserts gradle_user_home_differs fires
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start with global_prefix_scan_says_nothing_about_the_user_home in crates/socket-patch-cli/tests/e2e_gradle_discovery_build.rs, then isolate_cli in tests/common/jvm_env.rs, which always sets GRADLE_USER_HOME. Remove that variable after prepare_command, add a positive control asserting gradle_user_home_differs appears without --global-prefix, and then assert it is absent with the flag. The same pattern applies to gradle_agent_global_prefix in e2e_gradle_agent_build.rs. Done means both tests fail when --global-prefix handling is stubbed out.
由索引模型根據 Issue 內容生成。
描述
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register.
Kind: bug (fake tests). Register ID: T67.
Problem
Two Gradle tests claim to prove --global-prefix behavior, but the harness makes the flag irrelevant to their assertions.
e2e_gradle_discovery_build.rs. global_prefix_scan_says_nothing_about_the_user_home`` asserts that gradle_user_home_differs is absent. The warning can't appear in this harness, because:
- the scan goes through
jvm_env::isolate_cli, which always setsGRADLE_USER_HOME(jvm_env.rs L106-L109); - the core check returns
NonewheneverGRADLE_USER_HOMEis set (gradle_cache.rs L551-L566).```
Executed on cbbbdb9 with a scratch build, running scan --json in a Gradle project with HOME ≠ passwd home:
| Case | warnings[] codes |
|---|---|
GRADLE_USER_HOME unset |
["gradle_user_home_differs"] |
GRADLE_USER_HOME set (the harness) |
[] |
--global-prefix, GRADLE_USER_HOME unset |
[] |
So the assertion holds whether or not --global-prefix suppresses the warning. The suite's scan doc at L111 says None means "no GRADLE_USER_HOME", which is false. No CLI test anywhere asserts that gradle_user_home_differs fires.
e2e_gradle_agent_build.rs. gradle_agent_global_prefix runs through socket(), which sets GRADLE_USER_HOME to the same cache (L333).````` A plain apply --offline already patches that cache (L468), so a CLI that ignored `--global-prefix` would still pass. This one comes from reading the code and was not executed.
Proposed change
For the discovery test:
- Remove
GRADLE_USER_HOMEafterprepare_command. - Add a positive control: the same scan without
--global-prefixassertsgradle_user_home_differsis present. - Then assert it is absent with the flag.
- Fix the L111 doc.
For the agent test:
- Remove
GRADLE_USER_HOME, or point it at an empty dir, so only--global-prefixnames the cache. - Assert the jar is patched there and untouched under the default home.
Size
2 test files. About +30/−10 lines.
Acceptance criteria
- Each test fails when
--global-prefixhandling is stubbed out. Show this once by mutation in the PR description. - The new positive control passes on
main.
- 主要語言
- Rust
- 星號
- 9
- 分支
- 2
- 平均合併
- 20 小時 47 分鐘
- 30 天內合併 PR
- 681
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
SocketDev/socket-patch 的其他 Issue
-
agent:triaged arch-audit priority:p3 refactor
難度 2/5 1-3 小時 新手友好度 83/100
SocketDev/socket-patch#1860 ·
維護者通常 1 天內回覆
-
agent:triaged arch-audit priority:p3 refactor
難度 2/5 1-3 小時 新手友好度 78/100
SocketDev/socket-patch#1838 ·
維護者通常 1 天內回覆
-
arch-audit refactor
難度 4/5 3-5 天 新手友好度 54/100
SocketDev/socket-patch#1993 ·
維護者通常 1 天內回覆
-
arch-audit refactor
難度 3/5 1-2 天 新手友好度 66/100
SocketDev/socket-patch#1992 ·
維護者通常 1 天內回覆
-
agent:triaged arch-audit priority:p3 refactor
難度 4/5 3-5 天 新手友好度 35/100
SocketDev/socket-patch#1987 · 1 則留言 ·
維護者通常 1 天內回覆
查看 SocketDev/socket-patch 的全部 Issue
相似的 Issue
-
A-linter
難度 2/5 1-3 小時 新手友好度 73/100
oxc-project/oxc#28783 ·
維護者通常 1 天內回覆
-
Substrait consumer doesn't recognise `shift_left` / `shift_right` from functions_arithmetic.yaml未關閉bug
難度 2/5 1-3 小時 新手友好度 76/100
apache/datafusion#27059 ·
維護者通常 1 天內回覆
-
Bump calamine to 0.38: RUSTSEC-2026-0436 (CFB/OLE2 panic and unbounded allocation) fails cargo audit未關閉
難度 2/5 1-3 小時 新手友好度 70/100
docling-project/docling.rs#979 ·
維護者通常 1 天內回覆
-
llm translation
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
維護者通常 1 天內回覆