Copy test fixture trees through one tests/common::copy_tree: 38 recursive copiers, 20 identical
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with the identical copies in crates/socket-patch-cli/tests/e2e_redirect_cargo_build.rs (around L139) and mode_migration_npm.rs (around L120), then add one copy_tree to tests/common/mod.rs. The drifted callers need separate handling: the gem copy at e2e_redirect_gem_build.rs L253 silently accepts a missing source, and the skip-list and walkdir variants need a copy_tree_except only where they are used. Done when cargo test -p socket-patch-cli --tests --no-run builds, the touched suites pass, and the grep for fn copy_tree( or fn copy_dir_recursive( returns only tests/common/.
索引モデルが issue の本文から書いたものです。
説明
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register.
Kind: refactor. Register ID: T64.
Problem
crates/socket-patch-cli/tests has 38 recursive directory copiers: 26 copy_dir_recursive, 12 copy_tree and a few copy_dir. tests/common has none, although 129 suites include it.
- Identical copies. 20 bodies are identical after whitespace normalization, for example e2e_redirect_cargo_build.rs L139,`` e2e_vendor_golang_build.rs L220 and mode_migration_npm.rs L120.```` The full list:
e2e_redirect_{bun,cargo,pnpm,yarn_berry,yarn_classic}_builde2e_vendor_{bun,cargo,gem,golang,pnpm,pypi,yarn_berry,yarn_classic}_builde2e_vendor_yarn_classic_dev_flowe2e_vendored_productione2e_yarn4_{pnpm_linker,workspaces}_buildmode_migration_{bun,cargo,npm}
- Already "shared" copies. Three crate-local modules export the same body as
pub: composer_e2e_common L323,`````maven_build_commonL509 and `npm_e2e_common/manifestless.rs` L30. `prebuilt_common` keeps a private copy at L722,`````` and `e2e_nuget_dotnet_build.rs` L320 re-copies it. - Drifted copies. The other 15 have drifted:
- e2e_redirect_gem_build.rs L253 silently accepts a missing source.
- Some copies take a skip list:
copy_tree(from, to, skip)×2. e2e_gradle_agent_build.rsL1077 walks withwalkdir.e2e_embedded_vex.rsL279 copies one level only.
Same family, also to collapse once the helper exists:
- Scan proxy.
start_proxyandassert_proxy_served_scansare byte-identical ine2e_cargo.rsL33/L112,e2e_composer.rsL31/L79,e2e_maven.rsL33/L91 ande2e_nuget.rsL33/L162.e2e_gem.rsL292 is a deliberate by-package variant, but the composer doc still says that suite has the same shape. - Hosted pins.
hosted_pin_countis written ×8 (e.g.e2e_hosted_production.rsL421,e2e_bun_lockb.rsL125,in_process_vendor.rsL290) andhosted_pinned×14, besidecommon::envelope::hosted_pins.
Proposed change
- Add
pub fn copy_tree(from: &Path, to: &Path)totests/common/mod.rs, using the identical body above. - Delete the 20 identical copies, the 4
*_commoncopies and the nuget copy. Import fromcommoninstead. - For the drifted callers:
- Keep a skip-list or missing-source variant only where a caller needs it, as
copy_tree_except(from, to, skip)in the same module. - Make the gem caller check existence itself.
- Keep a skip-list or missing-source variant only where a caller needs it, as
- Optional follow-up in the same PR or the next one:
- Move the 4 identical
start_proxy/assert_proxy_served_scansinto atests/common/scan_proxy.rs. - Replace
hosted_pin_countwithenvelope::hosted_pins(..).len().
- Move the 4 identical
Size
About 40 test files. Roughly −450 lines.
Acceptance criteria
- No test changes its assertions. The touched suites build and pass:
cargo test -p socket-patch-cli --tests --no-run, plus the host-runnable ones that use the copies (mode_migration_*,e2e_redirect_cargo_build). grep -rnE "fn (copy_tree|copy_dir_recursive)\(" crates/socket-patch-cli/testsshows onlycommon/.
- 主要言語
- Rust
- スター
- 9
- フォーク
- 2
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 309
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SocketDev/socket-patch のほかの issue
-
Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)対応中かも @mikolalysenko が今日担当しました。 オープンagent:claimed agent:triaged ci-janitor priority:p1
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
SocketDev/socket-patch#2238 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
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 日以内に返信
-
Nightly: pnpm11_registry_route_is_cleaned_up_when_a_patch_is_not_needed fails on Windows (pnpm records the RUNNER~1 short path as a second importer)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンagent:triaged ci-janitor priority:p1
難易度 3/5 半日 初心者へのやさしさ 42/100
SocketDev/socket-patch#2235 ·
メンテナーはふだん 1 日以内に返信
-
Agent mode reports a gem whose installed file was edited as "not installed on this host" / "not found on disk", `apply --check` says to run `apply`, and `rollback` exits 1 with "modified after patching" on every run対応中かも @mikolalysenko が今日担当しました。 オープンagent:claimed agent:triaged bug bughunt pm:bundler priority:p1 ux
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
SocketDev/socket-patch#2231 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
SocketDev/socket-patch の issue をすべて見る
似ている issue
-
area: cli good first issue type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
renaming a provider to a taken name fails with a raw sql error対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンarea:storage kind:bug priority:p3 ready
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug bugfix
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
storytold/photocraft#16975 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信