SOLR-17657: Use Gradle Verification Metadata #3828
Draft
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.
Description
This PR replaces Solr’s custom dependency verification with Gradle’s built-in Verification Metadata, as proposed in SOLR-17657.
Gradle’s mechanism provides a standardized and well-maintained way to verify dependencies before they are used, including all runtime and plugin artifacts.
Benefits:
Approach
This change builds on Solr’s existing verified checksums stored in
solr/licenses, ensuring a safe transition without discarding previously verified data.Additional checksums (for POMs, Gradle module files, plugins, and their dependencies) were generated using Gradle’s bootstrap procedure:
This follows the Trust On First Use (TOFU) model and the generated entries are explicitly marked as “Generated by Gradle”.
Warning
This PR is a work in progress, focused on achieving parity with Solr’s current checksum verification.
Feedback is welcome on how to handle future dependency upgrades securely. One possible next step is adding PGP signature verification using TOFU-based keys that can later be replaced with verified fingerprints.
While this wouldn’t prove artifact provenance, it would detect key changes and fail the build for manual review.
How to Review
Because this PR moves hundreds of checksum entries, manual line-by-line review isn’t practical. Copilot might actually be useful here.
For a manual review, here’s a recommended verification process:
Step 1: Verify SHA-1 checksum migration
A helper script
generate-verification-metadata.shis included. It reproduces the migration from Solr’s legacy SHA-1 data to Gradle’s verification format.You can verify that the migration output matches what’s committed:
If the files match, the migration is confirmed.
Step 2: Review SHA-256 generation
Commit 1f255ae adds SHA-256 checksums for artifacts not previously verified.
Because the migration script preserved line order consistent with Gradle’s
--write-verification-metadataoutput, this commit only adds new entries, it does not modify or remove existing ones.Step 3: Build verification
To confirm that dependency verification works end-to-end:
This ensures the build succeeds with the new verification metadata enabled.
Checklist
Please review the following and check all that apply:
mainbranch../gradlew check.