The Project Update bot should set '^8.7.7 || ^9' or '^8.8 || ^9' for core_version_requirment

Created on 26 May 2020, almost 5 years ago
Updated 10 July 2023, almost 2 years ago

Problem/Motivation

Since the bot is fixing deprecations it will produce patches that are not compatible with all version of Drupal 8.
The bot only updates info.yml if upgrade_status ran successfully and it reports no problems except the info.yml file itself.

Currently if no core_version_requirement is set it will set core_version_requirement: ^8 || ^9

If core_version_requirement is already set in the module then it will test if
if (!Semver::satisfies('9.0.0', $info['core_version_requirement'])) {
and only then add || ^9 to the end.

Proposed resolution

There are a few options.

  1. If the bot only makes changes to the info.yml file to add core_version_requirement: ^8 || ^9 this means a) no deprecations replacements were needed and b) core_version_requirement was not set.

    In this case it may be acceptable to continue to use core_version_requirement: ^8 || ^9 because this would change nothing as far compatibility for Drupal 8 since it is making no php changes.

  2. If the bot makes changes to any php code and the info.yml file it could set core_version_requirement: ^8.8 || ^9 or core_version_requirement: ^8.7.7 || ^9.

    Currently there is no way to tell via drupal-rector and upgrade_status which version of Drupal the changes make the module compatible with. Setting core_version_requirement: ^8.8 || ^9 would be the safest as there should be no deprecations after 8.8. Drupal 8.7 is also only supported for 2 more weeks though it will probably be used for much longer.

  3. The bot could possibly figure out which version of Drupal the module would be compatible with by running Drupal-rector multiple time with different rector.yml files.

    The deprecations are set in different yml files https://github.com/palantirnet/drupal-rector/tree/master/config/drupal-8

    To do this the bot would

    1. Run drupal-rector once including drupal-8.0-deprecations.yml to drupal-8.7-deprecations.yml
    2. Run drupal-rector once including only drupal-8.8-deprecations.yml

    If run 1 made changes but run 2 did not it could use core_version_requirement: ^8.7.7 || ^9
    If run 2 made changes regardless of whether run 1 made changes or not it would set core_version_requirement: ^8.8 || ^9

    The major downside of this would be that it probably would take longer running rector 2x. It might not take 2x as long though because it run less rectors the each time.

Remaining tasks

Figure out best solution

User interface changes

API changes

Data model changes

Release notes snippet

๐Ÿ“Œ Task
Status

Fixed

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024