You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gradle plugin always invalidates configuration cache on github actions, when ratchetFrom is set #2249
If you are submitting a bug, please include the following:
summary of problem
Gradle or Maven version
spotless version
operating system and version
copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace
Gradle: 8.10
Spotless gradle plugin: 7.0.0.BETA2
When the spotless gradle plugin is used, configuration cache on github actions using setup-gradle usually fails with the following message:
Calculating task graph as configuration cache cannot be reused because the file system entry '.git/refs/remotes/origin/.probe-8edb64c1-4909-420b-b493-b18d007910f4' has been removed.
Here is a sample repo where this can reproduce. You would run the .github/workflows/gradle.xml (can be dispatched manually or on pull request/push) action once to generate cache from the setup-gradle action which is invoked inside. A subsequent run should reuse configuration cache, but does not. When you remove ratchetFrom, clear github cache, and run the action twice, the configuration cache is reused.
changed the title [-]Gradle plugin always invalidates configuration cache on github actions, when `ratchetFrom` is set[/-][+]Gradle plugin always invalidates configuration cache on github actions[/+]on Sep 8, 2024
changed the title [-]Gradle plugin always invalidates configuration cache on github actions[/-][+]Gradle plugin always invalidates configuration cache on github actions, when ratchetFrom is set[/+]on Sep 9, 2024
Note, if the changes files are different, this job will not reuse configuration cache (as it should not). However, if changed files are the same, configuration cache is reused; and all other jobs (e.g. running tests) can skip spotless -x spotlessApply and reuse configuration cache.
I upgraded to 7.0.0.BETA4 and the issue still reproduces. I manually triggered the action once to generate cache, and trigger it again without any new commit, and it does not reuse the configuration cache. All other steps are FROM-CACHE.
I'm happy to close this issue though for the workaround I posted above. In the end it just makes CI build a bit slower, nothing too bad.
Calculating task graph as configuration cache cannot be reused because the file system entry '.git/refs/remotes/origin/.probe-8edb64c1-4909-420b-b493-b18d007910f4' has been removed.
Thanks for opening this issue. This is a strange message, and makes it hard to tell if this is a bug in Spotless or Gradle...
Activity
[-]Gradle plugin always invalidates configuration cache on github actions, when `ratchetFrom` is set[/-][+]Gradle plugin always invalidates configuration cache on github actions[/+][-]Gradle plugin always invalidates configuration cache on github actions[/-][+]Gradle plugin always invalidates configuration cache on github actions, when ratchetFrom is set[/+]lodgekeeper commentedon Oct 25, 2024
I dealt with this issue by turning off
ratchetFromfor CI:And then have a dedicated job to run static analysis (including spotless), with explicitly specified files:
Note, if the changes files are different, this job will not reuse configuration cache (as it should not). However, if changed files are the same, configuration cache is reused; and all other jobs (e.g. running tests) can skip spotless
-x spotlessApplyand reuse configuration cache.nedtwigg commentedon Oct 25, 2024
This may be fixed in
7.0.0.BETA4, please confirm if this is true.lodgekeeper commentedon Oct 26, 2024
I upgraded to
7.0.0.BETA4and the issue still reproduces. I manually triggered the action once to generate cache, and trigger it again without any new commit, and it does not reuse the configuration cache. All other steps areFROM-CACHE.I'm happy to close this issue though for the workaround I posted above. In the end it just makes CI build a bit slower, nothing too bad.
nedtwigg commentedon Oct 28, 2024
Thanks for opening this issue. This is a strange message, and makes it hard to tell if this is a bug in Spotless or Gradle...