What made this change?

Moderne
|
October 12, 2021
What made this change?
Contents

Key Takeaways

The Result model on OpenRewrite 7.16.0-SNAPSHOT now contains a lineage of recipes that made a change to any source file. The goal is to provide more context to developers when a recipe suggests a change to one of their source files, especially when that recipe is an amalgamation of many other recipes.

In creating organization-wide standards, a central team may create a recipe that itself isa composite of many other recipes. It was neither appropriate to show the lowest level recipe (i.e. a specific ChangeType) that made a change nor the overall composite that made a change since one is too narrow and the other too broad. The full lineage provides better context. Each and every one of these intermediate recipes can have description text that includes links to blog posts, videos, etc. explaining why the change is recommended. So the lineage serves an educational tool that broadens the developer’s understanding of why things are happening both in the small and large. 

In the below example we see that we are replacing @RunWith with @ExtendWith specifically, but that this is part of the JUnitJupiter migration which is in turn necessary for the upgrade to Spring Boot2.4, which is in turn necessary for the upgrade to Spring Boot 2.5, etc.

The lineage of a suggested change to JUnit tests.