RFR: 8343546: GHA: Cache required dependencies in master-branch workflow

Aleksey Shipilev shade at openjdk.org
Fri Jul 4 15:30:56 UTC 2025


On Fri, 4 Jul 2025 14:24:00 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> > GHA isolation rules say that workflow caches from the parent branches can be used by descendant branches.
> 
> Is a corollary of that that one ought to keep one's fork `master` branch in sync with the main repo's (`openjdk/jdk`) `master` branch? I usually only do this locally (on my work machine), but not on the github fork. Just making sure I understand this right.

Yes, I think that's right. If personal fork `master` is not updated on GH side, the caches would be missing/stale, and the "old" caching scheme takes over like before: the caches would be per branch. In other words, caching stuff in remote `master` is completely opportunistic.

Keeping in perfect sync is not needed, IMO, as GHA caches are keyed by `.github` contents hash. So caches would become stale only when GHA code is changed.

FWIW, I prefer to sync `master` in fork in my master every so often, and keep it in sync with upstream `master`. Usually through a magic button in UI, sometimes with fetch/push. The optimization like this would probably push towards the similar workflow. We should probably write it down somewhere, but I don't quite see where...

-------------

PR Comment: https://git.openjdk.org/jdk/pull/26134#issuecomment-3036683454


More information about the build-dev mailing list