Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Aug 6, 2025

Summary by CodeRabbit

  • Chores
    • Improved the reliability and readability of the database connection command used for local development workflows. No visible changes to end-user features.

@coderabbitai
Copy link

coderabbitai bot commented Aug 6, 2025

Walkthrough

The update modifies the db command in the .ahoy.yml file by simplifying how the VORTEX_HOST_DB_PORT variable is assigned. It replaces a complex subshell command with a more direct docker compose port command, leaving the rest of the command logic unchanged.

Changes

Cohort / File(s) Change Summary
Database Port Assignment Simplification
.ahoy.yml
Simplified the assignment of the VORTEX_HOST_DB_PORT variable in the db command, using docker compose port database 3306 instead of a subshell with docker port. No changes to command logic or public interfaces.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

A hop and a skip, the port is now clear,
No more subshell tangles to fear.
With a single compose, the number appears—
Simpler commands bring bunny cheers!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 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 cee401d and 7585b22.

⛔ Files ignored due to path filters (1)
  • .vortex/installer/tests/Fixtures/install/_baseline/.ahoy.yml is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (1)
  • .ahoy.yml (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: drevops/vortex#0
File: CLAUDE.md:0-0
Timestamp: 2025-08-06T00:44:35.036Z
Learning: Docker images are updated for containers as part of dependency management
📚 Learning: in the vortex project, unauthenticated composer installs should be allowed, so github token secrets ...
Learnt from: AlexSkrypnyk
PR: drevops/vortex#1816
File: .docker/cli.dockerfile:72-76
Timestamp: 2025-07-23T01:16:30.963Z
Learning: In the Vortex project, unauthenticated Composer installs should be allowed, so GitHub token secrets should not be marked as `required=true` in Docker build mounts. The conditional check `if [ -s /run/secrets/github_token ]` is the preferred approach to allow builds to proceed without a token when needed.

Applied to files:

  • .ahoy.yml
⏰ 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). (13)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-docs
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/ahoy-db-consistent-port

🪧 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.
  • 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.

Support

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

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 generate unit tests to generate unit tests for 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 August 6, 2025 00:37 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: 2

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e2c640d and cee401d.

⛔ Files ignored due to path filters (1)
  • .vortex/installer/tests/Fixtures/install/_baseline/.ahoy.yml is excluded by !.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (2)
  • .ahoy.yml (2 hunks)
  • .vortex/installer/src/Prompts/Handlers/Services.php (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: do not review files in `.vortex/installer/tests/fixtures/install` directory as they are test fixture...
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.

Applied to files:

  • .vortex/installer/src/Prompts/Handlers/Services.php
⏰ 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). (13)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-common
  • 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 (1)
.ahoy.yml (1)

133-137: Formatting tweak acknowledged

Indentation/line-continuation adjustments only; behaviour is unchanged and still coherent with the surrounding chain.

Comment on lines 46 to 48
uname -a | grep -i -q darwin && mdfind -name 'Sequel Ace' 2>/dev/null |grep -q "Ace" && \
VORTEX_HOST_DB_PORT=$(docker compose port database 3306 2>/dev/null | cut -d : -f 2) && \
open "mysql://${DATABASE_USERNAME:-drupal}:${DATABASE_PASSWORD:-drupal}@127.0.0.1:${VORTEX_HOST_DB_PORT}/drupal" -a "Sequel Ace" \
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Guard against empty / multi-line docker compose port output before launching Sequel Ace

docker compose port … 3306 may return zero or multiple lines (IPv4 & IPv6).
If it returns nothing (e.g., database container not running) open will still execute with an empty port, succeed (exit 0) and silently skip the fallback message.
Capturing the first line and validating the port avoids this silent failure.

-      VORTEX_HOST_DB_PORT=$(docker compose port database 3306 2>/dev/null | cut -d : -f 2) && \
-      open "mysql://${DATABASE_USERNAME:-drupal}:${DATABASE_PASSWORD:-drupal}@127.0.0.1:${VORTEX_HOST_DB_PORT}/drupal" -a "Sequel Ace" \
+      VORTEX_HOST_DB_PORT=$(docker compose port database 3306 2>/dev/null | head -n1 | cut -d : -f 2) && \
+      if [ -n "${VORTEX_HOST_DB_PORT}" ]; then \
+        open "mysql://${DATABASE_USERNAME:-drupal}:${DATABASE_PASSWORD:-drupal}@127.0.0.1:${VORTEX_HOST_DB_PORT}/drupal" -a "Sequel Ace"; \
+      else \
+        echo "Database container is not running – unable to determine host port."; \
+      fi \
🤖 Prompt for AI Agents
In the .ahoy.yml file around lines 46 to 48, the command uses `docker compose
port database 3306` which can return empty or multiple lines, causing the open
command to run with an invalid or empty port. To fix this, capture only the
first line of the port output, check if it is non-empty and valid before
proceeding to run the open command. Add a guard condition to ensure the port
variable is set and valid to prevent silent failures when the database container
is not running or multiple ports are returned.

Comment on lines 129 to 131
File::removeLine($t . DIRECTORY_SEPARATOR . '.ahoy.yml', 'VORTEX_HOST_SOLR_PORT=$(docker compose port solr 8983 2>/dev/null | cut -d : -f 2) && \\');
// @todo Remove after 25.10.0 release.
File::removeLine($t . DIRECTORY_SEPARATOR . '.ahoy.yml', 'VORTEX_HOST_SOLR_PORT=$(docker compose port solr 8983 2>/dev/null | cut -d : -f 2) \\');
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Duplicate literal patterns – consider a single regex

Two almost-identical File::removeLine() calls differ only by the trailing && \.
Using one regex (or trimming whitespace before comparison) would be more future-proof and avoid drift if the line changes again.

File::removeLine(
  $t . DIRECTORY_SEPARATOR . '.ahoy.yml',
  '/VORTEX_HOST_SOLR_PORT=\$\(docker compose port solr 8983 .* cut -d : -f 2\).*\\\\?/'
);
🤖 Prompt for AI Agents
In .vortex/installer/src/Prompts/Handlers/Services.php around lines 129 to 131,
there are two File::removeLine calls with nearly identical string patterns
differing only by a trailing '&& \'. Replace these two calls with a single
File::removeLine call using a regex pattern that matches both variants, such as
one that matches the line starting with 'VORTEX_HOST_SOLR_PORT=$(docker compose
port solr 8983' and optionally ends with '&& \' or '\'. This will make the code
more maintainable and prevent issues if the line changes in the future.

@github-actions github-actions bot added the CONFLICT Pull request has a conflict that needs to be resolved before it can be merged label Aug 6, 2025
@codecov
Copy link

codecov bot commented Aug 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.37%. Comparing base (d8d349f) to head (7585b22).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1884   +/-   ##
========================================
  Coverage    78.37%   78.37%           
========================================
  Files           85       85           
  Lines         5003     5003           
  Branches        35       35           
========================================
  Hits          3921     3921           
  Misses        1082     1082           

☔ 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/ahoy-db-consistent-port branch from cee401d to 7585b22 Compare August 6, 2025 01:23
@github-actions github-actions bot removed the CONFLICT Pull request has a conflict that needs to be resolved before it can be merged label Aug 6, 2025
@AlexSkrypnyk AlexSkrypnyk enabled auto-merge (rebase) August 6, 2025 01:24
@github-actions github-actions bot temporarily deployed to commit August 6, 2025 01:26 Inactive
@AlexSkrypnyk AlexSkrypnyk merged commit cb7934b into develop Aug 6, 2025
30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/ahoy-db-consistent-port branch August 6, 2025 01:41
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Aug 6, 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