I ran the branch locally on Drupal 11.4.8 with PHP 8.4, ext-mongodb 1.21.10, mongodb/mongodb 1.21.5 and MongoDB 8.3: Unit, Kernel and Functional tests all pass, and it still merges cleanly into 8.x-2.x.
Before merging, please rebase on 8.x-2.x and trim the MR back to the Drupal 11 compatibility scope:
.gitlab-ci.yml: replace the extension build block with the original one-liner, pinned:pecl install mongodb-1.21.10 && docker-php-ext-enable mongodb. Only add build tools back if a job log shows they are actually missing.composer.json: drop"prefer-stable": true. It was only there to avoid Twig 3.30, which core 11.4.8 now handles.- cspell: the docs updated in #3626482: Update docs site for 2026-09 bring new words (at least "Coveralls" and "daffie"): please add them to
_CSPELL_WORDS. Logger::eventCollections(): the switch fromCollectionInfoIteratorto\Iteratormatches whatDatabase::listCollections()documents in the 1.x library, and 8.x-2.2 will require 1.21, so it can stay, but please list it under "API changes" in the MR description.- MR description: the "Dependencies" section still says phpunit depends on #3542043: Allow compatibility with `ext-mongodb` version 2.0, which is no longer the case, and "API changes" is missing the
eventCollections()signature change.
Please also include, since they define what 8.x-2.2 will claim to support:
- Version floors, aligned with the currently supported core branches (10.6, 11.3, 11.4) and the versions this branch is tested with:
- the three
.info.yml:core_version_requirement: ^10.6 || ^11.3, andphp: 8.1instead ofphp: '8.x'; - root
composer.json: thedrupal/coreconflict becomes<10.6.0 || >=11.0 <11.3.0; - all four
composer.json:ext-mongodbandmongodb/mongodbraised to^1.21.
- the three
- CI coverage for those claims, plus an early look at Drupal 12, in
.gitlab-ci.yml:
variables: OPT_IN_TEST_PREVIOUS_MAJOR: '1' OPT_IN_TEST_PREVIOUS_MINOR: '1' OPT_IN_TEST_NEXT_MAJOR: '1' composer (next major): allow_failure: trueThe templates already allow the next-major phpunit, phpstan and nightwatch jobs to fail, but not
composer (next major), which the others depend on. They also rewritecore_version_requirementto^12during those jobs, so.info.ymldoes not need to claim it yet.
Follow-ups, not blocking this MR:
- #3458044: [PHP 8.4] Fix implicitly nullable type declarations (PHP 8.4): the implicitly nullable
$eventTemplateinDetailController::getTop(), andunset($this->queueFactory)inQueueTest::tearDown(), which Upgrade Status flags on PHP 8.4 and can become$this->queueFactory = NULL;. - Drupal 12 needs PHPUnit attributes: PHPUnit 12 no longer reads
@covers,@groupor@dataProvider. As long as Drupal 10 is supported, its PHPUnit 9 only reads annotations, so the attributes have to be added next to them, not instead of them. The Drush commands can move to attributes outright, since every Drush version 8.x-2.x accepts supports them.
Issue fork mongodb-3625939
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 #2
matthandI've pushed fixes for everything in the summary:
FormStateValueResolvernow implementsValueResolverInterface, andConfigFormpasses$typedConfigManagerto its parent. Both work on Drupal 10.5+ and 11.drupal_rewrite_settings()withSettingsEditor::rewrite(), fixed theQueueTestconstructor call, made the data providers static, and added assertions to the unitLoggerTest.drush/drushtorequire-dev. The template's own Drush install fails because it doesn't ignore the missingext-mongodb, so PHPStan couldn't findDrushCommands._CSPELL_WORDS, and fixed the two stylelint findings.Comment #4
matthandThere was some small fixes to make to get it to pass CI. The latest Twig has a core bug in it, so had to pin that in CI for now. Will add followup ticket to remove that when the bug is fixed by core. I'll also check to see if it's reported there. But good news, all checks green! The 2.x modules install cleanly on Drupal 11! Ready for review!
Comment #5
matthandYeah the Twig 3.30.0 bug is reported and getting attention. I'll add the ticket to remove the workaround only if we merge the MR51 before the bug is fixed. Otherwise, I'll just remove workaround in the MR.
Comment #6
fgmThanks for this, and for splitting the CI fixes out of #3542043: Allow compatibility with `ext-mongodb` version 2.0.
Before review: was an AI tool used for the issue summary, the MR description or the code? d.o.'s AI policy asks for a short human-written disclosure at the end of the issue summary or MR description when it generated a significant part of either, however thoroughly it was reviewed. If none was used, just say so and I'll go ahead with the review.
Comment #7
matthandComment #8
matthandComment #9
matthand@fgm, My bad I forgot to add the AI disclosure. Just updated the descriptions on this issue and on MR to disclose that I worked with Claude Code.
Comment #10
matthand@fgm This Twig bug is so annoying, blocking CI. Somehow the Drupal Core constraint in the Drupal GitLab CI template is still 11.4.6 on their end, which will not build with Twig 3.30.0. I've now pinned CI to Drupal Core 11.4.8 since that was released to fix the Twig bug. If you want to handle the workaround another way let me know and I'll adjust. If you merge this sooner than this bug passes through all these layers I'll add the clean up ticket to remove the workaround when it's safe to do so.
Comment #11
fgmI ran the branch locally on Drupal 11.4.8 with PHP 8.4, ext-mongodb 1.21.10, mongodb/mongodb 1.21.5 and MongoDB 8.3: Unit, Kernel and Functional tests all pass, and it still merges cleanly into 8.x-2.x.
Before merging, please rebase on 8.x-2.x and trim the MR back to the Drupal 11 compatibility scope:
.gitlab-ci.yml: replace the extension build block with the original one-liner, pinned:pecl install mongodb-1.21.10 && docker-php-ext-enable mongodb. Only add build tools back if a job log shows they are actually missing.composer.json: drop"prefer-stable": true. It was only there to avoid Twig 3.30, which core 11.4.8 now handles._CSPELL_WORDS. Instead of the four "behaviour" to "behavior" edits in doc comments, please addbehaviourto that list too.Logger::eventCollections(): the switch fromCollectionInfoIteratorto\Iteratorchanges a public signature for library 2.x, so it belongs in #3542043: Allow compatibility with `ext-mongodb` version 2.0 rather than here.Please also include, since they define what 8.x-2.2 will claim to support:
.info.yml:core_version_requirement: ^10.6 || ^11.3, andphp: 8.1instead ofphp: '8.x';composer.json: thedrupal/coreconflict becomes<10.6.0 || >=11.0 <11.3.0;composer.json:ext-mongodbandmongodb/mongodbraised to^1.21..gitlab-ci.yml:The templates already allow the next-major phpunit, phpstan and nightwatch jobs to fail, but not
composer (next major), which the others depend on. They also rewritecore_version_requirementto^12during those jobs, so.info.ymldoes not need to claim it yet.Follow-ups, not blocking this MR:
$eventTemplateinDetailController::getTop(), andunset($this->queueFactory)inQueueTest::tearDown(), which Upgrade Status flags on PHP 8.4 and can become$this->queueFactory = NULL;.@covers,@groupor@dataProvider. As long as Drupal 10 is supported, its PHPUnit 9 only reads annotations, so the attributes have to be added next to them, not instead of them. The Drush commands can move to attributes outright, since every Drush version 8.x-2.x accepts supports them.Comment #12
fgmComment #13
matthand@fgm Thanks for the review and the local test run. I've rebased on 8.x-2.x (now on top of f67afe8, the #3626482 docs update) and applied the feedback. A few items needed small changes once the CI logs came in, as explained below. The MR description is updated to match.
Requested changes
DRUPAL_CORE: 11.4.8override on the composer job, and"prefer-stable"is back tofalse.behaviour,behaviours,coveralls,coverallsapp,daffie,fontawesomeandmkdocsto_CSPELL_WORDS, and reverted the "behavior" edits. I only found three, not four.behavioursis listed separately because cspell doesn't match plurals.Logger::eventCollections(): the return type is back toCollectionInfoIterator, so there is no public signature change here. PHPStan then fails on it withreturn.deprecatedInterface, because the interface is deprecated in mongodb/mongodb 1.21. I ignored that one error on the method with@phpstan-ignoreand added a@todoto change the type to\Iteratorin #3542043.core_version_requirement: ^10.6 || ^11.3andphp: 8.1in the.info.ymlfiles. I also updated themongodb_watchdog_testmodule's for consistency. The rootdrupal/coreconflict is now<10.6.0 || >=11.0 <11.3.0, andext-mongodbandmongodb/mongodbare^1.21in all fourcomposer.jsonfiles.OPT_IN_TEST_*variables are set, andcomposer (next major)hasallow_failure: true.Changes the CI logs required
pecl install mongodb-1.21.10 && docker-php-ext-enable mongodb, but it needed three more pieces:-f: the image already has a newer 2.x build, and pecl refused with "pecl/mongodb is already installed and is newer than detected released version 1.21.10".-f,phpizefailed with "Cannot find autoconf", soautoconf,build-essentialandpkg-configare back, installed through apt.Class "MongoDB\Driver\Manager" not found. The check now fails the job at the install step instead.OPT_IN_TEST_*variables only add the variant jobs. With the templates' default_AUTORUN_*: none, they're manual jobs that contributors can't start in MR pipelines. I set_AUTORUN_PREVIOUS_MAJOR,_AUTORUN_PREVIOUS_MINORand_AUTORUN_NEXT_MAJORtopush-and-mr. If you'd rather keep them manual, I can drop this.composer (previous major)couldn't resolvephpunit/phpunit: ^11.5. Drupal 10.6'score-devrequires^9.6.34, and PHPUnit 11 needs PHP 8.2 while that job runs PHP 8.1. The constraint is now^9.6 || ^11.5.php: 8.1floor.MongoDbTest::testCountCollection()usedmt_rand(0, 100)for the document count, andinsertMany()throws on an empty array. It failed once in the previous-minor job. The count now starts at 1.CI status
Pipeline 980809, on the latest commit, passes:
The next-major (Drupal 12) composer, PHPStan and phpunit jobs fail, which is allowed, so the pipeline shows "passed with warnings".
Setting back to Needs review.
Comment #14
fgmMostly good, I added a few floor raises.
Comment #15
fgmMerged in the latest 8.x-2.x-dev.