From e9d6a980b841ce800313999c9e150ef1eab65bec Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Thu, 20 Aug 2026 08:12:33 -0700 Subject: [PATCH] chore: disable the OpenRewrite recipes that keep Scheduled Cleanup red `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.support(NAME). `support` is `static Support support(String)`, so V cannot be inferred from the argument and the chained .add(..) blocks target typing -- the witness is required. 3 files, "Support cannot be converted to Support". - 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) --- rewrite.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rewrite.yml b/rewrite.yml index aceb5d76be..6c43d58671 100644 --- a/rewrite.yml +++ b/rewrite.yml @@ -14,15 +14,15 @@ recipeList: - org.openrewrite.java.migrate.UpgradeToJava17 - org.openrewrite.java.migrate.lang.StringRulesRecipes - org.openrewrite.java.migrate.util.JavaLangAPIs - - org.openrewrite.java.migrate.util.JavaUtilAPIs + # - org.openrewrite.java.migrate.util.JavaUtilAPIs # MigrateCollectionsEmpty* swaps Collections.emptyList/Map/Set for List/Map/Set.of; Gradle's configuration cache cannot round-trip those, which breaks IsolatedProjectTest - org.openrewrite.java.migrate.util.MigrateInflaterDeflaterToClose - org.openrewrite.java.migrate.util.ReplaceStreamCollectWithToList - org.openrewrite.java.migrate.util.SequencedCollection - org.openrewrite.java.recipes.JavaRecipeBestPractices - org.openrewrite.java.recipes.RecipeTestingBestPractices - org.openrewrite.staticanalysis.BufferedWriterCreationRecipes - - org.openrewrite.staticanalysis.CommonStaticAnalysis - - org.openrewrite.staticanalysis.EqualsAvoidsNull + # - org.openrewrite.staticanalysis.CommonStaticAnalysis # bundles OrderImports, which permanently disagrees with gradle/spotless.importorder (each tool undoes the other) + # - org.openrewrite.staticanalysis.EqualsAvoidsNull # wants to flip x.equals("literal") to "literal".equals(x) repo-wide; not worth the churn - org.openrewrite.staticanalysis.JavaApiBestPractices - org.openrewrite.staticanalysis.LowercasePackage - org.openrewrite.staticanalysis.MissingOverrideAnnotation @@ -36,16 +36,16 @@ recipeList: - org.openrewrite.staticanalysis.SimplifyTernaryRecipes - org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes - org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources - - org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments + # - org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments # strips the required witness from Jvm.support(..), producing code that does not compile - org.openrewrite.staticanalysis.UnnecessaryParentheses - org.openrewrite.staticanalysis.UnnecessaryReturnAsLastStatement - tech.picnic.errorprone.refasterrules.BigDecimalRulesRecipes - - tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes + # - tech.picnic.errorprone.refasterrules.CharSequenceRulesRecipes # length() == 0 -> isEmpty(); not worth the churn - tech.picnic.errorprone.refasterrules.ClassRulesRecipes # tech.picnic.errorprone.refasterrules.CollectionRulesRecipes # needs UpgradeToJava21 - tech.picnic.errorprone.refasterrules.ComparatorRulesRecipes - tech.picnic.errorprone.refasterrules.EqualityRulesRecipes - - tech.picnic.errorprone.refasterrules.FileRulesRecipes + # - tech.picnic.errorprone.refasterrules.FileRulesRecipes # FilesNewOutputStreamToPath rewrites new FileOutputStream(..) to Files.newOutputStream(..), which does not compile where the variable is declared FileOutputStream - tech.picnic.errorprone.refasterrules.MapRulesRecipes - tech.picnic.errorprone.refasterrules.MicrometerRulesRecipes - tech.picnic.errorprone.refasterrules.MockitoRulesRecipes @@ -55,6 +55,6 @@ recipeList: - tech.picnic.errorprone.refasterrules.PreconditionsRulesRecipes - tech.picnic.errorprone.refasterrules.PrimitiveRulesRecipes - tech.picnic.errorprone.refasterrules.StreamRulesRecipes - - tech.picnic.errorprone.refasterrules.StringRulesRecipes + # - tech.picnic.errorprone.refasterrules.StringRulesRecipes # String.format -> "..".formatted and friends; not worth the churn - tech.picnic.errorprone.refasterrules.TimeRulesRecipes ---