Closed mike-solomon closed 8 months ago
While this would hide the bellwether (good) is would be better to show the configured precondition in the bellwether. So right now what we show is:
All the issues of the next section + showing internal class bellwether.
No bellwether (good), no precondition (missed opportunity, it's in the bellwether), no arguments to AddSpringProperty, (leading to a broken yaml recipe)
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.spring.boot3.EnableVirtualThreads
displayName: Enable Virtual Threads on Java 21
description: Set `spring.threads.virtual.enabled` to `true` in `application.properties` or `application.yml`.
recipeList:
- org.openrewrite.java.spring.AddSpringProperty
As per the source
type: specs.openrewrite.org/v1beta/recipe
name: org.openrewrite.java.spring.boot3.EnableVirtualThreads
displayName: Enable Virtual Threads on Java 21
description: Set `spring.threads.virtual.enabled` to `true` in `application.properties` or `application.yml`.
preconditions:
- org.openrewrite.java.search.HasJavaVersion:
version: 21.X
recipeList:
- org.openrewrite.java.spring.AddSpringProperty:
property: spring.threads.virtual.enabled
value: true
This is an improvement already, but still shows broken config to the user in that recipe list tab. We can still merge this already though, but adding that context.
Ah I see -- thanks for clarifying again. I'm going to close this PR as it doesn't really do what we want.
Agh my bad @timtebeek didn't see your follow up comment before closing haha. I'm gonna poke around with it a bit more first and may reopen if I can't find anything.
After stepping through the debugger, I don't believe we currently have access to be able to output the preconditions or see anything beyond what we currently have. It's possible I missed something, but I couldn't find HasJavaVersion
anywhere in the EnableVirtualThreads
recipe in the debugger.
I think we would need to update rewrite itself and change the RecipeDescriptor class to include a preconditions variable or something.
I'll go ahead and reopen this PR as it feels like it's worthwhile to merge in as is.
Related to issue: https://github.com/openrewrite/rewrite-docs/issues/250
You can see there is no bellwether in the yaml recipe list generated: