Problem/Motivation
Currently the logic for the update bot still checks for the minimum deprecation lever before fixing with rector to know what the minimum version requirement is. This was all fine until now, unfortunately with new fixes on the horizon that are either 10.2+ or have no BC layer this is not ideal anymore.
Steps to reproduce
Find an module that has deprecations that have no BC rector, or are fixed after 10.1, the info.yam will then be updated to 10.2 or higher.
Proposed resolution
When rector runs we know what rector's have been run. We need to know/list the rector minimum core version so we know what version is the REAL minimum version.
A rector with DeprecationHelper: minimum version 10.1
A rector fixing a deprecation that is deprecated in 10.2 (like the test trait) without a BC layer: 10.2
Eventually a rector with php 8.3 fixes that are not BC: 10.3
etc
When rector runs it prints the used rector's in the output, this is parsable output:
Applied rectors:
* FunctionToServiceRector
* SomeOtherRector
I think we can build an 'inventory' of rectors and their minimum version. Perhaps best is only to add rectors that end up with a version that is not equal to the version it was deprecated in.
We could do this is in 2 ways:
Add a standarized tag to @changelog in the rectors, this would mean we could use those. But this would mean we still cannot support external rectors we might use (Twig, PHP, etc).
Otherwise it should just be a hashmap of rector names.
One thing to note and check is that a Rector printing only shows the Classname, no namespace. This means we should doublecheck if there is no overlap between the different Drupal version rectors.
Part of this can be autogenerated if you will. We could do something like finding all classes that extend AbstractDrupalCoreRector and those have minimum 10.1, but that is kinda flaky, so i would probably opt for a list.
Remaining tasks
- Decide on approach
- Check for collisions in class names
- refactor getMinimumCoreVersion in project_analysis.
- Create tests to make sure minimum version is done correctly
User interface changes
API changes
Data model changes