Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Jul 17, 2025

Summary by CodeRabbit

  • Bug Fixes

    • Improved project name discovery to better handle environment variables and composer.json formats.
    • Enhanced module prefix detection to support more directory naming patterns.
  • Refactor

    • Streamlined prompt handling logic for improved clarity and maintainability.
  • Tests

    • Significantly expanded test coverage for prompt validation and discovery scenarios.
    • Added new test cases for edge cases and environment-based discovery.
    • Introduced tests for a new AI instructions prompt handler.
  • Chores

    • Updated a development dependency version for improved compatibility.

@coderabbitai
Copy link

coderabbitai bot commented Jul 17, 2025

Walkthrough

This update expands discovery logic for module prefixes and project names, refines prompt management in the installer, and significantly enhances the unit test coverage for prompt handlers. It also updates a development dependency version in the composer configuration and incorporates the new AiCodeInstructions prompt handler into testing.

Changes

File(s) Summary of Changes
.vortex/installer/composer.json Updated "alexskrypnyk/phpunit-helpers" version constraint from ^0.8.0 to ^0.8.2.
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php Broadened discovery to include both _base and _core suffixes for module prefixes.
.vortex/installer/src/Prompts/Handlers/Name.php Improved project name discovery: checks dotenv, relaxes composer.json regex, simplifies default fallback.
.vortex/installer/src/Prompts/PromptManager.php Refactored prompt form construction: separates form building from submission for clarity.
.vortex/installer/tests/Unit/PromptManagerTest.php Major test expansion: added AiCodeInstructions handler, broadened discovery/validation coverage, new helpers added.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PromptManager
    participant PromptHandler
    participant Env/Composer/FS

    User->>PromptManager: Initiate prompts
    PromptManager->>PromptHandler: Build prompt form
    PromptHandler->>Env/Composer/FS: Attempt discovery (dotenv, composer.json, FS)
    Env/Composer/FS-->>PromptHandler: Return discovered value or null
    PromptHandler-->>PromptManager: Return prompt value
    PromptManager->>PromptManager: Submit form, filter responses
    PromptManager-->>User: Return processed responses
Loading

Possibly related PRs

Suggested labels

PR: Needs review

Poem

🐇
With prompts refined and tests anew,
Discovery widened—names peek through!
Module prefixes, core or base,
Composer, dotenv—search every place.
A helper hops in, AI in tow,
This rabbit cheers as coverage grows!
🥕

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

.vortex/installer/src/Prompts/Handlers/Name.php

ERROR: Referenced sniff "Drupal" does not exist

Run "phpcs --help" for usage information

.vortex/installer/src/Prompts/PromptManager.php

ERROR: Referenced sniff "Drupal" does not exist

Run "phpcs --help" for usage information

  • 1 others

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ff18573 and 9b5cd4c.

⛔ Files ignored due to path filters (1)
  • .vortex/installer/composer.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • .vortex/installer/composer.json (1 hunks)
  • .vortex/installer/src/Prompts/Handlers/ModulePrefix.php (1 hunks)
  • .vortex/installer/src/Prompts/Handlers/Name.php (1 hunks)
  • .vortex/installer/src/Prompts/PromptManager.php (2 hunks)
  • .vortex/installer/tests/Unit/PromptManagerTest.php (23 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: AlexSkrypnyk
PR: drevops/vortex#0
File: :0-0
Timestamp: 2025-05-29T12:15:32.188Z
Learning: Do not review files in `.vortex/installer/tests/Fixtures/install` directory as they are test fixtures.
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Composer dependencies should be updated automatically with compatibility checks
.vortex/installer/composer.json (2)
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-12T00:26:22.700Z
Learning: Composer dependencies should be updated automatically with compatibility checks
Learnt from: AlexSkrypnyk
PR: drevops/vortex#1693
File: .vortex/installer/src/Prompts/Handlers/Internal.php:52-52
Timestamp: 2025-06-01T08:10:15.903Z
Learning: The File utility class in .vortex/installer/src/Utils/File.php extends AlexSkrypnyk\File\File, and methods like collapseRepeatedEmptyLines() are available from this external parent class dependency.
🧬 Code Graph Analysis (2)
.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (1)
.vortex/installer/src/Utils/File.php (1)
  • File (10-120)
.vortex/installer/src/Prompts/PromptManager.php (3)
.vortex/installer/src/Prompts/Handlers/AiCodeInstructions.php (1)
  • AiCodeInstructions (7-71)
.vortex/installer/src/Prompts/Handlers/AbstractHandler.php (1)
  • id (52-62)
.vortex/installer/src/Prompts/Handlers/HandlerInterface.php (1)
  • id (19-19)
⏰ 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). (9)
  • GitHub Check: build (1)
  • GitHub Check: build (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-common
🔇 Additional comments (9)
.vortex/installer/composer.json (1)

32-32: LGTM!

The update to alexskrypnyk/phpunit-helpers from ^0.8.0 to ^0.8.2 is a backward-compatible patch version bump that maintains the same minor version constraint.

.vortex/installer/src/Prompts/Handlers/Name.php (3)

46-47: Good simplification of the default method.

Removing the environment variable fallback and always returning a label based on the destination directory basename makes the behavior more predictable.


54-57: Nice addition of environment-based discovery.

Adding support for discovering the project name from the VORTEX_PROJECT environment variable provides more flexibility for automated installations.


61-62: Improved regex pattern for better compatibility.

The updated regex pattern is more flexible and will match a wider variety of description formats, and the trim() ensures clean output.

.vortex/installer/src/Prompts/Handlers/ModulePrefix.php (1)

57-72: Good extension of module prefix discovery patterns.

The addition of *_core patterns alongside existing *_base patterns provides more flexibility in module naming conventions. The implementation is consistent across all search locations and the suffix stripping logic has been properly updated.

.vortex/installer/src/Prompts/PromptManager.php (1)

112-203: Good refactoring for improved code clarity.

Separating the form building and submission steps makes the code more readable and easier to debug. The addition of the AI code instructions prompt is properly integrated into the existing prompt flow.

.vortex/installer/tests/Unit/PromptManagerTest.php (3)

171-171: Good addition of AI code instructions to default answers.

Including AiCodeInstructions in the default TUI answers ensures consistent test coverage for the new feature.


214-222: Better variable naming for clarity.

Renaming $expected_custom to $expected_discovered more accurately reflects that these are values discovered from environment or configuration sources.


230-1111: Excellent comprehensive test coverage!

The expanded test suite significantly improves coverage with:

  • Valid and invalid input scenarios for each prompt handler
  • Environment-based discovery tests
  • Composer.json discovery tests
  • Edge cases and error conditions
  • Consistent test structure across all handlers

This thorough testing will help prevent regressions and ensure the installer behaves correctly across various scenarios.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai 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

Documentation and Community

  • 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 July 17, 2025 08:46 Inactive
@codecov
Copy link

codecov bot commented Jul 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.32%. Comparing base (6d9554e) to head (9b5cd4c).
Report is 8 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1794      +/-   ##
===========================================
+ Coverage    72.27%   72.32%   +0.05%     
===========================================
  Files           83       83              
  Lines         4685     4694       +9     
  Branches        35       35              
===========================================
+ Hits          3386     3395       +9     
  Misses        1299     1299              

☔ 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 371c10f into develop Jul 17, 2025
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-installer-july-2025 branch July 17, 2025 10:33
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Jul 17, 2025
@AlexSkrypnyk AlexSkrypnyk added this to the 25.7.0 milestone Jul 26, 2025
@AlexSkrypnyk AlexSkrypnyk moved this from Release queue to Released in 25.7.0 in Vortex Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants