Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Feb 9, 2026

Closes #1979

Summary by CodeRabbit

  • New Features

    • Added XML Sitemap and environment-specific settings that disable cron regeneration and external submission outside production.
  • Chores

    • Runtime manifest updated to include the XML Sitemap dependency.
    • Provisioning examples updated to install XML Sitemap in non-production setups.
  • Tests

    • Added end-to-end test confirming sitemap accessibility.
    • Added environment tests asserting XML Sitemap configuration.

@github-actions

This comment has been minimized.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 13:33:32

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 13:36:20

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 13:36:37

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/1979-add-xmlsitemap branch from f352a58 to 529de45 Compare February 9, 2026 13:57
@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Walkthrough

Adds the Drupal XML Sitemap module to the project: registers it with the installer, adds the Composer dependency, includes it in provisioning, supplies environment-specific settings, and adds Behat and PHPUnit tests verifying installation and configuration.

Changes

Cohort / File(s) Summary
Installer / Discovery
.vortex/installer/src/Prompts/Handlers/Modules.php, .vortex/installer/tests/Unit/Handlers/ModulesHandlerDiscoveryTest.php
Inserted xmlsitemap into available modules list and updated installer unit test fixture to include drupal/xmlsitemap.
Dependencies
composer.json
Added runtime dependency drupal/xmlsitemap with version constraint ^2.0.
Provisioning
scripts/custom/provision-10-example.sh, .vortex/tests/bats/unit/provision.bats
Included xmlsitemap in the non-production Drush pm:install module list and updated related provision test expectations.
Runtime configuration
web/sites/default/includes/modules/settings.xmlsitemap.php
New settings file that disables cron regeneration and prevents sitemap submission in non-production environments via config flags.
Tests
tests/behat/features/xmlsitemap.feature, tests/phpunit/Drupal/EnvironmentSettingsTest.php
Added Behat feature to verify /sitemap.xml accessibility and updated PHPUnit environment tests to assert xmlsitemap.* settings across environments.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

PR: Needs review

Poem

🐰 I hopped through composer, installer, and test,
A tiny xmlsitemap tucked in my vest.
In dev it stays quiet, in prod it may sing,
Little hops of config make the crawlers spring. ✨

🚥 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 clearly and specifically describes the main change: adding support for the xmlsitemap module for sitemap.xml generation, directly matching the PR's primary objective.
Linked Issues check ✅ Passed All coding requirements from issue #1979 are met: xmlsitemap module is integrated as a dependency, installer allows module selection, and settings.xmlsitemap.php configuration file is provided.
Out of Scope Changes check ✅ Passed All changes are directly related to integrating the xmlsitemap module; no out-of-scope modifications detected beyond the stated objectives.
Docstring Coverage ✅ Passed Docstring coverage is 93.33% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/1979-add-xmlsitemap

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

@github-actions

This comment has been minimized.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 14:03:44

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 14:07:03

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 14:07:04

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.44%. Comparing base (79bc146) to head (a1aedb2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2264      +/-   ##
==========================================
- Coverage   77.05%   76.44%   -0.61%     
==========================================
  Files         114      107       -7     
  Lines        5988     5830     -158     
  Branches       44        0      -44     
==========================================
- Hits         4614     4457     -157     
+ Misses       1374     1373       -1     

☔ View full report in Codecov by Sentry.
📢 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.

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/1979-add-xmlsitemap branch from 529de45 to 0c23b80 Compare February 9, 2026 23:10
@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 23:16:43

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@github-actions

This comment has been minimized.

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 23:19:47

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 23:20:09

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk AlexSkrypnyk force-pushed the feature/1979-add-xmlsitemap branch from 0c23b80 to a1aedb2 Compare February 9, 2026 23:26
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@web/sites/default/includes/modules/settings.xmlsitemap.php`:
- Around line 10-13: The conditional is accessing $settings['environment']
without a guard which can emit a PHP notice; update the if check to use a
null-coalescing or isset guard (e.g. ($settings['environment'] ?? NULL) or
isset($settings['environment']) ? $settings['environment'] : NULL) when
comparing to ENVIRONMENT_PROD, then keep the existing assignments to
$config['xmlsitemap.settings']['disable_cron_regeneration'] and
$config['xmlsitemap_engines.settings']['submit'] unchanged so the block only
runs when the environment value exists and is not ENVIRONMENT_PROD.

Comment on lines +10 to +13
// Disable submitting sitemap to search engines in non-production environments.
if ($settings['environment'] !== ENVIRONMENT_PROD) {
$config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE;
$config['xmlsitemap_engines.settings']['submit'] = FALSE;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Guard against missing environment setting to avoid notices.
If $settings['environment'] isn’t defined when this include runs, PHP emits a notice. Use a null-coalescing guard.

Proposed fix
-if ($settings['environment'] !== ENVIRONMENT_PROD) {
+if (($settings['environment'] ?? null) !== ENVIRONMENT_PROD) {
   $config['xmlsitemap.settings']['disable_cron_regeneration'] = TRUE;
   $config['xmlsitemap_engines.settings']['submit'] = FALSE;
 }
🤖 Prompt for AI Agents
In `@web/sites/default/includes/modules/settings.xmlsitemap.php` around lines 10 -
13, The conditional is accessing $settings['environment'] without a guard which
can emit a PHP notice; update the if check to use a null-coalescing or isset
guard (e.g. ($settings['environment'] ?? NULL) or
isset($settings['environment']) ? $settings['environment'] : NULL) when
comparing to ENVIRONMENT_PROD, then keep the existing assignments to
$config['xmlsitemap.settings']['disable_cron_regeneration'] and
$config['xmlsitemap_engines.settings']['submit'] unchanged so the block only
runs when the environment value exists and is not ENVIRONMENT_PROD.

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

Code Coverage Report:
  2026-02-09 23:32:55

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 23:33:25

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 23:36:28

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk
Copy link
Member Author

Code Coverage Report:
  2026-02-09 23:36:50

 Summary:
  Classes:  0.00% (0/1)
  Methods:  0.00% (0/2)
  Lines:   94.12% (176/187)

@AlexSkrypnyk AlexSkrypnyk merged commit ef5026b into main Feb 10, 2026
28 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/1979-add-xmlsitemap branch February 10, 2026 00:08
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Feb 10, 2026
@AlexSkrypnyk AlexSkrypnyk added this to the 1.36.0 milestone Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Release queue

Development

Successfully merging this pull request may close these issues.

[DRUPAL] Add a module for sitemap.xml generation

1 participant