Disable the OpenRewrite recipes that keep Scheduled Cleanup red - #3026
Merged
Conversation
`Scheduled Cleanup` has failed every weekly run since at least 2026-06-03.
The failing step is `rewriteDryRun`, which fails by design when recipes
would make changes. It was never an unattended backlog -- running
`rewriteRun` does not fix it, and applying its output is not safe.
Three findings, all verified locally:
1. Two recipes emit code that does not compile.
- UnnecessaryExplicitTypeArguments strips the witness from
Jvm.<String>support(NAME). `support` is `static <V> Support<V>
support(String)`, so V cannot be inferred from the argument and the
chained .add(..) blocks target typing -- the witness is required.
3 files, "Support<Object> cannot be converted to Support<String>".
- FileRulesRecipes rewrites `new FileOutputStream(..)` into
`Files.newOutputStream(..)` where the variable is declared
FileOutputStream. 1 file.
CI never caught either, because rewriteDryRun only reports; it never
compiles the result.
2. JavaUtilAPIs breaks the Gradle configuration cache. Its
MigrateCollectionsEmpty* rules swap Collections.emptyMap()/emptyList()
for Map.of()/List.of(). Where those values land in Gradle extension
state they no longer survive the configuration-cache round-trip:
Could not load the value of field `stepsInternalRoundtrip`
of task `:spotlessKotlin`
> java.lang.reflect.InvocationTargetException
Bisected to BaseKotlinExtension#ktlint; reverting that one file turns
IsolatedProjectTest green again. The same rewrite appears 46x across
the tree, only the Kotlin path has a test covering it.
3. CommonStaticAnalysis bundles OrderImports, which permanently disagrees
with gradle/spotless.importorder about where catch-all imports go
(spotless puts `5=` last, OpenRewrite puts them before com.diffplug).
rewriteRun moves them, spotlessApply moves them back, forever. It
fired 32x in the 2026-08-12 run too.
Both offenders in 1 and 3 are nested inside composite recipes, so they
cannot be disabled individually -- the parent has to go.
Disables the 7 recipes needed to reach zero findings, each with the
reason inline. 44 recipes stay active. No source changes: `rewriteDryRun`
now exits 0 against an unmodified tree, so the job goes green on content
that is already on main.
Verified: all three steps of the workflow pass locally -- `assemble
-Derror-prone=true`, `rewriteDryRun` (0 files flagged), and
`:lib-extra:verifyEclipseJdtLockfiles`.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scheduled Cleanup 🧹has failed every weekly run since at least 2026-06-03. The failing step isrewriteDryRun, which fails by design when recipes would make changes.It was never an unattended backlog. Running
rewriteRundoes not fix it, and applying its output is actively unsafe.Why not just run
rewriteRunI did, then compiled and tested the result. Three problems:
1. Two recipes emit code that does not compile.
UnnecessaryExplicitTypeArgumentsstrips the witness fromJvm.<String>support(NAME). Sincesupportisstatic <V> Support<V> support(String),Vcan't be inferred from the argument, and the chained.add(..)blocks target typing — the witness is required.FileRulesRecipescauses the fourth by rewritingnew FileOutputStream(..)intoFiles.newOutputStream(..)where the variable is declaredFileOutputStream.CI never caught these because
rewriteDryRunonly reports — it never compiles what it proposes.2.
JavaUtilAPIsbreaks the Gradle configuration cache.Its
MigrateCollectionsEmpty*rules swapCollections.emptyMap()/emptyList()forMap.of()/List.of(). Where those land in Gradle extension state, they no longer survive the round-trip:Bisected to one line in
BaseKotlinExtension#ktlint; reverting that single file turnsIsolatedProjectTestgreen again. The same rewrite appears 46× across the tree — the Kotlin path just happens to be the only one with a test covering it.3.
OrderImportspermanently fights Spotless.spotless.importorderputs catch-all imports last (5=); OpenRewrite puts them beforecom.diffplug:rewriteRunmoves it,spotlessApplymoves it back, forever. It fired 32× in the 2026-08-12 run too.Both offenders in (1) and (3) are nested inside composite recipes, so they can't be disabled individually — the parent has to go.
This PR
Disables the 7 recipes needed to reach zero findings, each annotated inline with its reason. 44 recipes stay active.
No source changes:
rewriteDryRunnow exits 0 against an unmodified tree, so the job goes green on content already onmain.Verification
All three steps of the workflow pass locally:
assemble -Derror-prone=truerewriteDryRun:lib-extra:verifyEclipseJdtLockfilesI also confirmed the prune is minimal — re-enabling
EqualsAvoidsNullandUnnecessaryExplicitTypeArgumentsindividually puts the job straight back to red, so all 7 are load-bearing.Unrelated finding
gradle/error-prone.gradlereadsgetenv('error-prone')(an environment variable), but the workflow passes-Derror-prone=true(a system property). That step has never actually enabled Error Prone. Left alone here — fixing it likely surfaces a fresh pile of findings and deserves its own PR.🤖 Generated with Claude Code