Skip to content

Updated Drupal dependencies and held 'rector/rector' at 2.6.2. - #321

Merged
AlexSkrypnyk merged 5 commits into
developfrom
feature/drupal-updates-2026-08-31
Aug 31, 2026
Merged

Updated Drupal dependencies and held 'rector/rector' at 2.6.2.#321
AlexSkrypnyk merged 5 commits into
developfrom
feature/drupal-updates-2026-08-31

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Aug 31, 2026

Copy link
Copy Markdown
Member

Checklist before requesting a review

  • Subject includes ticket number as [#123] Verb in past tense.
  • Ticket number #123 added to description
  • Added context in Changed section
  • Self-reviewed code and commented in commented complex areas.
  • Added tests for fix/feature.
  • Relevant tests run and passed locally.

Changed

  1. Updated Drupal core's transitive Symfony and Guzzle stack; core itself stays on 11.4.5 because no new core release was available, moving 43 packages in total (39 patch, 4 minor), with none added or removed and zero composer audit advisories.
  2. Updated 8 Drupal contrib modules, all patch-level: drupal/ai 1.4.6 to 1.4.7, drupal/ai_provider_openai 1.2.4 to 1.2.5, drupal/drupal_helpers 2.1.0 to 2.1.1, drupal/generated_content 2.1.0 to 2.1.1, drupal/key_auth 2.2.0 to 2.2.3, drupal/layout_builder_restrictions 3.0.5 to 3.0.6, drupal/preview_link 2.2.1 to 2.2.3, and drupal/testmode 2.7.1 to 2.7.2; no patches needed re-rolling.
  3. Held rector/rector at 2.6.2 and excluded it from this round. Its ^2.6.2 constraint is deliberately left unpinned, so the newer release stays permitted and a later round can take it without further change.
  4. Applied two IfToNullCoalescingAssignRector cleanups from the codeQuality prepared set, converting isset guards to ??= in tests/phpunit/Drupal/SettingsTestCase.php (three guards) and web/modules/custom/do_generated_content/src/Generator/VocabularyTermsTrait.php (one lazy-cache guard). Both rewrites are semantically identical: isset() is false exactly when a key is absent or NULL, which is precisely when ??= assigns, and ??= still short-circuits so the taxonomy term lookup runs only on a cache miss.

Why rector/rector is held back

rector 2.6.5 turns RectorConfigBuilder::withSetProviders() into a deprecated no-op, and nothing in that release constructs SetProviderCollector any more. Its documented replacement, withComposerBased(drupal: true), is inert against the installed palantirnet/drupal-rector: the call is guarded on class_exists('DrupalRector\Set\DrupalSetList'), and that package ships only DrupalSetProvider and the per-version Drupal11SetList.

With both paths dead, this project's Drupal deprecation rule sets would load from nowhere while ahoy lint still reported green - a silent loss of coverage rather than a visible failure. Staying on 2.6.2 keeps rector.php working exactly as written and keeps it out of this diff entirely. When drupal-rector ships DrupalSetList::COMPOSER_BASED, a later update round can take 2.6.5 with no configuration change.

Full dependency changelog (43 packages)

Screenshots

N/A

Before / After

┌──────────────────────────────────────────────────────────────┐
│ BEFORE - rector 2.6.2, rector.php loads the Drupal sets      │
└──────────────────────────────────────────────────────────────┘
     withSetProviders(DrupalSetProvider::class)
     withComposerBased(drupal: TRUE)
                    │
                    ▼
        6 sets loaded (11.0-11.4 + bootstrap)
                    │
                    ▼
        ahoy lint checks Drupal deprecations


┌──────────────────────────────────────────────────────────────┐
│ REJECTED - taking rector 2.6.5 in this round                 │
└──────────────────────────────────────────────────────────────┘
     withSetProviders(...)          <- deprecated no-op
     withComposerBased(drupal:)     <- inert, no DrupalSetList class
                    │
                    ▼
        0 sets loaded, silently
                    │
                    ▼
        ahoy lint still green, checking nothing Drupal-specific


┌──────────────────────────────────────────────────────────────┐
│ AFTER - rector held at 2.6.2, config untouched               │
└──────────────────────────────────────────────────────────────┘
     composer.json: "rector/rector": "^2.6.2"   (unpinned)
     composer.lock: 2.6.2
     rector.php:    unchanged, not in this diff
                    │
                    ▼
        6 sets still loaded (11.0-11.4 + bootstrap)
                    │
                    ▼
        ahoy lint checks Drupal deprecations

@AlexSkrypnyk AlexSkrypnyk added the AUTOMERGE Pull request has been approved and set to automerge label Aug 31, 2026
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 07fa6492-c0f0-4c32-ade0-a7abf5115ec8

📥 Commits

Reviewing files that changed from the base of the PR and between fd4be53 and e686b38.

⛔ Files ignored due to path filters (1)
  • composer.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • composer.json

Included review availability: 8 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.


📝 Walkthrough

Walkthrough

The change updates Composer dependency constraints and replaces equivalent conditional assignments with PHP null-coalescing assignment in test environment setup and vocabulary-term caching.

Changes

Maintenance updates

Layer / File(s) Summary
Dependency constraint updates
composer.json
Runtime and development dependency constraints were updated for Drupal packages, the OpenAI provider, Symfony HTTP client, PHPStan, and Twig CS Fixer.
Default assignment cleanup
tests/phpunit/Drupal/SettingsTestCase.php, web/modules/custom/do_generated_content/src/Generator/VocabularyTermsTrait.php
Equivalent conditional assignments now use null-coalescing assignment while preserving default values and cache behavior.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to e686b

The PR updates dependencies, restores Drupal deprecation checks, and applies localized equivalent syntax fixes; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the dependency updates and the Rector version constraint. It is concise and directly related to the main changes.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/drupal-updates-2026-08-31

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

@github-actions

This comment has been minimized.

@codecov-commenter

codecov-commenter commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.56%. Comparing base (dd805cd) to head (e686b38).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #321   +/-   ##
========================================
  Coverage    86.56%   86.56%           
========================================
  Files           28       28           
  Lines          655      655           
========================================
  Hits           567      567           
  Misses          88       88           

☔ 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.

@AlexSkrypnyk AlexSkrypnyk added Needs review Pull request needs a review from assigned developers and removed AUTOMERGE Pull request has been approved and set to automerge labels Aug 31, 2026
Comment thread composer.json
"drevops/vortex-tooling": "~1.4.0",
"drupal/ai_image_alt_text": "^1.0.2",
"drupal/ai_provider_openai": "^1.2.4",
"drupal/ai_provider_openai": "^1.2.5",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Routine maintenance round - no security releases. composer audit --locked returns zero advisories against the resulting lock, and drupal.org's contrib advisories list none for any project updated here.

None of these nine constraint changes were hand-edited. This repo sets "bump-after-update": true under config (line 140), so Composer raises each direct dependency's floor to whatever the update resolved. That is why the constraints move in lockstep with the lock file and why the diff carries no deliberate version decisions to review.

One package was deliberately excluded: rector/rector stays on 2.6.2. Its ^2.6.2 constraint is visible here as unchanged context, and it is intentionally left as a range rather than pinned - the newer release is still permitted, this round simply does not take it. The reason is that rector 2.6.5 turns RectorConfigBuilder::withSetProviders() into a deprecated no-op, and its documented replacement withComposerBased(drupal: true) is inert against the installed palantirnet/drupal-rector, which ships no DrupalSetList class. Taking that release would leave this project's Drupal deprecation rule sets loading from nowhere while ahoy lint still reported green - a silent loss of coverage. Holding at 2.6.2 keeps rector.php working as written and out of this diff entirely. Once drupal-rector ships DrupalSetList::COMPOSER_BASED, a later round can take 2.6.5 without any configuration change.

vincentlanglet/twig-cs-fixer ^4.0.2^4.1.0 is the only minor bump among the direct dependencies. It added no findings against this codebase; ahoy lint is clean.

The remaining eight are patch-level floor raises on drupal/ai_provider_openai, drupal/drupal_helpers, drupal/generated_content, drupal/key_auth, drupal/preview_link, drupal/testmode, symfony/http-client and phpstan/phpstan. No package was added or removed, no major version moved, and nothing here changes configuration or database schema, so the deployment needs no config import or update hook beyond the usual.

drupal/core itself stays on 11.4.5 - no newer release existed at the time of this run - so the core phase of the update moved only core's transitive Symfony and Guzzle stack, visible in composer.lock rather than here.

if (!isset($vars['TMP'])) {
$vars['TMP'] = NULL;
}
$vars['TMP'] ??= NULL;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A standalone readability cleanup, applied by ahoy lint-fix rather than hand-edited. It was surfaced by IfToNullCoalescingAssignRector, from the codeQuality prepared set rector.php already enables. rector/rector itself is held at 2.6.2 in this PR and is not part of the update, so nothing in the diff requires this change - it is kept because it is correct and reads better, and ahoy lint is green with or without it.

The rewrite is exact rather than merely equivalent-looking. isset() is false when a key is absent or holds NULL, and ??= assigns under precisely those two conditions, so if (!isset($vars['TMP'])) { $vars['TMP'] = NULL; } and $vars['TMP'] ??= NULL; do the same thing.

Worth stating plainly because $vars['TMP'] ??= NULL reads like a no-op: it is not. Assigning NULL to an absent key creates that key, and setEnvVars() relies on a present-but-NULL entry as the sentinel that unsets the real environment variable further down. The surviving comments still describe that intent correctly. If someone later "simplifies" these three lines away as pointless, the tests stop isolating themselves from the host environment.

ahoy test-unit passes - 367 tests, 1125 assertions - which exercises this base class across the settings test suite.

if (!isset($this->vocabularyTermsCache[$vid])) {
$this->vocabularyTermsCache[$vid] = array_values($this->entityTypeManager->getStorage('taxonomy_term')->loadByProperties(['vid' => $vid]));
}
$this->vocabularyTermsCache[$vid] ??= array_values($this->entityTypeManager->getStorage('taxonomy_term')->loadByProperties(['vid' => $vid]));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same standalone cleanup as in tests/phpunit/Drupal/SettingsTestCase.php, applied by ahoy lint-fix via IfToNullCoalescingAssignRector from the codeQuality prepared set. rector/rector is held at 2.6.2 in this PR, so this is not a consequence of a dependency change - no behaviour change was intended and none was made.

The one thing worth checking on this file specifically is that the lazy cache stays lazy. ??= short-circuits - the right-hand side is not evaluated when the left-hand side is already set - so loadByProperties() still runs only on a cache miss, exactly as the isset() guard arranged. Had this been rewritten to ?: or an unconditional assignment it would have turned a cached lookup into a storage query per call, on a trait used across the generated-content generators.

The array_values() wrapper is retained, so the "in storage order" contract in the docblock above still holds.

@AlexSkrypnyk AlexSkrypnyk changed the title Updated Drupal dependencies and restored Drupal deprecation sets in 'rector.php'. Updated Drupal dependencies and held 'rector/rector' at 2.6.2. Aug 31, 2026
@AlexSkrypnyk
AlexSkrypnyk enabled auto-merge (squash) August 31, 2026 02:46
@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 80%)

  Classes: 51.85% (14/27)
  Methods: 77.17% (71/92)
  Lines:   89.13% (754/846)
Per-class coverage
Drupal\do_ai_alt_text\AltTextGenerator
  Methods:  85.71% ( 6/ 7)   Lines:  98.72% ( 77/ 78)
Drupal\do_ai_alt_text\Plugin\Action\RegenerateImageAltText
  Methods: 100.00% ( 8/ 8)   Lines: 100.00% ( 63/ 63)
Drupal\do_base\EventSubscriber\PreviewLinkCacheSubscriber
  Methods:  33.33% ( 1/ 3)   Lines:  11.11% (  1/  9)
Drupal\do_base\EventSubscriber\ThemeColorSubscriber
  Methods:  66.67% ( 2/ 3)   Lines:  40.00% (  4/ 10)
Drupal\do_base\Hook\AutomatedListPagerHook
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 31/ 31)
Drupal\do_base\Hook\LibraryInfoAlterHook
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% (  9/  9)
Drupal\do_base\Hook\MetatagsAlterHook
  Methods: 100.00% ( 7/ 7)   Lines: 100.00% ( 58/ 58)
Drupal\do_base\Hook\PageAttachmentsHook
  Methods:  87.50% ( 7/ 8)   Lines:  94.92% ( 56/ 59)
Drupal\do_base\NavigationScriptHash
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 27/ 27)
Drupal\do_base\Twig\ImageDimensionsExtension
  Methods:  40.00% ( 2/ 5)   Lines:  81.48% ( 44/ 54)
Drupal\do_content_api\EventSubscriber\JsonApiWriteGateSubscriber
  Methods:  66.67% ( 2/ 3)   Lines:  88.89% (  8/  9)
Drupal\do_content_api\Hook\EntityCreateAccessHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 12/ 12)
Drupal\do_content_api\Hook\ModerationPolicyHook
  Methods:  50.00% ( 1/ 2)   Lines:  93.75% ( 15/ 16)
Drupal\do_content_api\Routing\RouteSubscriber
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  6/  6)
Drupal\do_feed\FeedUrlBuilder
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 18/ 18)
Drupal\do_feed\Form\FeedSettingsForm
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 15/ 15)
Drupal\do_feed\Hook\EntityDeleteHook
  Methods:  50.00% ( 1/ 2)   Lines:  92.31% ( 12/ 13)
Drupal\do_feed\Hook\EntityPresaveHook
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 54/ 54)
Drupal\do_feed\Hook\PreprocessParagraphHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 14/ 14)
Drupal\do_feed\Hook\PreprocessViewsViewRowRssHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
Drupal\do_feed\Hook\ViewsPreViewHook
  Methods:  50.00% ( 1/ 2)   Lines:  96.43% ( 27/ 28)
Drupal\do_generated_content\Generator\CaseMatrix
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 12/ 12)
Drupal\do_generated_content\Generator\RelativeDate
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)

@AlexSkrypnyk
AlexSkrypnyk merged commit 4f6016d into develop Aug 31, 2026
11 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/drupal-updates-2026-08-31 branch August 31, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs review Pull request needs a review from assigned developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants