Skip to content

Restore the Maven repository from the newest entry when the POMs change - #345

Merged
slachiewicz merged 1 commit into
v5from
agent/maven-repo-cache-fallback
Oct 14, 2026
Merged

slachiewicz merged 1 commit into
v5from
agent/maven-repo-cache-fallback

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

setup-java's cache: 'maven' restores only an exact match on the hash of every pom.xml, so any pull request or dependency bump that changes a POM started from an empty local repository and downloaded everything. The Maven repository is now cached with actions/cache directly: the key is still the POM hash, and a maven-repository-<os>-<arch>- restore key falls back to the newest entry the branch may read, normally the default branch's. A build that restored from the fallback saves under its own key, on the branches allowed to save caches and only after the build succeeded.

The new key prefix also leaves behind the setup-java-<os>-maven- entries that Release Drafter overwrote with a 2 MB stub (#343).

Verified: none yet beyond actionlint and zizmor, whose findings match v5; this branch's own push build exercises the restore path.

@slachiewicz slachiewicz added the enhancement New feature or request label Oct 14, 2026
Base automatically changed from agent/cache-save-long-lived to v5 October 14, 2026 00:28
setup-java's Maven cache matches only the exact POM hash, so a pull request or
dependency bump that touches a POM started from an empty repository. The
restore-keys prefix falls back to the newest default-branch entry.
@slachiewicz
slachiewicz force-pushed the agent/maven-repo-cache-fallback branch from 51c80a9 to 0ca003c Compare October 14, 2026 00:29
@slachiewicz
slachiewicz marked this pull request as ready for review October 14, 2026 00:35
@slachiewicz
slachiewicz merged commit c6ecbc3 into v5 Oct 14, 2026
10 checks passed
@slachiewicz
slachiewicz deleted the agent/maven-repo-cache-fallback branch October 14, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant