Skip to content

[#2851] Removed the 'page' content model when the demo and search modules are deselected. - #2862

Merged
AlexSkrypnyk merged 5 commits into
mainfrom
feature/2851-demo-recipe-fence
Jul 29, 2026
Merged

[#2851] Removed the 'page' content model when the demo and search modules are deselected.#2862
AlexSkrypnyk merged 5 commits into
mainfrom
feature/2851-demo-recipe-fence

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Jul 29, 2026

Copy link
Copy Markdown
Member

Closes #2851

Summary

The recipes/page recipe (the Basic page content type, its body field, and its form and view displays) previously survived every install unconditionally. It now carries a CONTENT_MODEL fence token and is removed by the installer when neither the demo nor the search custom module is selected. search participates because tests/behat/features/search.feature (tagged @search @p1) creates and indexes page content and is only removed when Solr is deselected, so removing the recipe purely on demo-deselect would leave a base+search project with a Behat feature referencing a content type that no longer exists. scripts/provision-00-enable-demo-modules.sh fences the recipe-apply step with the same token and now reports a skip via note instead of claiming success when the Drupal CLI is unavailable.

Changes

  • Wrapped recipes/page/ behind a new CONTENT_MODEL fence token, and wrapped the !recipes/page allow-list entry in .gitignore in the same fence; the unfenced recipes/* deny rule above it is untouched, since Composer still installs contrib recipes there and they must stay ignored regardless of this selection.
  • Added a block to .vortex/installer/src/Prompts/Handlers/CustomModules.php::process() that runs File::removeTokenAsync('CONTENT_MODEL') and File::remove($t . '/recipes/page') only when neither DEMO nor SEARCH remains in the final $selected set. It runs after the per-module removal blocks so it reads $selected post safety-net (the existing safety net force-removes SEARCH when Solr is deselected).
  • Wrapped the ./vendor/bin/dr recipe call in scripts/provision-00-enable-demo-modules.sh in #;< CONTENT_MODEL / #;> CONTENT_MODEL, and changed it to report Skipped creating the content model: Drupal CLI is not available. via note rather than unconditionally printing Created the content model. when ./vendor/bin/dr is absent.
  • Updated .vortex/docs/content/architecture.mdx to describe the .gitignore allow-list pattern generically instead of citing !recipes/page as a concrete example, since that entry is now conditional.
  • Added assertDirectoryExists/assertDirectoryDoesNotExist assertions on recipes/page to the custom_modules_no_demo, custom_modules_no_search, custom_modules_none, and custom_modules_search_without_solr scenarios in CustomModulesHandlerProcessTest, and regenerated the installer fixture snapshots.

Scope

The issue's acceptance criterion of "an install with the demo module deselected contains no recipes/page" holds for the demo-off and search-off combination, not for demo-off alone - this is deliberate, since the recipe survives while either consumer still needs it. Each row below is covered by an existing fixture scenario:

demo search recipes/page Scenario
on on kept _baseline
on off kept custom_modules_no_search
off on kept custom_modules_no_demo
off off removed custom_modules_none

The issue also named web/modules/custom/ys_base/src/Plugin/DeployStep/CreateContentModelDeployStep.php; that file no longer exists, since commit e94fde1 replaced the DeployStep plugins with provision subscripts, and the recipe is now applied from scripts/provision-00-enable-demo-modules.sh. The issue's requirement to check ys_base for other demo-only code is satisfied by that same commit - ys_base retains only hook_mail_alter, a theme-install deploy hook, and test scaffolding.

Before / After

Install with demo = off and search = off
══════════════════════════════════════════════════════════════

BEFORE
──────
recipes/
└── page/
    ├── recipe.yml
    └── config/
        ├── node.type.page.yml
        ├── field.storage.node.body.yml
        ├── field.field.node.page.body.yml
        ├── core.entity_form_display.node.page.default.yml
        ├── core.entity_view_display.node.page.default.yml
        └── core.entity_view_display.node.page.teaser.yml

.gitignore
  recipes/*
  !recipes/page

scripts/provision-00-enable-demo-modules.sh
  task "Creating the content model."
  ./vendor/bin/dr recipe "$(pwd)/recipes/page" --no-interaction
  pass "Created the content model."

AFTER
─────
recipes/
    (no custom recipes - contrib recipes still deny-listed)

.gitignore
  recipes/*
  (no !recipes/page allow-list entry)

scripts/provision-00-enable-demo-modules.sh
  (recipe-apply block removed entirely by the CONTENT_MODEL fence)

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of shared content models when selecting Demo and Search modules.
    • Ensured custom recipe files and directories are retained or removed appropriately across module configurations.
    • Provisioning now skips unavailable content-model setup gracefully.
  • Documentation

    • Clarified how custom Composer recipes are explicitly un-ignored.
  • User Experience

    • Added clearer progress and skip messages during content-model setup.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d2ddf336-cbb2-4734-b79d-6229be1b182b

📥 Commits

Reviewing files that changed from the base of the PR and between 20237da and a27f766.

⛔ Files ignored due to path filters (35)
  • .vortex/installer/tests/Fixtures/handler_process/_baseline/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_no_base/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_no_demo/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_no_search/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_none/.gitignore is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/-recipe.yml is 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.yml is 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.yml is 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.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-field.field.node.page.body.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-field.storage.node.body.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_none/recipes/page/config/-node.type.page.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_none/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/custom_modules_search_without_solr/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_coffee/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_config_split/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_config_update/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_environment_indicator/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_navigation_extra_tools/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_pathauto/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_redirect/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_reroute_email/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_robotstxt/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_seckit_shield_stage_file_proxy/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_shield/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_stage_file_proxy/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_no_xmlsitemap/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/modules_none/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/names/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/non_interactive_config_file/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/non_interactive_config_string/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/services_no_clamav/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/services_no_redis/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/services_no_solr/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/services_none/scripts/provision-00-enable-demo-modules.sh is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (5)
  • .gitignore
  • .vortex/docs/content/architecture.mdx
  • .vortex/installer/src/Prompts/Handlers/CustomModules.php
  • .vortex/installer/tests/Functional/Handlers/CustomModulesHandlerProcessTest.php
  • scripts/provision-00-enable-demo-modules.sh

Walkthrough

The installer now treats recipes/page as a shared content model for the DEMO and SEARCH modules, removing it only when neither is selected. Provisioning output, ignore markers, documentation, and functional assertions were updated accordingly.

Changes

Shared content model handling

Layer / File(s) Summary
Content model provisioning markers
.gitignore, scripts/provision-00-enable-demo-modules.sh, .vortex/docs/content/architecture.mdx
The content model sections are marked consistently, provisioning reports success or skips when Drupal CLI is unavailable, and documentation describes explicit recipe un-ignoring.
Conditional content model retention
.vortex/installer/src/Prompts/Handlers/CustomModules.php, .vortex/installer/tests/Functional/Handlers/CustomModulesHandlerProcessTest.php
The installer removes CONTENT_MODEL and recipes/page only when both DEMO and SEARCH are absent, with scenario assertions covering retained and removed paths.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • drevops/vortex#2857: Directly updates the same installer logic, tests, and .gitignore handling for CONTENT_MODEL and recipes/page.
  • drevops/vortex#2760: Introduced the content-model assets and related installer and ignore behavior.
  • drevops/vortex#2757: Also changes the recipes/page content-model inclusion workflow and provisioning rules.

Suggested labels: Needs review

Poem

A rabbit hops through recipes bright,
Keeping shared pages snug and right.
Demo or search? The model stays,
Neither chosen? It fades away.
“Hop-hop!” the tests all cheer,
Content models are clear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main behavioral change in the PR.
Linked Issues check ✅ Passed The recipe/deploy-step cleanup and the related fixture/script updates match the PR objectives.
Out of Scope Changes check ✅ Passed All described changes support the content-model fencing and module-selection fix; no unrelated changes stand out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/2851-demo-recipe-fence

Comment @coderabbitai help to get the list of available commands.

@AlexSkrypnyk AlexSkrypnyk added A1 Board worker 1 A2 Working clone index A2 labels Jul 29, 2026
@github-actions

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

This comment has been minimized.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.48%. Comparing base (b04386a) to head (a27f766).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scripts/provision-00-enable-demo-modules.sh 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2862      +/-   ##
==========================================
- Coverage   86.91%   86.48%   -0.44%     
==========================================
  Files         100       93       -7     
  Lines        4830     4675     -155     
  Branches       47        3      -44     
==========================================
- Hits         4198     4043     -155     
  Misses        632      632              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

📖 Documentation preview for this pull request has been deployed to Netlify:

https://6a6991033f8ba903bef1ea04--vortex-docs.netlify.app

This preview is rebuilt on every commit and is not the production documentation site.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Jul 29, 2026
@AlexSkrypnyk
AlexSkrypnyk force-pushed the feature/2851-demo-recipe-fence branch from 20237da to a27f766 Compare July 29, 2026 05:21
@AlexSkrypnyk AlexSkrypnyk added AUTOMERGE Pull request has been approved and set to automerge and removed Needs review Pull request needs a review from assigned developers labels Jul 29, 2026
@AlexSkrypnyk
AlexSkrypnyk enabled auto-merge (squash) July 29, 2026 05:22
@github-actions

Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.55% (204/207)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk

This comment has been minimized.

2 similar comments
@AlexSkrypnyk

This comment has been minimized.

@AlexSkrypnyk

Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   98.55% (204/207)
Per-class coverage
Drupal\ys_demo\Plugin\Block\CounterBlock
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 10/ 10)

@AlexSkrypnyk AlexSkrypnyk moved this from BACKLOG to In progress in Vortex 1.x Jul 29, 2026
@AlexSkrypnyk
AlexSkrypnyk merged commit ece8160 into main Jul 29, 2026
41 of 42 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/2851-demo-recipe-fence branch July 29, 2026 06:11
@github-project-automation github-project-automation Bot moved this from In progress to Release queue in Vortex 1.x Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A1 Board worker 1 A2 Working clone index A2 AUTOMERGE Pull request has been approved and set to automerge

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

Remove the demo-only recipe and deploy step when the demo module is deselected.

1 participant