prebuilt_common::prepare_command silently drops --offline from vendor/repair, so 49 "--offline" test calls actually run online against a fixture server

Aperta
#1,969 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
testing

Direzione di ricerca

Start in crates/socket-patch-cli/tests/prebuilt_common/mod.rs around lines 606-616, where prepare_command filters out --offline for vendor and repair. Then check the call sites named in the issue: e2e_bun_lockb.rs (about lines 920-926 and 1042-1052) and e2e_composer_vendor_dir_hints.rs (about lines 96-100). Done means prepare_command asserts instead of filtering, the 49 literal --offline arguments are removed, the grep returns 0, and the affected suites still pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent:triaged arch-audit priority:p3 refactor

[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.

Kind: refactor (test honesty). Register ID: T61.

Problem

prebuilt_common::prepare_command rewrites the arguments it receives. For vendor and for non-revert repair, it filters out --offline and points the command at a fixture download server (prebuilt_common/mod.rs L606-L616):``

let fixture = Server::project_with_env(root, env);
command.args(args.iter().copied().filter(|a| *a != "--offline"));

The fixture itself is deliberate: the doc comment says it downloads fixtures for lifecycle setup. The problem is that callers still write --offline, and their comments and doc strings describe offline behaviour that the binary never receives.

  • On cbbbdb9, 40 suites call prepare_command. 16 of them contain 49 literal ["vendor", "--offline"…] / ["repair", "--offline"…] calls, and none of those runs offline.
  • e2e_bun_lockb.rs L920-L926 says "the offline vendor proceeds". The calls at L1042-L1052 pass --offline and run online.
  • e2e_composer_vendor_dir_hints.rs L96-L100```` documents its helper as "Run vendor --offline", but the flag is stripped there too.
  • A reader who sees "--offline" in a test assumes that the offline vendor path is covered. In these suites, it is not.
Proposed change
  1. Make prepare_command assert that args does not contain --offline for the download commands, and panic with a message that points at the fixture server. Do not filter the flag.
  2. Remove "--offline" from the 49 call sites. Fix the comments and doc strings that claim an offline run (e2e_bun_lockb L920-L926 and L1097, dir_hints L96).
  3. Wherever a test means to prove offline vendoring, run it explicitly without prepare_command, through hermetic::binary_command with --offline. A test that still passes that way does exercise the offline path.
Size

About 17 test files. Mostly one-token deletions, about −60 / +10 lines.

Acceptance criteria
  • Every affected suite passes unchanged apart from the argument lists. These are nightly or toolchain legs, so run them through e2e-* or locally with the toolchains.
  • grep -rn '"vendor", "--offline"\|"repair", "--offline"' over the suites that use prepare_command returns 0.
  • prepare_command no longer rewrites its arguments.
Lingua principale
Rust
Stelle
9
Fork
2
Merge medio
1g 8h
PR unite (30g)
309

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SocketDev/socket-patch

Tutte le issue di SocketDev/socket-patch

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.