Route Gradle digests through utils::digest - #878
Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
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
Collaborator
Author
|
BugBot review 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 659ac2c. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 5, 2026
Collaborator
Author
|
[agent] Ported into #873 (cherry-picked as e5dfad6) so that PR can go green while Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
main has been red since #865 added a check that production code computes digests through utils::digest, while #646's Gradle code still hashes inline. Port #878's change so this PR's coverage and test-release go green; it no-ops once #878 lands on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016uQyhodCtdJGrKaD7AAV1n
This was referenced Oct 5, 2026
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
utils::digest's production_digests_go_through_the_helpers fails on main: three Gradle/JVM files compute digests inline. That makes `coverage`, `test` and `test-release` red on every PR. #878 routes them through utils::digest. This is the same change, ported so this PR's CI is green. It becomes a no-op once #878 lands. Claude-Session: https://claude.ai/code/session_01LS9AJhpVngXZxng8TRA2Kd Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 5, 2026
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
main's #865 added a test that fails when production code computes digests inline; the Gradle cache, JVM jar and Maven sidecar code landed with inline sha1/sha256 calls, so main's coverage and test-release jobs fail production_digests_go_through_the_helpers. Same change as #878, ported so this PR's CI runs green against the current base; it no-ops once #878 lands. Refs #831 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMZyKmgYNAridSR5eqv999
Collaborator
Author
|
Burn-down agent: labeled Ready for review at
Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
`main` fails `utils::digest::tests::production_digests_go_through_the_ helpers` because #646 left inline sha1/sha256 calls in `gradle_cache.rs`, `jvm_jar.rs` and `sidecars/maven.rs`, which turns `test`, `test-release` and `coverage` red on every PR. This is #878's change verbatim; it no-ops once #878 merges. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
main went red when Gradle code landed with inline sha1/sha256 calls that utils::digest::tests::production_digests_go_through_the_helpers rejects. Same change as #878; it no-ops once main carries it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NEpjVvY7X41jPuVuoiCLVz
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
Main is red since 1714299 (#865): its production_digests_go_through_the_helpers guard flags the inline digests that #646 added in gradle_cache.rs, jvm_jar.rs and sidecars/maven.rs. This is the same change as #878 and becomes a no-op once that lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VSXCFoPbraq7rNKJpXEP2n
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
main fails socket-patch-core's lib guard test production_digests_go_through_the_helpers because three Gradle files still hash inline, which turns coverage, test and test-release red on this PR. This is the same change as #878 and becomes a no-op once that lands on main. Co-Authored-By: Claude <noreply@anthropic.com>
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 5, 2026
utils::digest's production_digests_go_through_the_helpers fails on main: three Gradle/JVM files compute digests inline. That makes `coverage`, `test` and `test-release` red on every PR. #878 routes them through utils::digest. This is the same change, ported so this PR's CI is green. It becomes a no-op once #878 lands. Claude-Session: https://claude.ai/code/session_01LS9AJhpVngXZxng8TRA2Kd Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> (cherry picked from commit 4d8cad2)
This was referenced Oct 5, 2026
This was referenced Oct 5, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Summary
mainhas been failingsocket-patch-core --libsincec644ab0. The cause is a semantic conflict between Gradle support (#646) and the digest helpers (#865), not either PR alone. #865 added a guard test,utils::digest::tests::production_digests_go_through_the_helpers, which asserts that production code hashes only throughutils::digest. #646 landed three files that still hash inline:crawlers/gradle_cache.rs:pristineandDerivedIndex::query(sha1)patch/jvm_jar.rs:sha256_hex/sha1_hexpatch/sidecars/maven.rs:Algo::digest(sha1)This breaks
test (ubuntu/macos),test-releaseandcoverageon every open PR (first seen on #827).Fix
Each inline call goes through
utils::digest::sha1_hex_of/sha256_hex_of. Those helpers compute the same lowercase hex, so behaviour is unchanged. I removed theDigestimports that became unused. The test-only inline SRI injvm_jar.rs's test module is left alone, since the guard skips test modules. No other production code changes.Evidence
origin/mainc644ab0:cargo test -p socket-patch-core --all-features --lib -- utils::digest::tests::production_digestsfails, withleftlisting the three files above.cargo test -p socket-patch-core --all-features --libpasses 5243 tests. The only 4 failures are the chmod-based write-failure tests (copy_tree,vlt_heal,pypi_poetry,pypi_requirements), which can't fail as root in the sandbox; they're unrelated, and CI runs as non-root.cargo test -p socket-patch-core --all-features --lib -- utils::digest gradle_cache jvm_jar sidecars: 67/67 pass.cargo clippy --workspace --all-features -- -D warningsis clean, andrustfmt --checkis clean on the three touched files.Related: #827 needs this fix to go green.
🤖 Generated with Claude Code
Generated by Claude Code
Note
Low Risk
Refactor-only: same hex digests via shared helpers; no logic or API changes beyond satisfying the digest guard test.
Overview
Gradle cache, JVM jar patching, and Maven sidecar code no longer compute SHA-1/SHA-256 with inline
Digest+hex::encodecalls. Production hashing now goes throughutils::digest::sha1_hex_ofandsha256_hex_ofingradle_cache(pristine,DerivedIndex::query),jvm_jar(sha1_hex/sha256_hex), andsidecars/maven(Algo::Sha1::digest).This aligns Gradle/JVM paths with the
production_digests_go_through_the_helpersguard from #865, which was failing after #646 landed inline digests. Unusedsha1/sha2Digestimports were removed; digest output format is unchanged.Reviewed by Cursor Bugbot for commit 659ac2c. Configure here.
Generated by Claude Code