Skip to content

[#2411] Added test to skip overriding non-Vortex custom theme.#2419

Merged
AlexSkrypnyk merged 1 commit intomainfrom
feature/2411-skip-non-vortex-theme
Mar 25, 2026
Merged

[#2411] Added test to skip overriding non-Vortex custom theme.#2419
AlexSkrypnyk merged 1 commit intomainfrom
feature/2411-skip-non-vortex-theme

Conversation

@AlexSkrypnyk
Copy link
Copy Markdown
Member

@AlexSkrypnyk AlexSkrypnyk commented Mar 25, 2026

Closes #2411

Summary by CodeRabbit

Release Notes

  • Tests

    • Added comprehensive test coverage for custom theme handling during installation, validating that non-Vortex theme files remain unchanged and properly managed.
  • Improvements

    • Streamlined theme directory cleanup during installation by removing unnecessary configuration file operations, improving the efficiency of the theme setup process.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: d1741797-8cbc-4ebc-b689-a16efb8e7d11

📥 Commits

Reviewing files that changed from the base of the PR and between 1283c79 and f776db7.

⛔ Files ignored due to path filters (34)
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/.env is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-.eslintrc.json is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-.gitignore is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-.npmrc is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-.prettierignore is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-.prettierrc.json is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-.stylelintrc.json is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-README.md is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-logo.svg is excluded by !**/*.svg, !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-postcss.config.js is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-star_wars.libraries.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/-star_wars.theme is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/fonts/-.gitkeep is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/images/-.gitkeep is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/js/-star_wars.js is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/package.json is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/patches/-.gitkeep is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/scss/-_components.scss is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/scss/-_fonts.scss is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/scss/-_mixins.scss is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/scss/-_rem.scss is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/scss/-_variables.scss is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/scss/-styles.scss is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/scss/components/-_header.scss is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/star_wars.info.yml is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/styles.css is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/Functional/-ExampleTest.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/Functional/-StarWarsFunctionalTestBase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/FunctionalJavascript/-ExampleTest.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/FunctionalJavascript/-StarWarsFunctionalJavascriptTestBase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/Kernel/-ExampleTest.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/Kernel/-StarWarsKernelTestBase.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/Unit/-ExampleTest.php is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/handler_process/theme_custom_non_vortex/web/themes/custom/star_wars/tests/src/Unit/-StarWarsUnitTestBase.php is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (2)
  • .vortex/installer/src/Prompts/Handlers/Theme.php
  • .vortex/installer/tests/Functional/Handlers/ThemeHandlerProcessTest.php
💤 Files with no reviewable changes (1)
  • .vortex/installer/src/Prompts/Handlers/Theme.php

Walkthrough

The PR removes unnecessary phpunit.xml cleanup logic from the Theme handler when processing core themes with template theme directories, and adds a functional test case to validate that non-Vortex custom theme files remain unmodified during installation.

Changes

Cohort / File(s) Summary
Theme handler logic
.vortex/installer/src/Prompts/Handlers/Theme.php
Removed two File::removeLineInFile() calls that deleted <directory ...> entries from phpunit.xml when core themes are selected with an existing template theme directory. The method now only removes the theme directory and its config lines via removeThemeConfigLines().
Theme handler tests
.vortex/installer/tests/Functional/Handlers/ThemeHandlerProcessTest.php
Added File utility import and new test dataset case theme_custom_non_vortex that validates ThemeHandler behavior when a custom theme scaffold is replaced with non-Vortex files. The test verifies custom theme files (star_wars.info.yml, package.json, styles.css) remain unchanged and Vortex template files are not created.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 A custom theme, now safe to keep,

No Vortex files, no cleanup sweep,

When themes aren't from our warren's code,

They hop along their chosen road! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly indicates a test was added to skip overriding non-Vortex custom themes, which aligns with the main code changes.
Linked Issues check ✅ Passed The PR includes a test case validating that non-Vortex custom theme files are not overridden, directly addressing issue #2411's requirement to detect and skip modifying non-Vortex themes.
Out of Scope Changes check ✅ Passed All changes are scoped to the theme handling test and implementation, with no unrelated modifications detected outside the theme override prevention objective.

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

✨ 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/2411-skip-non-vortex-theme

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

@github-actions
Copy link
Copy Markdown

Code coverage (threshold: 90%)

  Classes: 100.00% (1/1)
  Methods: 100.00% (2/2)
  Lines:   100.00% (189/189)
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
Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

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

@AlexSkrypnyk
Copy link
Copy Markdown
Member Author

Code coverage (threshold: 90%)

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

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.08%. Comparing base (1283c79) to head (f776db7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2419      +/-   ##
==========================================
- Coverage   79.43%   79.08%   -0.36%     
==========================================
  Files         126      119       -7     
  Lines        6736     6575     -161     
  Branches       44        0      -44     
==========================================
- Hits         5351     5200     -151     
+ Misses       1385     1375      -10     

☔ 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 merged commit a19572f into main Mar 25, 2026
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/2411-skip-non-vortex-theme branch March 25, 2026 03:09
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Mar 25, 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.

Installer: do not update the theme files if this is not a theme sourced form Vortex

1 participant