Share one docker test harness: cov_docker_args ×10, skip_if_no_image ×11 and assert_vex_agent_attested ×8 are copied, and 8 docker suites never honour SOCKET_PATCH_DOCKER_E2E_REQUIRED
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 30/100
Rechercherichtung
Start with crates/socket-patch-cli/tests/docker_vendor_common/mod.rs, which already exports most of the shared helpers, then compare the duplicated cov_docker_args, skip_if_no_image and assert_vex_agent_attested copies in the tests/docker_e2e_*.rs suites. The SOCKET_PATCH_DOCKER_E2E_REQUIRED gate also lives in .github/workflows/ci.yml, inside the sbt) case arm. Done means the helpers live in one module, every docker suite still passes with the same test names, and a wrong image tag fails instead of skipping. The issue links #1940 for the gate's truthiness rule, so check that first.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor. Register ID: T60.
Problem
Every docker_e2e_*.rs agent suite carries its own copy of the same container scaffolding, even though tests/docker_vendor_common/mod.rs already exports most of it. docker_e2e_npm.rs includes docker_vendor_common and still keeps its own copies. All links are at cbbbdb9.
cov_docker_args, 10 copies. Nine are byte-identical (md5-checked); thedocker_vendor_commonone differs only bypub.- cargo L37-L52, composer L42-L57,`` deno L55-L70, gem L48-L63, golang L35-L50, maven L47-L62, npm L65-L80, nuget L51-L66, pypi L53-L68, docker_vendor_common L44-L59.```
- sbt forks it as
binary_mounts(sbt L464-L482) and addsSOCKET_PATCH_DOCKER_BIN.
skip_if_no_image, 11 variants, and the required gate has drifted:- 7 copies never read a "required" variable, so they soft-skip whenever the image is missing. They are identical apart from the image name: gem L385-L398, plus cargo L379, composer L355, golang L347, maven L403, nuget L476 and pypi L756. npm's
skip_if_no_docker_image(L603-L618) is also ungated. - deno gates on
SOCKET_PATCH_REQUIRE_DOCKER(deno L497-L524). That variable is set nowhere in the repository, so its comment "CI does this" is false. - sbt (L440-L461) and docker_vendor_common (L72-L96) honour
SOCKET_PATCH_DOCKER_E2E_REQUIRED=="1". - CI exports
SOCKET_PATCH_DOCKER_E2E_REQUIRED=1only inside thesbt)case arm of both docker jobs (ci.yml L945, ci.yml L2332). If the image tag of any other leg drifts from the suite's literal, that leg goes green having asserted nothing, and that includes the vendor capstones whose shared gate does read the variable. The tags match today, so this is a latent hole rather than a test that is vacuous now.
- 7 copies never read a "required" variable, so they soft-skip whenever the image is missing. They are identical apart from the image name: gem L385-L398, plus cargo L379, composer L355, golang L347, maven L403, nuget L476 and pypi L756. npm's
run_container, 5 copies, identical apart from the image name: composer L370, deno L526, gem L400, nuget L533, pypi L813. pypi's copy has an unused_api_urlparameter. cargo, golang and maven inline the samedocker runinstead (for example cargo L402-L416).`````assert_vex_agent_attested, 8 byte-identical 34-line copies (md5-checked): cargo L334-L367, composer L390, gem L420, golang L306, maven L362, npm L718, nuget L498, pypi L778.vex_e2e_common::assert_attestedwithMarker::Appliedalready does this check, and more strictly.- The in-container git-blob hasher, 4 copies:
GIT_SHA256_FNis byte-identical in cargo L130, golang L126 and maven L140.docker_vendor_common::git_blob_sha(L250-L259) is the only copy that fails on a missing file. The others hash a bare header.- npm prepends that prelude and then redefines its own
git_sha256anyway (L868).
- A plain sha256 helper, 4 copies, in suites that already include
common:plain_sha256in composer L63, gem L69 and nuget L71, andsha256_hexin pypi L75. This is the same pattern as #1959. - The mock-request check has drifted.
- cargo and pypi
.expectthe recorded requests and check that the batch body carries the purl. - gem L462, nuget L550 and npm L757 use
unwrap_or_defaultand check the path only. pypi's own comment warns that this form is vacuous.
- cargo and pypi
- The apply-summary check is grepped in bash four ways.
- gem's unanchored
'"applied": 1'also matches10. I executed the grep on"applied": 10,, and it matched. - maven and nuget use a trailing comma, so they depend on field order.
- golang uses an anchored
-E. docker_vendor_common::assert_summaryexists and uses a word boundary.
- gem's unanchored
- Dead code:
docker_vendor_common::run_in_image(L203-L205) has no callers.#[allow(dead_code)]hides it.
Proposed change
- Rename
docker_vendor_commontodocker_common, or addtests/docker_common/mod.rswithdocker_vendor_commonbuilt on it. Make it the only home for these helpers:cov_docker_args, folding in sbt'sSOCKET_PATCH_DOCKER_BINbranch;skip_or_require(image), which readsSOCKET_PATCH_DOCKER_E2E_REQUIREDwith the truthiness rule chosen in #1940;run(image, script);assert_vex_agent_attested(stdout, purl, uuid, ghsa), built onvex_e2e_common::assert_attested;- an
assert_api_exercised(server, purl)that.expects the recorded requests and checks the batch body; - the
git_blob_shaprelude.
- Delete the per-suite copies,
plain_sha256/sha256_hex(usecommon::sha256_hex) andrun_in_image. - In
ci.yml, exportSOCKET_PATCH_DOCKER_E2E_REQUIRED=1for every docker matrix leg, not just inside thesbt)arm. Delete deno'sSOCKET_PATCH_REQUIRE_DOCKER. - Replace the bash summary greps with
assert_summary, or print the envelope between markers and parse it on the host withcommon/envelope.rs.
Size
About 11 test files plus ci.yml. Roughly −700 / +150 lines.
Acceptance criteria
- Every docker suite still passes in the
coverage-dockerande2e-dockerjobs, with the same test names. - With a deliberately wrong image tag and the CI env set, each leg fails instead of skipping.
grep -c "fn cov_docker_args\|fn skip_if_no_image\|fn assert_vex_agent_attested" tests/docker_e2e_*.rsreturns 0.- gem's applied check no longer matches
"applied": 10.
Related: #1940 (T50, the gate truthiness rule), #1959 (T55), #1957 (T58).
- Vorherrschende Sprache
- Rust
- Sterne
- 9
- Forks
- 2
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 309
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus SocketDev/socket-patch
-
Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)Evtl. vergeben @mikolalysenko hat das heute übernommen. Offenagent:claimed agent:triaged ci-janitor priority:p1
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
SocketDev/socket-patch#2238 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit priority:p3 refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
SocketDev/socket-patch#1860 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit priority:p3 refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
SocketDev/socket-patch#1838 ·
Maintainer antworten meist innerhalb von 1 Tag
-
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)Evtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenagent:triaged ci-janitor priority:p1
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 42/100
SocketDev/socket-patch#2235 ·
Maintainer antworten meist innerhalb von 1 Tag
-
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 runEvtl. vergeben @mikolalysenko hat das heute übernommen. Offenagent:claimed agent:triaged bug bughunt pm:bundler priority:p1 ux
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 18/100
SocketDev/socket-patch#2231 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in SocketDev/socket-patch
Ähnliche Issues
-
area: cli good first issue type: feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
renaming a provider to a taken name fails with a raw sql errorEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenarea:storage kind:bug priority:p3 ready
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug bugfix
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
storytold/photocraft#16975 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
expo/exact#1716 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag