fix: Update bazel cache on "merge_group" event#97
Conversation
|
Can you along the way also check why caches are not saved in pull requests? One example https://github.com/eclipse-score/inc_someip_gateway/actions/runs/24330218768/job/71034147474#step:5:98 from eclipse-score/inc_someip_gateway#60 |
There was a problem hiding this comment.
Can you along the way also check why caches are not saved in pull requests?
One example https://github.com/eclipse-score/inc_someip_gateway/actions/runs/24330218768/job/71034147474#step:5:98 from eclipse-score/inc_someip_gateway#60
See #56
That was a concious decision so that the cache is not "polluted" with stuff that is only existing on a branch. The idea usually is that a feature branch would normally use 90% of the stuff from main, so it is most efficient if the cache contains the stuff from main and then for each PR build most of the stuff from the cache can be re-used. If the cache also gets filled with stuff from the feature branches then it could happen that stuff from the feature branch evicts main stuff from the cache so the cache content fits better to that PR but less to the content of other PRs.
At least that is what I assume was the reasoning why to use cache-save: ${{ github.event_name == 'push' }} in the first place.
|
I see, but something is not working as expected. I never saw cache hits for workflows running in pull requests. |
|
now I found a cache hit in a pull request: https://github.com/eclipse-score/inc_someip_gateway/actions/runs/24464232742/job/71486694945#step:5:114 Maybe I was wrong |
…e#97)" This reverts commit ac25d66. Github caches are complicated. Pull requests can use a cache that was either created by the same pull request or the main branch. Thus caches created by merge groups will not be used. On top of that each merge group run gets its own temporary branch and thus cache, which will never be reused, but consumes space.
This reverts commit ac25d66. Github caches are complicated. Pull requests can use a cache that was either created by the same pull request or the main branch. Thus caches created by merge groups will not be used. On top of that each merge group run gets its own temporary branch and thus cache, which will never be reused, but consumes space. For more information about cache sharing read [this](https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache)
The cache might get hit more often with the changes from eclipse-score/cicd-workflows#97
Fixes #95