Purge snapshots from the Maven cache in reproducibility checks#508
Merged
Conversation
The local Maven repository restored from the GitHub Actions cache contains the reference artifacts resolved by `artifact:compare` in previous runs. Since snapshots are not updated on every resolution, these stale copies shadow the reference repository and make the comparison meaningless. Purge all `*-SNAPSHOT` directories from the local repository before the build, warning about each file found, and purge them again after the build so they are not saved to the cache. Assisted-By: Claude Fable 5 <noreply@anthropic.com>
ramanathan1504
approved these changes
Jul 26, 2026
Assisted-By: Claude Fable 5 <noreply@anthropic.com>
ppkarwasz
enabled auto-merge (squash)
July 26, 2026 07:58
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.
Fixes
verify-reproducibility-reusablecomparing builds against stale artifacts instead of the declared reference repository.The
artifact:comparegoal resolves reference artifacts through the Maven resolver, which stores them in the local repository under their regular coordinates. Since the workflow caches~/.m2/repository, the next run finds the snapshot already present and never fetches it from the reference repository again.Changes to
verify-reproducibility-reusable:*-SNAPSHOTdirectories from the local Maven repository, emitting a::warning::for each file found, since their presence indicates a polluted cache.*-SNAPSHOTdirectories again (withif: always()), so the cache saved by the post step stays clean.