Skip to content

Purge snapshots from the Maven cache in reproducibility checks#508

Merged
ppkarwasz merged 2 commits into
gha/v0from
fix/purge-snapshot-cache
Jul 26, 2026
Merged

Purge snapshots from the Maven cache in reproducibility checks#508
ppkarwasz merged 2 commits into
gha/v0from
fix/purge-snapshot-cache

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

Fixes verify-reproducibility-reusable comparing builds against stale artifacts instead of the declared reference repository.

The artifact:compare goal 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:

  • Log the reference repository URI in a dedicated log group.
  • Before the build, purge all *-SNAPSHOT directories from the local Maven repository, emitting a ::warning:: for each file found, since their presence indicates a polluted cache.
  • After the build, silently purge all *-SNAPSHOT directories again (with if: always()), so the cache saved by the post step stays clean.

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>
Assisted-By: Claude Fable 5 <noreply@anthropic.com>
@ppkarwasz
ppkarwasz enabled auto-merge (squash) July 26, 2026 07:58
@ppkarwasz
ppkarwasz merged commit c33dab4 into gha/v0 Jul 26, 2026
2 checks passed
@ppkarwasz
ppkarwasz deleted the fix/purge-snapshot-cache branch July 26, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants