[#3098] Enabled email rerouting in every cloud environment and moved 'reroute_email' to the development modules script. - #3099
Conversation
…'reroute_email' to the development modules script.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review. WalkthroughReroute Email moves from demo provisioning to development provisioning. Configuration exports exclude the module. Cloud environments enable rerouting by default, while local, CI, and production remain disabled. Stage can disable rerouting through ChangesEmail rerouting and provisioning
Estimated code review effort: 3 (Moderate) | ~20 minutes Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The updated development-provisioning expectations cover Reroute Email installation and environment-specific skip behavior, with no remaining merge-blocking risk identified. Sequence Diagram(s)sequenceDiagram
participant ProvisioningScript
participant Drush
participant RerouteEmailSettings
ProvisioningScript->>Drush: install reroute_email from development provisioning
RerouteEmailSettings->>RerouteEmailSettings: evaluate environment and override
RerouteEmailSettings-->>Drush: enable or disable rerouting
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Full details: Linked Issues checkExplanation The PR implements the environment behavior, module relocation, DEV_MODULES membership, configuration exclusion, override, tests, and documentation for [ Full details: Title checkExplanation The title accurately mentions moving Resolution Update the title to specify that rerouting is enabled by default in non-production cloud environments, including stage, while production delivery remains enabled. For example:
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
A rabbit reads each line, Comment |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3099 +/- ##
==========================================
- Coverage 87.32% 86.98% -0.35%
==========================================
Files 108 101 -7
Lines 5161 5001 -160
Branches 49 3 -46
==========================================
- Hits 4507 4350 -157
+ Misses 654 651 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a9f60a2b3782a9a564d9726--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
|
Code coverage (threshold: 90%) Per-class coverage |
|
Code coverage (threshold: 90%) Per-class coverage |
Closes #3098
Summary
web/sites/default/includes/modules/settings.reroute_email.phpnow enablesreroute_emailin every environment exceptlocal,ciandprod.ENVIRONMENT_STAGEleft the list of environments that deliver mail, and the condition lost its negation, so rerouting is the fall-through default rather than the exception; the same file addsreroute_emailto$settings['config_exclude_modules'].A
stageenvironment runs a copy of production content, so before this change any address that database sanitization missed received real mail as soon as a cron run, a content save or a UAT session triggered one. Separately, the module'sdrush pm:installcall sat in theMODULESfence ofscripts/provision-00-enable-demo-modules.sh, whose header tells projects to replace its operations once the site stops relying on demo content - a project that follows that instruction stops installingreroute_emailon every environment it rebuilds afterwards, and mail starts reaching real recipients fromdevas well.reroute_emailnow installs from aMODULE_REROUTE_EMAILblock inscripts/provision-10-enable-dev-modules.sh, placed ahead ofMODULE_GENERATED_CONTENTso the safety net is in place before content generation creates users, and it joinsModules::DEV_MODULESso the installer keeps that script whenreroute_emailis the last selected member of the set.localandcistill deliver to the intended recipient, andDRUPAL_REROUTE_EMAIL_DISABLEDstill forces delivery on any single environment - that is the supported route for astagesite that genuinely needs to mail real people during UAT. Both provision scripts keep theirlocal/ci/dev/stagegate, andprovision.mdxnow documents the resulting disagreement with the settings file over custom environment types instead of resolving it.Before / After
Changes
Behaviour
web/sites/default/includes/modules/settings.reroute_email.php: droppedENVIRONMENT_STAGEfrom the environments that deliver mail and inverted the condition so rerouting is the fall-through default; addedreroute_emailto$settings['config_exclude_modules']so the module cannot reach production through exported configuration.scripts/provision-00-enable-demo-modules.sh: removedreroute_emailfrom the contribdrush pm:installline.scripts/provision-10-enable-dev-modules.sh: added aMODULE_REROUTE_EMAILfenced block that installs the module, placed ahead ofMODULE_GENERATED_CONTENT.Installer
.vortex/installer/src/Prompts/Handlers/Modules.php: addedreroute_emailtoModules::DEV_MODULES, so deselecting it removes the fenced block throughFile::removeTokenAsync()and the dev script is deleted only once every member of the set is deselected. The constant's docblock described the set as development and testing tools, which no longer covers an environment-aware safety module, so it now names the shared property instead..vortex/installer/tests/Fixtures/handler_process/regenerated withahoy update-snapshots, including the newmodules_no_devel_sdc_devel_generated_content_testmode_reroute_emailscenario.Tests
tests/phpunit/Drupal/SwitchableSettingsTest.php: the stage case now expectsenable = TRUE, and a new case coversstagewithDRUPAL_REROUTE_EMAIL_DISABLEDset.tests/phpunit/Drupal/EnvironmentSettingsTest.php:testEnvironmentAcquiaStageandtestEnvironmentLagoonTestnow expectenable = TRUE, and the fencedreroute_emailentry was added to all 16config_exclude_modulesassertions..vortex/tooling/tests/unit/provision.bats: the install assertion moved from the demo-modules block to the dev-modules block across all 13 scenarios that install development modules..vortex/tooling/tests/unit/provision-enable-dev-modules.bats: added thereroute_emaildrush mock expectation and its output assertions to both installing scenarios, and the not-expected line to the two production-skip scenarios..vortex/installer/tests/Functional/Prompts/Handlers/ModulesHandlerProcessTest.php:modules_no_reroute_emailnow asserts the dev script survives without the install line,modules_no_devel_sdc_devel_generated_content_testmodeasserts it survives onreroute_emailalone, and a new scenario asserts it is deleted only when all five members are deselected.Documentation
.vortex/docs/content/development/modules/contributed-modules.mdx: added the install-source bullet, flipped the stage row in the environment behaviour table, recorded the config export exclusion, and namedDRUPAL_REROUTE_EMAIL_DISABLEDas the supported stage UAT opt-out..vortex/docs/content/development/provision.mdx: addedreroute_emailto the dev script's "present when" list and to the section describing it, and documented that both provision scripts skip any environment type outsidelocal,ci,devandstagewhile the settings file reroutes everything outsidelocal,ciandprod..vortex/docs/content/development/modules/README.mdx: the development provisioning and config-exclusion rows no longer describe the set as development-only.Not included
The recorded terminal demos (
.vortex/docs/static/img/provision.*and siblings) still show the old demo install line. Re-recording rebuilds the whole set with timing-dependent output, CI does not verify them, and they are re-recorded wholesale during release preparation.