Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Sep 5, 2025

Summary by CodeRabbit

  • New Features
    • Added support for kebab-case placeholders ('ys-base', 'ys-search') during module prefixing, with automatic renaming of matching files and directories.
    • Ensures PascalCase variants for search modules are generated correctly, reducing manual adjustments when scaffolding templates with hyphenated names.

@coderabbitai
Copy link

coderabbitai bot commented Sep 5, 2025

Walkthrough

Adds hyphenated placeholder replacements ('ys-base' => "$v-base", 'ys-search' => kebab($v) . "-search") and corresponding rename operations (including YsSearch → PascalCase($v) . "Search") in ModulePrefix::process; other mappings and control flow remain unchanged.

Changes

Cohort / File(s) Summary
Placeholder & rename updates
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php
Added content-replacement mappings for 'ys-base' => "$v-base" and 'ys-search' => Converter::kebab($v) . "-search"; added rename operations renameInDir for ys-basekebab($v)-base, ys-searchkebab($v)-search, and YsSearchPascalCase($v) . "Search". Existing mappings (ys_base, ys_search, YsBase, YSBASE, YSSEARCH) retained. No control-flow or API signature changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I twitch my whiskers, hop in place,
New hyphens join the naming race.
ks, kebabs, Pascal prance and play,
I nudge the repo, then bound away. 🥕✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 phpcs (3.7.2)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php

ERROR: Referenced sniff "Drupal" does not exist

Run "phpcs --help" for usage information

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/fix-installer-replacement-hyphen

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot temporarily deployed to commit September 5, 2025 10:58 Inactive
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (2)

108-112: Hyphenated placeholders in file/dir names are not renamed

Content is replaced for ys-*, but filenames/dirs named with hyphens (e.g., ys-base) won’t be renamed, potentially leaving stale scaffolding.

Apply this diff:

     File::renameInDir($t . sprintf('/%s/modules/custom', $w), 'ys_base', $v . '_base');
     File::renameInDir($t . sprintf('/%s/modules/custom', $w), 'ys_search', $v . '_search');
+    File::renameInDir($t . sprintf('/%s/modules/custom', $w), 'ys-base', str_replace('_', '-', $v) . '-base');
+    File::renameInDir($t . sprintf('/%s/modules/custom', $w), 'ys-search', str_replace('_', '-', $v) . '-search');
     File::renameInDir($t . sprintf('/%s/modules/custom', $w), 'YsBase', Converter::pascal($v) . 'Base');
     File::renameInDir($t . sprintf('/%s/sites/default/includes', $w), 'ys_base', $v . '_base');

Optionally mirror hyphen renames under sites/default/includes if such entries exist.


102-106: Uppercase mappings likely drop suffixes

Mapping YSBASE/YSSEARCH to Converter::cobol($v) removes BASE/SEARCH entirely (YSBASE → MS). If placeholders are intended to expand to full tokens, include the suffix in the conversion.

Apply this diff:

-      'YSBASE' => Converter::cobol($v),
-      'YSSEARCH' => Converter::cobol($v),
+      'YSBASE' => Converter::cobol($v . '_base'),
+      'YSSEARCH' => Converter::cobol($v . '_search'),

If, instead, YSBASE/YSSEARCH are meant to represent just the uppercase prefix, please ignore and confirm usage sites.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 3c231dc and 09b732d.

⛔ Files ignored due to path filters (5)
  • .vortex/installer/tests/Fixtures/install/_baseline/tests/behat/features/counter.feature is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/css/sw_base.css is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/js/sw_base.js is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/sw_base.module is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/templates/ys-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (1)
  • .vortex/installer/src/Prompts/Handlers/ModulePrefix.php (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (4)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-docs
🔇 Additional comments (1)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (1)

97-106: Replacement mapping is comprehensive. No other hyphenated or uppercase stub tokens detected by the scan.

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.85%. Comparing base (3c231dc) to head (10c5940).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1993      +/-   ##
===========================================
+ Coverage    77.83%   77.85%   +0.01%     
===========================================
  Files           90       90              
  Lines         5550     5555       +5     
  Branches        44       44              
===========================================
+ Hits          4320     4325       +5     
  Misses        1230     1230              

☔ 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/fix-installer-replacement-hyphen branch from 09b732d to 10c5940 Compare September 5, 2025 11:07
@github-actions github-actions bot temporarily deployed to commit September 5, 2025 11:10 Inactive
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (1)

55-68: Discovery misses hyphen-delimited modules — match both '_' and '-'

discover() only searches _base/_core and strips underscores, so hyphenated modules (e.g., my-site-base) won’t be discovered or normalized. Match both delimiters and strip both.

Apply:

-      $this->dstDir . sprintf('/%s/modules/custom/*_base', $this->webroot),
-      $this->dstDir . sprintf('/%s/modules/custom/*_core', $this->webroot),
-      $this->dstDir . sprintf('/%s/sites/all/modules/custom/*_base', $this->webroot),
-      $this->dstDir . sprintf('/%s/sites/all/modules/custom/*_core', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/*/modules/*_base', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/*/modules/*_core', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/*/modules/custom/*_base', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/*/modules/custom/*_core', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/*_base', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/*_core', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/custom/*_base', $this->webroot),
-      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/custom/*_core', $this->webroot),
+      $this->dstDir . sprintf('/%s/modules/custom/*[_-]base', $this->webroot),
+      $this->dstDir . sprintf('/%s/modules/custom/*[_-]core', $this->webroot),
+      $this->dstDir . sprintf('/%s/sites/all/modules/custom/*[_-]base', $this->webroot),
+      $this->dstDir . sprintf('/%s/sites/all/modules/custom/*[_-]core', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/*/modules/*[_-]base', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/*/modules/*[_-]core', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/*/modules/custom/*[_-]base', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/*/modules/custom/*[_-]core', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/*[_-]base', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/*[_-]core', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/custom/*[_-]base', $this->webroot),
+      $this->dstDir . sprintf('/%s/profiles/custom/*/modules/custom/*[_-]core', $this->webroot),

And:

-    return empty($path) ? NULL : str_replace(['_base', '_core'], '', basename($path));
+    return empty($path) ? NULL : preg_replace('/[_-](base|core)$/', '', basename($path));

Also applies to: 72-72

♻️ Duplicate comments (2)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (2)

99-99: Hyphen token now kebab-cased — resolves prior nit

Using Converter::kebab($v) for 'ys-base' is correct and fixes underscore leakage (e.g., my_site → my-site-base).


101-101: Consistent kebab-casing for 'ys-search'

Good parity with the base mapping; my_site → my-site-search is handled.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 09b732d and 10c5940.

⛔ Files ignored due to path filters (19)
  • .vortex/installer/tests/Fixtures/install/_baseline/tests/behat/features/counter.feature is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/css/sw_base.css is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/js/sw_base.js is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/sw_base.module is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/templates/sw-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/_baseline/web/modules/custom/sw_base/templates/ys-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_acquia/docroot/modules/custom/sw_base/css/sw_base.css is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_acquia/docroot/modules/custom/sw_base/js/sw_base.js is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_acquia/docroot/modules/custom/sw_base/sw_base.module is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_acquia/docroot/modules/custom/sw_base/templates/sw-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_acquia/docroot/modules/custom/sw_base/templates/ys-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/hosting_acquia/web/modules/custom/sw_base/templates/-sw-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/tests/behat/features/counter.feature is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/web/modules/custom/sw_base/templates/-sw-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/web/modules/custom/the_force_base/css/the_force_base.css is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/web/modules/custom/the_force_base/js/the_force_base.js is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/web/modules/custom/the_force_base/templates/the-force-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/web/modules/custom/the_force_base/templates/ys-base-counter-block.html.twig is excluded by !.vortex/installer/tests/Fixtures/**
  • .vortex/installer/tests/Fixtures/install/names/web/modules/custom/the_force_base/the_force_base.module is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (1)
  • .vortex/installer/src/Prompts/Handlers/ModulePrefix.php (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (2)
.vortex/installer/src/Utils/Converter.php (1)
  • Converter (9-17)
.vortex/installer/src/Utils/File.php (1)
  • File (10-102)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (4)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-docs
🔇 Additional comments (2)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (2)

109-111: Added hyphenated renames under modules/custom

Renaming 'ys-base' and 'ys-search' to kebab($v) variants looks correct and aligns with content replacements.


113-113: Class rename parity for Search

Adding 'YsSearch' → Pascal($v).'Search' keeps case-mapped renames consistent with 'YsBase'.

Comment on lines 97 to 106
File::replaceContentAsync([
'ys_base' => $v . '_base',
'ys-base' => Converter::kebab($v) . '-base',
'ys_search' => $v . '_search',
'ys-search' => Converter::kebab($v) . '-search',
'YsBase' => Converter::pascal($v) . 'Base',
'YsSearch' => Converter::pascal($v) . 'Search',
'YSBASE' => Converter::cobol($v),
'YSSEARCH' => Converter::cobol($v),
]);
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Confirm Converter::kebab() availability and behavior

If kebab() is missing or differs from expectations (e.g., handling spaces/underscores), replacements could regress. Please verify the method exists and hyphenizes underscores and spaces.


🏁 Script executed:

#!/bin/bash
# Verify kebab() is defined and review its implementation.
rg -nC2 -P '\bfunction\s+kebab\s*\(' .vortex/installer/src | sed -n '1,120p'
rg -nC2 -P '\bConverter::kebab\s*\(' .vortex | sed -n '1,120p'

Length of output: 2851


🏁 Script executed:

#!/bin/bash
# Locate the Converter class and its kebab() method across the repository
rg -nC3 'class\s+Converter\b' -g '*.php'
rg -nC5 'function\s+kebab\s*\(' -g '*.php'

Length of output: 87


🏁 Script executed:

#!/bin/bash
# Locate the Converter class file and inspect its namespace/imports
find . -type f -name '*Converter.php'

# Show namespace and imports for ModulePrefix.php to resolve Converter reference
sed -n '1,50p' .vortex/installer/src/Prompts/Handlers/ModulePrefix.php

Length of output: 1155


🏁 Script executed:

#!/bin/bash
# Extract the kebab() method implementation from Converter.php
sed -n '1,200p' .vortex/installer/src/Utils/Converter.php | sed -n '/function kebab/,/}/p'

Length of output: 90


🏁 Script executed:

#!/bin/bash
# Search for kebab method and count lines in Converter.php
rg -n 'kebab' -C2 .vortex/installer/src/Utils/Converter.php || echo 'No matches'
wc -l .vortex/installer/src/Utils/Converter.php

Length of output: 185


Implement or replace calls to missing Converter::kebab()
The Converter class at .vortex/installer/src/Utils/Converter.php does not define a kebab() method, so calls in ModulePrefix.php (e.g. lines 99, 101, 109, 111) will fail. Add a kebab() implementation or update these references to use a supported converter method.

🤖 Prompt for AI Agents
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php lines 97-106: the code
calls Converter::kebab() which doesn't exist in
.vortex/installer/src/Utils/Converter.php and will cause runtime errors; either
add a kebab(string $s): string method to Converter that normalizes the input
(trim, convert underscores/camel/Pascal to lower-case words separated by '-')
and returns kebab-case, or change these call sites to an existing Converter
method that produces kebab-case (e.g., a slug/normalize method) and pass the
same input; implement the new method in Converter.php and update its
docblock/tests, or replace the four calls in ModulePrefix.php to use the
existing supported converter function consistently.

@AlexSkrypnyk AlexSkrypnyk merged commit 4c4679c into develop Sep 5, 2025
31 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-installer-replacement-hyphen branch September 5, 2025 23:06
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released in 25.10.0

Development

Successfully merging this pull request may close these issues.

2 participants