Simplified the Lagoon amazee.io trusted-host pattern and removed 'VORTEX_LAGOON_AMAZEEIO_REGION'.#2716
Conversation
…TEX_LAGOON_AMAZEEIO_REGION'.
WalkthroughThe Lagoon trusted-host regex now allows any ChangesLagoon configuration and host trust
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a3c935a37f833dbd85ccda1--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
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 #2716 +/- ##
==========================================
- Coverage 86.67% 86.22% -0.45%
==========================================
Files 96 89 -7
Lines 4719 4560 -159
Branches 47 3 -44
==========================================
- Hits 4090 3932 -158
+ Misses 629 628 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
N/A
Summary
This simplifies the Lagoon amazee.io trusted-host handling by replacing the configurable
VORTEX_LAGOON_AMAZEEIO_REGIONregion knob (introduced in #2577 for #2546) with a single unconditionaltrusted_host_patternsentry^.+\.amazee\.io$. The region knob existed only to un-hardcode the old^.+\.au\.amazee\.io$pattern so non-AU consumers were not forced to edit a "do not modify" block; collapsing it to a region-agnostic wildcard removes that friction and the extra variable entirely.VORTEX_LAGOON_AMAZEEIO_REGIONbecomes a no-op and consumers can delete it from their.env.Changes
web/sites/default/includes/providers/settings.lagoon.phpThe
getenv('VORTEX_LAGOON_AMAZEEIO_REGION')block (defaultau,preg_quote-built pattern, skip-if-empty guard) collapses to a single line:$settings['trusted_host_patterns'][] = '^.+\.amazee\.io$';with a comment explaining it trusts amazee.io's autogenerated internal routes..envRemoves
VORTEX_LAGOON_AMAZEEIO_REGIONand its comment block from theHOSTING_LAGOONfence..vortex/docs/content/development/variables.mdxRemoves the
VORTEX_LAGOON_AMAZEEIO_REGIONrow (regenerated viaahoy update-docs).tests/phpunit/Drupal/EnvironmentSettingsTest.phpUpdates the expected
trusted_host_patternsfrom^.+\.au\.amazee\.io$to^.+\.amazee\.io$in all four Lagoon scenarios (testEnvironmentLagoonPreview,testEnvironmentLagoonDev,testEnvironmentLagoonTest,testEnvironmentLagoonProd) so the assertions match the settings change. None of these scenarios set the region variable, so all four previously asserted theaudefault.Installer test fixtures (5 Lagoon scenarios:
hosting_lagoon,hosting_project_name___lagoon,migration_disabled_lagoon,migration_enabled_lagoon,provision_database_lagoon)Regenerated the
.env,settings.lagoon.php, andEnvironmentSettingsTest.phpfixtures viaahoy update-snapshots; verified clean on a second pass (139/139 scenarios pass).Compatibility and security note
*.au.amazee.iois a subset of*.amazee.ioand remains trusted.*.amazee.ioHost to this environment's pod, andtrusted_host_patternsis defense-in-depth rather than the primary control.VORTEX_LAGOON_AMAZEEIO_REGIONis a documented variable that has been removed.Before / After
Summary by CodeRabbit
Bug Fixes
*.amazee.ioload correctly.Documentation