Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid sbt cache being invalidated for a library that is only incrementing its own version #564

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rtyley
Copy link

@rtyley rtyley commented Dec 6, 2023

Description:
While working on guardian/gha-scala-library-release-workflow I noticed that no matter how many times I ran the workflow, actions/setup-java would always report sbt cache is not found, even if there had been no substantial change in the project - simply that the version number in version.sbt (the file used by sbt/sbt-release) had been incremented (as in guardian/play-secret-rotation@b215232).

This meant that turning on cache: sbt would actually slow the workflow considerably, as it would never benefit from the cache being present, and would always have to save it, which could take 2-3 minutes - even though it can't take advantage of the data it's saving.

As such, it would be great to exclude version.sbt files from the cache hash key.

Background: cache: sbt was originally introduced with #302 - cc @fmeriaux 🙇‍♂️

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@rtyley rtyley requested a review from a team as a code owner December 6, 2023 17:23
rtyley added a commit to guardian/gha-scala-library-release-workflow that referenced this pull request Dec 6, 2023
@fmeriaux
Copy link
Contributor

fmeriaux commented Dec 7, 2023

Interesting, perhaps it would be a good idea to have an action parameter that allows you to complete the pattern by default?

This would give us finer control over the specifics of our projects.

…ting it's own version

While working on https://github.com/guardian/gha-scala-library-release-workflow I noticed that no matter how many times I ran the workflow, `actions/setup-java` would always report `sbt cache is not found`, even if there had been no substantial change in the project - simply that `version.sbt` (the file used by https://github.com/sbt/sbt-release) had the version number in it incremented (as in guardian/play-secret-rotation@b215232).

This meant that turning on `cache: sbt` would actually slow the workflow considerably, as it would never benefit from the cache being present, and would always have to save it, which could take 2-3 minutes - even though it can't take advantage of the data it's saving.

As such, it would be great to exclude `version.sbt` files from the cache hash key.

Background: `cache: sbt` was orginally introduced with actions#302
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.

None yet

2 participants