Skip to content

[#2975] Registered the Drupal Rector set provider so the composer-based sets load. - #2979

Merged
AlexSkrypnyk merged 2 commits into
2.xfrom
feature/rector-set-provider
Aug 13, 2026
Merged

[#2975] Registered the Drupal Rector set provider so the composer-based sets load.#2979
AlexSkrypnyk merged 2 commits into
2.xfrom
feature/rector-set-provider

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Aug 13, 2026

Copy link
Copy Markdown
Member

Closes #2975

Summary

Follow-up to #2977. That pull request stopped Rector aborting on the removed PHPUnitSetList::PHPUNIT_90 constant, but the replacement it landed was incomplete: ->withComposerBased(drupal: TRUE) only enables the drupal set group, it does not supply the sets. The sets come from DrupalRector\Set\DrupalSetProvider, which has to be registered with ->withSetProviders(), exactly as the drupal-rector README documents.

With only withComposerBased(), Rector loads no Drupal rules at all and still exits 0, so lint passes while covering nothing. vendor/bin/rector list-rules reports 0 DrupalRector rules on the current 2.x and 98 with the provider registered. The failure mode is silent, which is why the merged pull request looked green.

Registering the provider loads the Drupal 11.0 to 11.4 sets for the installed drupal/core 11.4.5. That newly enables PhpUnitAddRunTestsInSeparateProcessesAttributeRector from the 11.4 set, which adds #[RunTestsInSeparateProcesses] to Kernel and Functional test classes, tracking Drupal core issue 3445240. The attribute and its import are applied to the example tests so Rector runs clean. Note that PHPUnit then runs each of those test classes in its own process, which drupal-rector flags as a change to test execution on PHPUnit 10 and 11, not only on Drupal 12.

Changes

  • Registered DrupalRector\Set\DrupalSetProvider via ->withSetProviders() in the root rector.php, alongside the existing ->withComposerBased(drupal: TRUE). Both calls are required: the provider supplies the sets, withComposerBased() enables the group.
  • Added #[RunTestsInSeparateProcesses] and its PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses import to the 8 example Kernel, Functional and FunctionalJavascript test classes under web/modules/custom/ and web/themes/custom/. Rector emits the attribute fully qualified because the config sets withImportNames(importNames: FALSE); the import is added by hand so the template's example code does not mix an imported Group attribute with a fully qualified one.
  • Regenerated the installer snapshot fixtures with composer update-snapshots, covering the rector.php baseline and the example test files across the scenario fixtures.

Before / After

BEFORE  (2.x after #2977)
┌───────────────────────────────────┐
│ rector.php                        │
│ ->withComposerBased(drupal: TRUE) │
└───────────────────────────────────┘
        │
        ▼
┌──────────────────────────────────────────────────┐
│ SetGroup::DRUPAL added to $setGroups             │
│ ...but no SetProvider is registered to supply it │
└──────────────────────────────────────────────────┘
        │
        ▼
┌──────────────────────────────────────────┐
│ rector list-rules | grep DrupalRector: 0 │
│ Rector exits 0 - lint green, no Drupal   │
│ deprecation coverage at all (silent)     │
└──────────────────────────────────────────┘

AFTER
┌────────────────────────────────────────────┐
│ rector.php                                 │
│ ->withSetProviders(DrupalSetProvider::class│
│ ->withComposerBased(drupal: TRUE)          │
└────────────────────────────────────────────┘
        │
        ▼
┌───────────────────────────────────────────────────┐
│ DrupalSetProvider supplies ComposerTriggeredSets, │
│ withComposerBased() enables the drupal group      │
└───────────────────────────────────────────────────┘
        │
        ▼
┌──────────────────────────────────────────┐
│ rector list-rules | grep DrupalRector: 98│
│ drupal/core 11.4.5 -> Drupal 11.0-11.4   │
│ sets plus matching breaking-change sets  │
└──────────────────────────────────────────┘
        │
        ▼
┌─────────────────────────────────────────────────┐
│ 11.4 set adds #[RunTestsInSeparateProcesses] to │
│ 8 example Kernel/Functional tests; Rector clean │
└─────────────────────────────────────────────────┘

Summary by CodeRabbit

  • Bug Fixes

    • Improved test isolation by running functional, JavaScript, and kernel tests in separate processes.
  • Refactor

    • Updated Drupal code-quality configuration to load version-specific rules more reliably.
    • Aligned analysis paths with supported document-root layouts.
    • Removed obsolete theme paths and outdated automation rules.
  • Style

    • Removed unnecessary code-quality suppression annotations.

…4 test attribute.

'withComposerBased(drupal: TRUE)' only enables the 'drupal' set group; the sets themselves come from 'DrupalRector\Set\DrupalSetProvider', which must be registered with 'withSetProviders()'. Without it Rector loaded no Drupal rules at all and still exited 0, so lint passed while silently covering nothing. 'rector list-rules' reports 98 'DrupalRector' rules with the provider registered and 0 without it.

Loading the Drupal 11 sets newly enables 'PhpUnitAddRunTestsInSeparateProcessesAttributeRector' from the 11.4 set, which adds '#[RunTestsInSeparateProcesses]' to Kernel and Functional test classes. The attribute and its import are applied to the example tests so Rector runs clean. PHPUnit runs each of those classes in its own process.
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4324400e-7ab9-4696-b48c-2bc33c2413c0

📥 Commits

Reviewing files that changed from the base of the PR and between ff7fd63 and a50e859.

📒 Files selected for processing (64)
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/tests/src/FunctionalJavascript/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_demo/tests/src/Kernel/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/_baseline/web/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/tests/src/FunctionalJavascript/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_demo/tests/src/Kernel/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_acquia/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/tests/src/FunctionalJavascript/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_demo/tests/src/Kernel/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/themes/custom/star_wars/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/hosting_project_name___acquia/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/tests/src/FunctionalJavascript/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/modules/custom/the_force_demo/tests/src/Kernel/CounterBlockTest.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/names/web/themes/custom/lightsaber/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/theme_claro/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/FunctionalJavascript/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/theme_custom/web/themes/custom/light_saber/tests/src/Kernel/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/theme_olivero/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/theme_stark/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_groups_no_be_lint/web/themes/custom/star_wars/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/web/themes/custom/star_wars/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_groups_no_be_tests/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_behat/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_behat_circleci/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_eslint_no_theme/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_phpcs/web/themes/custom/star_wars/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_phpcs_circleci/web/themes/custom/star_wars/tests/src/Functional/ExampleTest.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_phpunit/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_phpunit_circleci/rector.php
  • .vortex/cli/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/rector.php
  • rector.php
  • web/modules/custom/ys_base/tests/src/Functional/ExampleTest.php
  • web/modules/custom/ys_base/tests/src/FunctionalJavascript/ExampleTest.php
  • web/modules/custom/ys_base/tests/src/Kernel/ExampleTest.php
  • web/modules/custom/ys_demo/tests/src/FunctionalJavascript/CounterBlockTest.php
  • web/modules/custom/ys_demo/tests/src/Kernel/CounterBlockTest.php
  • web/themes/custom/your_site_theme/tests/src/Functional/ExampleTest.php
  • web/themes/custom/your_site_theme/tests/src/FunctionalJavascript/ExampleTest.php
  • web/themes/custom/your_site_theme/tests/src/Kernel/ExampleTest.php

Walkthrough

The pull request updates Drupal Rector configuration, adjusts fixture paths and rules, removes obsolete PHPCS suppressions, and applies PHPUnit process isolation to functional, functional JavaScript, and kernel test fixtures.

Changes

Rector configuration and fixture updates

Layer / File(s) Summary
Drupal Rector provider configuration
rector.php, .vortex/cli/tests/Fixtures/handler_process/_baseline/rector.php
Rector registers DrupalSetProvider before loading Drupal sets.
PHPUnit process isolation fixtures
.vortex/cli/tests/Fixtures/handler_process/**/tests/src/{Functional,FunctionalJavascript,Kernel}/*, web/modules/custom/**, web/themes/custom/**
Fixture test classes import and apply RunTestsInSeparateProcesses.
Fixture Rector path and rule updates
.vortex/cli/tests/Fixtures/handler_process/**/rector.php
Acquia fixtures use docroot paths. Other fixtures remove selected theme, Behat, and PHPUnit Rector rules.
PHPCS suppression cleanup
.vortex/cli/tests/Fixtures/handler_process/tools_*/*/ExampleTest.php
Obsolete PHPCS suppression annotations are removed from setUp() docblocks.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Mergeability Score: ⚪ Minimal · up to a50e8

The change enables the intended Drupal Rector rules and updates the affected example tests and fixtures; no actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested labels: A1

Poem

I’m a rabbit with tests in a row,
Each process now starts cleanly aglow.
Drupal sets find their provider,
Rector paths grow much tidier.
Hop, hop—green checks may flow! 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: registering the Drupal Rector set provider for composer-based sets.
Linked Issues check ✅ Passed The provider registration addresses issue #2975, and the related PHPUnit attribute changes and regenerated fixtures support the Rector fix.
Out of Scope Changes check ✅ Passed The changes are limited to Rector configuration and expected regenerated test and installer fixtures related to issue #2975.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/rector-set-provider

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (153/153)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

1 similar comment
@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (153/153)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.66%. Comparing base (ff7fd63) to head (a50e859).

Additional details and impacted files
@@           Coverage Diff           @@
##              2.x    #2979   +/-   ##
=======================================
  Coverage   87.66%   87.66%           
=======================================
  Files         104      104           
  Lines        5563     5563           
  Branches        3        3           
=======================================
  Hits         4877     4877           
  Misses        686      686           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6a7d25d15b22a2147ac4ca6c--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

@AlexSkrypnyk
AlexSkrypnyk merged commit 9d4356d into 2.x Aug 13, 2026
46 of 47 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/rector-set-provider branch August 13, 2026 02:16
@github-project-automation github-project-automation Bot moved this from BACKLOG to Release queue in Vortex 1.x Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

1 participant