Add warning that Gradle configuration cache broken for spotlessCheck in latest v7.0.2
- Vorherrschende Sprache
- Java
- Sterne
- 5.6k
- Forks
- 559
- Ø Merge
- 1 T. 14 Std.
- Gemergte PRs (30 T.)
- 43
Beschreibung
the `spotlessCheck` task seems to (indirectly) use the file `.git/HEAD`, as switching between branches causes a gradle configuration cache miss.
EG:
```bash
> git checkout test-branch
> gradle spotlessCheck
… (stores configuration cache)
> git checkout main
> gradle spotlessCheck
Calculating task graph as configuration cache cannot be reused because file '.git/HEAD' has changed.
```
spotless is configured as follows in the root level `build.gradle.kts`
```kotlin
spotless.apply {
kotlin {
target("src/**/*.kt”)
ktlint(libs.versions.ktlint.get())
}
}
```
This seems to be caused by JGit. The configuration cache report has the class `org.eclipse.jgit.util.io.SilentFileInputStream` accessing `.git/HEAD` and `.git/config`. Although this is occurinig within JGit, perhaps theres a call to JGit that can be wrapped in a `ValueSource`? Or perhaps there’s a configuration to change/disable parts of spotless to fix this?
Beitragsleitfaden
Rechercherichtung
Reproduziere die Befehle zum Wechseln des Branches mit spotlessCheck und untersuche den Gradle-Konfiguration-Cache-Bericht. Beginne bei der Spotless-Konfiguration in build.gradle.kts auf Root-Ebene und verfolge dann den gemeldeten Zugriff von org.eclipse.jgit.util.io.SilentFileInputStream auf .git/HEAD und .git/config. Als erledigt gilt, dass die vom Issue angeforderte Warnung oder dokumentierte Einschränkung implementiert ist und das configuration-cache-Verhalten verifiziert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, java, kotlin
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100