Simplified provision to use direct commands.#2303
Conversation
WalkthroughThe provisioning workflow is refactored to replace the unified "drush deploy" command with separate sequential Drush operations: UUID synchronization, database updates, configuration import, and deployment hooks. Documentation, provisioning script logic, and test expectations are updated accordingly. Changes
Sequence DiagramsequenceDiagram
participant Provision as Provisioning Script
participant Config as Configuration Files
participant DB as Database
participant Drush as Drush Commands
participant Deploy as Deployment Hooks
rect rgba(100, 150, 200, 0.5)
Note over Provision,Deploy: New Provisioning Flow
Provision->>Config: Check if config files exist
alt Config files present
Provision->>Drush: Set site UUID from system.site.yml
Drush->>DB: Update site UUID
end
Provision->>Drush: Run updatedb (database updates)
Drush->>DB: Apply pending updates
alt Config files present
Provision->>Drush: Execute config:import
Drush->>Config: Import configuration
end
Provision->>Drush: Execute deploy:hook
Drush->>Deploy: Run deployment hooks
Provision->>Drush: Rebuild caches
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
|
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/vortex/provision.sh (1)
291-333:⚠️ Potential issue | 🟠 MajorGuideline violation: changes in
scripts/vortex/.This file was modified, but repository rules require customizations to live under
scripts/custom/. Please move the change or update the guideline if this repository is meant to modify template scripts directly. As per coding guidelines, "Never modify files inscripts/vortex/directory - usescripts/custom/for custom scripts instead".🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/vortex/provision.sh` around lines 291 - 333, This change modified the protected provision script (uses variables like site_has_config_files, config_path, config_uuid and drush commands such as drush updatedb, drush config:import, drush cache:rebuild, drush deploy:hook), which violates the rule to not edit scripts in the vortex template; revert your edits to restore the original provision.sh and move the new logic into a custom script under the allowed custom scripts area (create a new script that checks site_has_config_files, extracts config_uuid from system.site.yml if present, runs drush updatedb, drush config:import (and config_split import when config_split is enabled), drush cache:rebuild, and drush deploy:hook), and ensure whatever bootstrapping mechanism sources or executes that custom script during provisioning instead of modifying the vortex template.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@scripts/vortex/provision.sh`:
- Around line 291-333: This change modified the protected provision script (uses
variables like site_has_config_files, config_path, config_uuid and drush
commands such as drush updatedb, drush config:import, drush cache:rebuild, drush
deploy:hook), which violates the rule to not edit scripts in the vortex
template; revert your edits to restore the original provision.sh and move the
new logic into a custom script under the allowed custom scripts area (create a
new script that checks site_has_config_files, extracts config_uuid from
system.site.yml if present, runs drush updatedb, drush config:import (and
config_split import when config_split is enabled), drush cache:rebuild, and
drush deploy:hook), and ensure whatever bootstrapping mechanism sources or
executes that custom script during provisioning instead of modifying the vortex
template.
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2303 +/- ##
==========================================
- Coverage 77.72% 77.15% -0.57%
==========================================
Files 117 110 -7
Lines 6181 6023 -158
Branches 44 0 -44
==========================================
- Hits 4804 4647 -157
+ Misses 1377 1376 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Replaced
drush deployinprovision.shwith standalone Drush commands toallow inserting logic between individual provisioning steps (needed for #1654).
The two conditional branches (config files exist vs not) are now a single
linear flow:
drush updatedb— always runsdrush config:import— only when config files are presentdrush cache:rebuild— always runsdrush deploy:hook— always runsChanges
scripts/vortex/provision.sh— replaced theif/elsebranching thatcalled
drush deploy(config path) or standalone commands (no-config path)with a single linear flow using standalone commands, where
config:importruns conditionally.
.vortex/docs/content/drupal/provision.mdx— updated the provisioningflow diagram to reflect the new command order (DB updates before config
import), marked config import as conditional, and updated the rationale text
to remove references to wrapping
drush deploy..vortex/tests/bats/unit/provision.bats— updated all 14 test cases tomatch the new output messages and command mocks. The config test now mocks
standalone
updatedb,config:import,cache:rebuild, anddeploy:hookinstead of
drush deploy..vortex/tests/phpunit/Traits/Subtests/SubtestAhoyTrait.php— updatedprovision and import-db integration test assertions to match the new output
messages.
Test plan
Summary by CodeRabbit
Documentation
Improvements