[#2851] Removed the starter content model when neither demo nor search custom module is selected. - #2857
[#2851] Removed the starter content model when neither demo nor search custom module is selected.#2857AlexSkrypnyk wants to merge 2 commits into
Conversation
…h module is selected.
WalkthroughCustom module processing now centralizes module path matching and conditionally removes the content model token, recipe, ignore rule, and deploy step when demo and search are absent. Tests verify retention and removal scenarios, and documentation reflects the starter content model. ChangesContent model cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant CustomModulesProcess
participant File
participant InstallerFiles
CustomModulesProcess->>File: findMatchingPath(moduleLocations(suffix))
CustomModulesProcess->>InstallerFiles: remove CONTENT_MODEL token
CustomModulesProcess->>InstallerFiles: delete recipes/page and CreateContentModelDeployStep.php
Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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/installer/src/Prompts/Handlers/CustomModules.php:
- Around line 129-135: Ensure the custom module selection flow preserves a
deploy-step implementation when Base is unselected but dependent Demo/Search
modules remain selected. Update the logic around the CUSTOM_MODULE_BASE removal
in the relevant handler to make Base mandatory for those dependent modules, or
relocate/provide CreateContentModelDeployStep.php within a retained module so
the retained recipes/page deployment path still has a step to execute.
🪄 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: 4e1d0cd1-c510-4b97-bffa-517c9df327f6
⛔ Files ignored due to path filters (45)
.vortex/installer/tests/Fixtures/handler_process/_baseline/web/modules/custom/sw_base/src/Plugin/DeployStep/CreateContentModelDeployStep.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/.gitignoreis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/recipes/page/-recipe.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/recipes/page/config/-core.entity_form_display.node.page.default.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/recipes/page/config/-core.entity_view_display.node.page.default.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/recipes/page/config/-core.entity_view_display.node.page.teaser.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/recipes/page/config/-field.field.node.page.body.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/recipes/page/config/-field.storage.node.body.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/recipes/page/config/-node.type.page.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/tests/behat/features/-counter.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/tests/behat/features/-pages.featureis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_base/src/Plugin/DeployStep/-CreateContentModelDeployStep.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_base/src/Plugin/DeployStep/EnableDevelopmentModulesDeployStep.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/-sw_demo.deploy.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/-sw_demo.info.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/-sw_demo.libraries.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/-sw_demo.moduleis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/config/install/-views.view.sw_demo_pages.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/css/-sw_demo.cssis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/js/-sw_demo.jsis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/js/tests/-sw_demo.test.jsis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/src/Plugin/Block/-CounterBlock.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/src/Plugin/GeneratedContent/Node/-Page.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/templates/-sw-demo-counter-block.html.twigis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/tests/src/FunctionalJavascript/-CounterBlockTest.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/tests/src/Kernel/-CounterBlockTest.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_demo/tests/src/Unit/-CounterBlockTest.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_search/-sw_search.deploy.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_search/-sw_search.info.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_search/-sw_search.installis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_search/config/install/-search_api.index.content.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_search/config/install/-search_api.server.solr.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_search/config/install/-views.view.search.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_base_only/web/modules/custom/sw_search/src/Plugin/DeployStep/-RebuildSearchIndex.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/.gitignoreis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/-recipe.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-core.entity_form_display.node.page.default.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-core.entity_view_display.node.page.default.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-core.entity_view_display.node.page.teaser.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-field.field.node.page.body.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-field.storage.node.body.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-node.type.page.ymlis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/docroot/modules/custom/sw_base/src/Plugin/DeployStep/CreateContentModelDeployStep.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/docroot/modules/custom/sw_base/src/Plugin/DeployStep/CreateContentModelDeployStep.phpis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/web/modules/custom/the_force_base/src/Plugin/DeployStep/CreateContentModelDeployStep.phpis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (6)
.gitignore.vortex/installer/CLAUDE.md.vortex/installer/src/Prompts/Handlers/CustomModules.php.vortex/installer/tests/Functional/Handlers/CustomModulesHandlerProcessTest.php.vortex/tests/phpunit/Traits/SutTrait.phpweb/modules/custom/ys_base/src/Plugin/DeployStep/CreateContentModelDeployStep.php
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
Code coverage (threshold: 90%) Per-class coverage |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 2.x #2857 +/- ##
==========================================
- Coverage 88.08% 88.06% -0.02%
==========================================
Files 98 98
Lines 5379 5370 -9
Branches 3 3
==========================================
- Hits 4738 4729 -9
Misses 641 641 ☔ 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://6a6964ec637bef0382ba59fe--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
Closes #2851
Summary
The
pagecontent model - therecipes/page/recipe plus theCreateContentModelDeployStepthat applies it - was unfenced in the installer, so it survived into every generated project regardless of which custom modules were selected. Its sibling in the same directory,EnableDevelopmentModulesDeployStep, was already fenced with the demo token, so the content model was the odd one out. TheCustomModuleshandler now removes bothrecipes/page/andCreateContentModelDeployStep.phpoutright, but only when neither the demo nor the search custom module is selected, not on demo alone as the originating issue frames it: the search custom module'sweb/modules/custom/ys_search/ys_search.deploy.phpattaches the editorial workflow to thenode/pagebundle, and saving that workflow against a missing bundle entity throwsLogicException: Missing bundle entityfromEntityType::getBundleConfigDependency()in Drupal core;tests/behat/features/search.featurealso creates and indexespagecontent, and that feature is removed only when the Solr service is deselected, never by the demo selection alone. Gating the removal on demo alone would break the deploy and the BDD suite for every project that keeps Search and drops Demo, so this deviation from the issue's stated scope is called out here for a reviewer to weigh in on.Changes
CustomModules::process()now removes therecipes/pagedirectory and theCreateContentModelDeployStep.phpfile outright withFile::remove()when neitherself::DEMOnorself::SEARCHis in the selected modules, matching how whole custom module directories are already removed elsewhere in the same method - per the installer guide, whole-file removal usesFile::remove()and fences are reserved for partial edits.CONTENT_MODEL, for the single partial edit this change needs: the!recipes/pageallow-list line in the root.gitignore, wrapped in#;< CONTENT_MODEL/#;> CONTENT_MODEL. Documented in the token table in.vortex/installer/CLAUDE.md.moduleLocations(string $suffix)helper, now used four times including the new content-model removal block.CreateContentModelDeployStepdocblock so it no longer describes itself in terms of the demo modules that call it.custom_modules_base_onlyinstaller scenario (base selected, demo and search both deselected) - the only case where the deploy step file must be deleted while its own module survives, which the existingcustom_modules_nonescenario cannot prove because it deletes the base module directory wholesale.custom_modules_no_demoscenario's assertions to confirm the content model survives when Search is kept alongside a demo deselection, and thecustom_modules_nonescenario's assertions to confirm it is gone;custom_modules_no_demo's generated fixture output is deliberately left unchanged, since it asserts against already-correct behaviour and is the regression guard for the search coupling.SutTraitnow assertsrecipes/page/recipe.ymlandCreateContentModelDeployStep.phpare both present in a full install.custom_modules_base_only(new) andcustom_modules_none, plushosting_acquia,hosting_project_name___acquiaandnames, which carry copies of the rewordedCreateContentModelDeployStepdocblock.Before / After
Both
recipes/page/andCreateContentModelDeployStep.phpmove together in every row below - either both survive or both are removed.Summary by CodeRabbit
New Features
Bug Fixes