Skip to content

[#2399] Added Behat attribute set to Rector configuration.#2416

Merged
AlexSkrypnyk merged 4 commits intomainfrom
feature/2399-behat-attributes
Mar 24, 2026
Merged

[#2399] Added Behat attribute set to Rector configuration.#2416
AlexSkrypnyk merged 4 commits intomainfrom
feature/2399-behat-attributes

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Member

@AlexSkrypnyk AlexSkrypnyk commented Mar 24, 2026

Closes #2399

Summary

Added ->withAttributesSets(behat: TRUE) to the Rector configuration in rector.php so that Behat annotations are automatically converted to PHP 8 attributes during static analysis runs. Updated test fixture snapshots to reflect the new configuration line being present in the baseline and absent in scenarios where Behat is not installed.

Changes

Rector configuration (rector.php)

  • Added ->withAttributesSets(behat: TRUE) call after ->withPhpSets(php84: TRUE) with a descriptive comment explaining its purpose.

Test fixture snapshots (.vortex/installer/tests/Fixtures/handler_process/)

  • _baseline/rector.php — updated snapshot to include the new withAttributesSets(behat: TRUE) line.
  • tools_groups_no_be_tests/rector.php — updated diff snapshot: line number offsets corrected and the Behat attribute line is shown as removed (Behat not present in this scenario).
  • tools_groups_no_be_tests_circleci/rector.php — same corrections as tools_groups_no_be_tests.
  • tools_no_behat/rector.php — new fixture file showing the Behat attribute line removed when Behat is not selected.
  • tools_no_behat_circleci/rector.php — new fixture file mirroring tools_no_behat for the CircleCI variant.
  • tools_no_phpunit/rector.php — corrected diff line number offsets (no content change, offsets shifted due to the new line).
  • tools_no_phpunit_circleci/rector.php — same offset correction as tools_no_phpunit.

Before / After

Before                                    After
──────────────────────────────────────    ──────────────────────────────────────
rector.php                                rector.php
  ->withPhpSets(php84: TRUE)                ->withPhpSets(php84: TRUE)
  // Code quality improvement sets.         // Behat attribute sets - converts
  ->withPreparedSets(                         annotations to PHP 8 attributes.
    codeQuality: TRUE,                      ->withAttributesSets(behat: TRUE)
    ...                                     // Code quality improvement sets.
  )                                         ->withPreparedSets(
                                              codeQuality: TRUE,
                                              ...
                                            )

Fixture snapshots                         Fixture snapshots
  _baseline: no behat attribute line        _baseline: includes behat line
  tools_no_behat: fixture missing           tools_no_behat: new fixture added
  line offsets: stale numbers               line offsets: corrected to match

Summary by CodeRabbit

  • Chores
    • Updated development tooling configuration to extend the code-transformation pipeline with Behat attribute set conversions; no other configuration entries or public code were changed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9b51a6ce-a123-4fd7-9a00-cd204d760084

📥 Commits

Reviewing files that changed from the base of the PR and between 4447b4b and 349a4d2.

⛔ Files ignored due to path filters (4)
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/rector.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/rector.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_behat/rector.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/rector.php is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (1)
  • rector.php

Walkthrough

Updates the Rector configuration by appending ->withAttributesSets(behat: TRUE) (wrapped in Behat tool boundary comments) to enable Behat-specific attribute set transformations in the Rector run.

Changes

Cohort / File(s) Summary
Rector configuration
rector.php
Appends ->withAttributesSets(behat: TRUE) to the Rector config chain and surrounds it with #;< TOOL_BEHAT / #;> TOOL_BEHAT boundary comments; no other config keys were modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A hop, a tweak, one tiny plea,
Rector hums — attributes, whee!
Behat steps now wear new hats,
I nibble bugs and munch on stats. 🥕✨

🚥 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 accurately describes the main change: adding the Behat attribute set to Rector configuration, matching the changeset which adds ->withAttributesSets(behat: TRUE) to rector.php.
Linked Issues check ✅ Passed The PR implements the core requirement from issue #2399: adding ->withAttributesSets(behat: TRUE) to the Rector configuration and updating related fixtures/snapshots as documented.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #2399 objectives: the rector.php configuration addition and snapshot fixture updates for test fixtures. No unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/2399-behat-attributes

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.93%. Comparing base (df6a257) to head (349a4d2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2416      +/-   ##
==========================================
- Coverage   79.42%   78.93%   -0.49%     
==========================================
  Files         126      119       -7     
  Lines        6730     6571     -159     
  Branches       44        0      -44     
==========================================
- Hits         5345     5187     -158     
+ Misses       1385     1384       -1     

☔ View full report in Codecov by Sentry.
📢 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

This comment has been minimized.

@github-actions
Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)
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.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk
Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

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

@AlexSkrypnyk AlexSkrypnyk merged commit 271488b into main Mar 24, 2026
36 of 37 checks passed
@AlexSkrypnyk AlexSkrypnyk added this to the 1.38.0 milestone Mar 24, 2026
@AlexSkrypnyk AlexSkrypnyk deleted the feature/2399-behat-attributes branch March 24, 2026 12:12
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Mar 24, 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.

Enforce attributes for step definition and hook in Behat contexts

1 participant