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_8andDrupal9SetList::DRUPAL_9are still imported and applied, which is misleading and adds unnecessary processing. - A
mkdir()call at the top of the config works around a missingvendor/drupal/sitesdirectory 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
Drupal8SetListandDrupal9SetListimports and their entries inwithSets().
Add a Rector job in .gitlab-ci.yml so that deprecation checks run automatically on every pipeline.
Remaining tasks
- Remove the
mkdir()workaround fromrector.php. - Remove
Drupal8SetListandDrupal9SetListfromrector.php. - Add a Rector job to
.gitlab-ci.yml.
Issue fork subentity-3593876
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
Comment #4
macsim commentedComment #6
macsim commented