openrewrite / rewrite-github-actions

OpenRewrite recipes for performing GitHub action hygiene and migration tasks.
Apache License 2.0
9 stars 9 forks source link

Fixed NPE when creating the recipe with RecipeIntrospectionUtils #88

Closed joanvr closed 11 months ago

joanvr commented 11 months ago

What's changed?

Moved the logic from the constructor where we were parsing the cron parameter to the getVisitor

What's your motivation?

With recent changes in https://github.com/openrewrite/rewrite/pull/3404, it's no longer valid to do some logic with parameters in the constructor, since they can be not set up yet (nulls) and injected later on by reflection.

Anyone you would like to review specifically?

Any additional context

Detected this error while running the org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0 recipe

Checklist

timtebeek commented 11 months ago

Looks like we both worked on this one, with slightly different approaches: https://github.com/openrewrite/rewrite-github-actions/pull/87 Let me know which one you'd like to continue with.

timtebeek commented 11 months ago

I like the test you added here; I think we'd need to also be sure we don't always use the default pattern, by also delaying the use of the file pattern as seen in my PR.

timtebeek commented 11 months ago

Fixes https://github.com/openrewrite/rewrite-spring/issues/391

timtebeek commented 11 months ago

Replaced with https://github.com/openrewrite/rewrite-github-actions/pull/87