Repository navigation
[#893] Renamed the backend drivers to backends so their names stop colliding with Mink's. - #896
Conversation
…ivers' key and '@driver:' tag naming their replacements.
…e in 'MIGRATION.md'.
|
Important Review skippedToo many files! This PR contains 324 files, which is 24 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Team Run ID: ⛔ Files ignored due to path filters (8)
📒 Files selected for processing (324)
You can disable this status message by setting the
Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.x #896 +/- ##
=======================================
Coverage 95.96% 95.96%
=======================================
Files 164 164
Lines 8395 8401 +6
=======================================
+ Hits 8056 8062 +6
Misses 339 339 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #893
Summary
Every name this package owns for the Drupal, Drush and Blackbox backends now says "backend":
src/Driverissrc/Backend,DriverInterfaceisBackendInterface,WebRawContext::driverFor()isbackendFor(), thedriverskey underbehat_stepsisbackends, and the@driver:NAMEtag is@backend:NAME. "Driver" in one of our identifiers now only ever means Mink's browser driver, which steps reach throughbrowserDriverFor().3 of our names collided with Mink's:
DrevOps\BehatSteps\Driver\DriverInterfacewithBehat\Mink\Driver\DriverInterface, ourUnsupportedDriverActionExceptionwith Mink's, and$this->getDriver('drupal')with$this->getSession()->getDriver(). Any file touching both kinds had to alias one side, and a reader had to know the "a bare driver means the backend" rule fromCONTRIBUTING.mdto tell the 2getDriver()calls apart. Each of these is a public name, a configuration key or a tag, so they had to change before 4.0 ships and semver covers them.After merge, a
driverskey fails the container build and a@driver:tag fails its scenario at the start, each with a message naming its replacement, andMIGRATION.mdmaps every renamed class, method, constant, service ID and parameter.SubDriverFinderInterfaceandDrupalDriver::getSubDriverPaths()are removed rather than renamed. No step text changes, no capability interface is renamed, and the browser side keeps its names:browserDriverFor(),browserDriverHas(),BrowserAdapterBaseandBrowserCapabilityResolver.Before / After
Changes
Backend layer (
src/Backend, formerlysrc/Driver)DrevOps\BehatSteps\DrivertoDrevOps\BehatSteps\Backend.DriverInterface,DrupalDriver,DrushDriver,BlackboxDriverand their interfaces are nowBackendInterface,DrupalBackend,DrushBackend,BlackboxBackendand theirs. The capability interfaces,Core, the field handlers,EntityStuband the creation aliases keep their names.UnsupportedDriverActionExceptionis nowUnsupportedBackendActionException, and the base exception'sgetDriver()isgetBackend().SubDriverFinderInterfaceandDrupalBackend::getSubDriverPaths()are removed. They served the Drupal Extension's subcontext discovery, which this package doesn't do, and nothing called them.Integration layer (
src/Behat)DriverRegistry,DriverAwareInterface,DriverAwareInitializer,DriverListenerandDriverPassare nowBackendRegistry,BackendAwareInterface,BackendAwareInitializer,BackendListenerandBackendPass, with their methods renamed to match (getBackendFor(),setScenarioBackends(),registerBackend()and so on).BehatStepsExtensionreads abackendskey and loadsconfig/backends/*.yml. The service IDs and parameters move frombehat_steps.driver*tobehat_steps.backend*, and the service tag frombehat_steps.drivertobehat_steps.backend.BehatStepsExtension::rejectRenamedKeys()fails adriverskey from abeforeNormalization()hook. The tree rejects an undeclared root key beforeload()runs, so the existingrejectMovedKeys()would never see it.BackendListenerfails a scenario whose own tags or whose feature's tags carry@driver:NAME, naming@backend:NAME.Prerequisite::capability()now describes a prerequisite as "a backend in the scenario's list provides ...", and the failure messages say "backend" wherever they said "driver".Contexts and traits
WebRawContextexposesbackendFor(),getBackend(),getBackendRegistry()and the protectedanyBackendFor().backendFor().ContentTrait,EmailTraitandSearchApiTraitcheck whether an optional module is enabled throughanyBackendFor(), which reuses a backend the scenario already reached.DrushTrait::drushGetDriver()is nowdrushGetBackend().Tests and fixtures
tests/phpunit/src/Unit/Backendandtests/phpunit/src/Kernel/Backend, fixtures totests/phpunit/fixtures/backend, and thedriver_field_testfixture module in both Drupal fixtures is nowbackend_field_test.BehatStepsExtensionTestandBackendListenerTestcover both rejections, and 2 newbehatcli.featurescenarios prove a real nested run fails on a@driver:tag and on adriverskey.@backend:,driver.featureanddriver_feature_tag.featureare nowbackend.featureandbackend_feature_tag.feature, and the harness steps reada configuration listing the backend(s) :backendsandthe scenario backend order should be :order.DriverInterfaceorUnsupportedDriverActionExceptionto avoid the collision import them under their own names.Tooling
composer.jsonautoload-dev,scripts/lint-layers.php, the path-scoped ignore inphpstan.neon(src/Driver/*is nowsrc/Backend/*, with no rule added or widened) and thedocs.phptag registry follow the move.Documentation
CONTRIBUTING.md's vocabulary section is now "Backend, browser driver and HTTP client".MIGRATION.mdhas a new section mapping every renamed name, with before/after configuration in PHP, YAML and Gherkin. The earlier sections now use the final names, so a reader coming from 3.x or the Drupal Extension never meetsdriversat all.README.md,CLAUDE.md,docs/configuration.md,docs/http-clients.md,docs/usage.mdand theupdate-architecture-docsskill are updated,STEPS.mdandHELPERS.mdare regenerated, anddocs/architectureis re-traced:class-drivers.*is nowclass-backends.*.Worth a second look
SubDriverFinderInterfaceinstead of renaming it. A "sub-backend" would name a concept that doesn't exist here.MIGRATION.mdpoints togetCore()->getExtensionPathList()for anyone who read those paths.*.classparameters aren't detected. Only the config key and the tag fail loudly, which is the scope the issue asked for.MIGRATION.mdsays a parameter under its old name is simply never read again.Backendnow sorts ahead ofBehat, each in the order its file already followed.Testing
ahoy lintandahoy lint-docspass.ahoy test-unitpasses: 4,096 tests.ahoy test-kernelpasses: 125 tests.ahoy test-bddpasses: 1,203 scenarios and 5,073 steps.