Problem/Motivation

Two separate problems in the Rector setup:

1. Rector is not executed in the CI. The .gitlab-ci.yml does not include a Rector job, so
automated deprecation checks never run and regressions can be introduced silently.

2. The rector.php config is outdated and contains a workaround that does not belong there.

  • The module requires drupal/core: ^10 || ^11, meaning Drupal 8 and 9 are already unsupported. Drupal8SetList::DRUPAL_8 and Drupal9SetList::DRUPAL_9 are still imported and applied, which is misleading and adds unnecessary processing.
  • A mkdir() call at the top of the config works around a missing vendor/drupal/sites directory in some environments. This kind of side effect does not belong in a Rector config file.
// Should be removed — Drupal 8 and 9 are not supported.
use DrupalRector\Set\Drupal8SetList;
use DrupalRector\Set\Drupal9SetList;

// Should be removed — environment workaround, not Rector config.
if (!(is_dir(__DIR__ . '/vendor/drupal/sites'))) {
  mkdir(__DIR__ . '/vendor/drupal/sites');
}

return RectorConfig::configure()
  ->withSets([
    Drupal8SetList::DRUPAL_8,  // Should be removed.
    Drupal9SetList::DRUPAL_9,  // Should be removed.
    Drupal10SetList::DRUPAL_10,
  ]);

Proposed resolution

Clean up rector.php:

  • Remove the mkdir() call.
  • Remove the Drupal8SetList and Drupal9SetList imports and their entries in withSets().

Add a Rector job in .gitlab-ci.yml so that deprecation checks run automatically on every pipeline.

Remaining tasks

  • Remove the mkdir() workaround from rector.php.
  • Remove Drupal8SetList and Drupal9SetList from rector.php.
  • Add a Rector job to .gitlab-ci.yml.

Issue fork subentity-3593876

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

macsim created an issue. See original summary.

  • maxpah committed c8c8b87f on 3.x authored by macsim
    task: #3593876 Execute rector in the CI + remove drupal 8/9 support and...
macsim’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

macsim’s picture

Status: Fixed » Closed (fixed)