[#2720] Extracted a dedicated 'import-db' script reused by provision and ahoy.#2728
Conversation
…ropping the database.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughThe PR adds a dedicated database import script, reuses it from provision, and routes ChangesDatabase import flow
Sequence Diagram(s)sequenceDiagram
participant User
participant AhoyImportDb as ahoy import-db
participant RequireTooling as ahoy require-tooling
participant ImportDb as src/import-db
participant DockerCompose as docker compose
participant ImportDbFile as import-db-file
participant Drush as drush
User->>AhoyImportDb: confirm database replacement
AhoyImportDb->>RequireTooling: ahoy require-tooling
AhoyImportDb->>ImportDb: run src/import-db "$@"
alt RUN_ON_HOST=1
ImportDb->>DockerCompose: docker compose exec -T cli ./vendor/drevops/vortex-tooling/src/import-db-file "$@"
DockerCompose->>ImportDbFile: execute import-db-file
else RUN_ON_HOST=0
ImportDb->>ImportDbFile: run local import-db-file "$@"
end
ImportDbFile->>Drush: drush sql:drop
ImportDbFile->>Drush: drush sql:connect < dump_file
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.vortex/tooling/src/import-db:
- Line 7: The header comment in the import-db script is stale and contradicts
the router logic, since the dual-mode flow also handles the in-container branch.
Update the wording near the script header to describe that it routes between
host and container execution, and keep the description aligned with the branch
logic in the routing entrypoint so readers understand both paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 3c7d5740-7e22-491d-95ae-8968779eead1
⛔ Files ignored due to path filters (29)
.vortex/installer/tests/Fixtures/handler_process/_baseline/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_no_sdc_devel/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/modules_none/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/theme_claro/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/theme_stark/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_lint_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_be_tests_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_behat_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_jest/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_jest_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpcs_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpstan_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_phpunit_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_rector/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_rector_circleci/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_none/.ahoy.ymlis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (8)
.ahoy.yml.vortex/docs/content/drupal/provision.mdx.vortex/tests/phpunit/Traits/Subtests/SubtestAhoyTrait.php.vortex/tooling/src/import-db.vortex/tooling/src/import-db-file.vortex/tooling/src/provision.vortex/tooling/tests/unit/import-db-file.bats.vortex/tooling/tests/unit/import-db.bats
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.
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a3da69d9c879e76b9009afb--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2728 +/- ##
==========================================
- 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:
|
…failure messages.
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.
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.
…d of a second 'pass'.
|
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 |
Closes #2720
Extracted a dedicated
import-dbrouter script andimport-db-fileworker script, reused by bothprovisionandahoy import-db. This mirrors the existingexport-db/export-db-filepattern and fixes a silent no-op bug inahoy import-db.Changes
.vortex/tooling/src/import-db- host-aware router: on the host it runsdocker compose exec -T cli .../import-db-file; inside the container it calls the worker directly (sameis_host()pattern asexport-db)..vortex/tooling/src/import-db-file- worker that resolves the dump path from its argument orVORTEX_IMPORT_DB_FILE_DIR/VORTEX_DB_DIR+VORTEX_DB_FILEdefaults, then runsdrush sql:dropand pipes the dump intodrush sql:connect. Refuses to run when the dump is missing or unreadable, so an unreadable file can never leave the site with the database dropped and nothing imported..vortex/tooling/src/provision-provision_from_db()keeps its explicit dump-file check, the nested fallback-to-profile branch, and its in-context failure signal (Unable to import database from file./Dump file … does not exist./Site content was not changed.), and delegates only the actualdrush sql:drop+drush sql:connectimport toimport-db-file. Provisioning behaviour and output are unchanged..ahoy.yml-ahoy import-dbnow calls the newimport-dbrouter and gains anahoy confirmguard. The old command setVORTEX_PROVISION_POST_OPERATIONS_SKIP=1and ranprovision, which on an existing site withVORTEX_PROVISION_OVERRIDE_DB=0silently preserved the database instead of replacing it.import-db.bats(4 cases) andimport-db-file.bats(4 cases, including the missing-file and unreadable-file guards);provision.batsunchanged (drush call order is identical).SubtestAhoyTrait.php- updated theahoy import-dbexpected output to the new script banners..vortex/docs/content/drupal/provision.mdx- removed a stale sentence that describedahoy import-dbas usingVORTEX_PROVISION_POST_OPERATIONS_SKIP..ahoy.ymlchange (139/139 clean on second pass).Screenshots
N/A
Before / After
Summary by CodeRabbit