Problem/Motivation
Rector can create patches for projects with code deprecations and it keeps getting better (by more rules being added to it). See https://www.palantir.net/blog/jumpstart-your-drupal-9-upgrade-drupal-rector
Most module maintainers are not aware of Rector and how it can help them get their code ready for the next major version of Drupal core. It's a huge time consuming task to manually run Rector on every module, every time Rector gets a new rule added.
Proposed resolution
Create a bot that runs on d.o to generate patches automatically and allow module maintainers communicate what kind and if they are interested in the bot's help.
When the bot that is running Rector finds code deprecation in a module:
- It will look for an existing issue with a specific name in that project (eg. "Code deprecations that can be fixed by Drupal Rector), if that issue does not exist - it will create a new issue for that project and the tag the issue with "RectorAutoPatchD9".
- If the finds the issue but it closed or the "RectorAutoPatchD9" patch has been removed it will skip the issue.
- It will add the latest patch (if it is different than the patch Rector created the last time it ran)
- If the issue is still set to 8.x, the patch can include adding `core_version_requirement` key in info.yml file of the module, if that line doesn't exist yet.
Module developers can edit that specific issue in order to control/communicate with the bot, for example, they can:
- Change the version of the issue (eg. from 8.x-1.x to 8.x-1.0) - for the bot to make a patch against a branch or a specific release.
- Change the status to "will not fix" (or another option), for the bot to stop sending patches on that issue.
- Remove or add back the "RectorAutoPatchD9" tag to trigger stopping/starting automated patches
This way we think it will create very little "noise" for module developers and will give them some control.
Comments
Comment #2
tedbow@shaal thanks for the creating this issue!
I think this is great idea. We talked about this at Florida DrupalCamp. Here are a couple other things we talked about that I think would help this plan(@shaal may or may not agree with these)
I think to minimize to push back from module maintainers it would be great if
I think these steps would help because a lot maintainers will be surprised by this automated patch especially if the maintain multiple modules and see the issues on all of them at once.
Comment #3
gábor hojtsyLinked in the palantir.net blog post.
Comment #4
tedbowI am working on sample issue that bot would create here #3127528: Rector Example issue
Comment #5
tedbowComment #6
drummSome previous discussion on bots in general - #2328093: Establish policies for external bots or tools that post or modify content on drupal.org
Comment #7
agentrickardThis was completed but the issue never closed.
Comment #8
agentrickard