Repository navigation
Bench: cover Gradle hosted mode (gradle/hosted, gradle/rescan) - #925
Mikola Lysenko (mikolalysenko) wants to merge 2 commits into
Conversation
#646 gave Gradle builds a hosted mode: scan crawls Gradle's modules-2/files-2.1 cache, pins suffixed versions in gradle.lockfile and wires the build through an owned settings script and index under .socket/gradle/. None of that was benchmarked; the maven scenarios only reach the pom.xml + ~/.m2 path. The gradle fixture is a single-project Groovy build with dependency locking (1000 locked artifacts, 25 patched direct deps), its cache under the fixture's GRADLE_USER_HOME with jar and pom in separate sha1 dirs. The Maven-coordinate generator, pom writer and maven2 grant builder are shared with the maven fixture, whose bytes are unchanged. The grant's indexUrl is https because the Gradle planner refuses anything else; scan never fetches it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
bugbot run Generated by Claude Code |
main has failed socket-patch-core's lib tests since Gradle support (#646) and the digest helpers (#865) both landed. The guard test production_digests_go_through_the_helpers flags three files #646 added that still hash inline: crawlers/gradle_cache.rs, patch/jvm_jar.rs and patch/sidecars/maven.rs. That breaks test, test-release and coverage on every open PR. Each inline sha1/sha256 call now goes through sha1_hex_of or sha256_hex_of, which compute the same lowercase hex. Behaviour is unchanged. Assisted-by: Claude Code:claude-opus-5-5 (cherry picked from commit 659ac2c)
|
[agent] Bench:
The fix is open as #878. I cherry-picked its single commit here ( Generated by Claude Code |
|
bugbot run Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bb74cac. Configure here.
|
Burn-down agent: labeled Ready for review.
Generated by Claude Code |
What main changed. #646 (
0685ba8c) added full Gradle support, including hosted mode.scannow crawls Gradle'smodules-2/files-2.1cache underGRADLE_USER_HOMEand pins the suffixed versions ingradle.lockfile. It wires the build through an owned settings script and index under.socket/gradle/. The suite had no Gradle scenario:maven/*only covers thepom.xml+~/.m2path.Suite changes
gradle/hostedandgradle/rescan. The project is a single-project Groovy-DSL build withdependencyLocking: 1000 locked artifacts, 25 of them patched direct deps. Its cache lives under the fixture'sGRADLE_USER_HOME, with jar and pom in separate sha1 hash dirs. The scenarios expect these rewrites:.socket/gradle/{.gitattributes,hosted-index.tsv,socket-patch.hosted.settings.gradle},gradle.lockfileandsettings.gradle. The only allowed warning isredirect_gradle_detached_configs_unguarded, which the planner always emits.indexUrlishttps://patch.socket.dev/..., not the mock. The Gradle planner refuses non-https repositories (redirect_gradle_override_invalid), and a scan never fetches the index. The artifact URL still points at the mock.mavenandgradlenow share the Maven-coordinate generator, the pom writer and the maven2 grant builder. Themavenfixture bytes are unchanged: I builtmaven/hostedwith the old and new bench binaries anddiff -rshowed them identical.gradleandGRADLE_USER_HOME.Validation (all runs against the main CLI
9c43dfc9, on a 4 vCPU Xeon @ 2.10GHz)cargo fmt -p socket-patch-bench,cargo clippy -p socket-patch-bench --all-features --all-targets -- -D warningsandcargo test -p socket-patch-bench(29 passed) are all clean.run -f '^gradle/' --runs 3: gradle/hosted 170.5 ms (0.17 ms/pkg), gradle/rescan 259.2 ms. Both validate with 53 requests each.compare -f '^gradle/' -f '^maven/'(head binary vs a copy of itself): no regressions. gradle/hosted -1.1%, gradle/rescan +4.5%, maven/hosted -1.6%, maven/rescan +1.7%.strace -f -e trace=execveon theserve gradle/hostedcommand: the CLI spawns nothing; the only execves are the shell,envandsocket-patchitself. The rewrittengradle.lockfilecarries<v>-socket.<uuid8>pins, andsettings.gradlegains theapply from:line.Time budget:
comparegrows by about 2 × 0.4 s per pair. A fullcomparetook about 13 min on this runner both before and after, so the change is within noise. Nothing was removed.🤖 Generated with Claude Code
https://claude.ai/code/session_014cKiDSpASodTewYpmHqEnG
Generated by Claude Code
Note
Low Risk
Primarily benchmark fixtures and digest helper consolidation; Maven fixture output is explicitly parity-checked, with no intended runtime behavior change in core.
Overview
Adds Gradle to the socket-patch bench suite (
gradle/hostedandgradle/rescan) so hosted-mode rewrites—.socket/gradle/*,gradle.lockfile,settings.gradle—and crawling ofGRADLE_USER_HOME’smodules-2/files-2.1cache are covered in CI. The Gradle fixture uses dependency locking (~1000 artifacts, ~25 patched), setsGRADLE_USER_HOMEon the fixture tree, and uses an https patch-registryindexUrl(Gradle’s planner rejects non-https repos) while artifact URLs still hit the mock.Maven and Gradle fixtures now share Maven-coordinate generation, POM writing, and maven2 grant construction (
jvm_universe,jvm_pom,jvm_patch); Maven bytes are intended to stay identical. README listsgradleand documents isolatedGRADLE_USER_HOMEin the harness env.In socket-patch-core, SHA-1/SHA-256 hashing in Gradle cache, JVM jar patching, and Maven sidecars is routed through
utils::digest::{sha1_hex_of, sha256_hex_of}(refactor only).Reviewed by Cursor Bugbot for commit bb74cac. Configure here.
Generated by Claude Code