Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Jul 25, 2025

Summary by CodeRabbit

  • Refactor
    • Improved robustness of command availability checks in multiple scripts by quoting command names during system path verification. This prevents potential issues with command names containing spaces or special characters. No changes to script logic or user-facing behavior.

@coderabbitai
Copy link

coderabbitai bot commented Jul 25, 2025

Walkthrough

This change updates the command existence checks in multiple shell scripts by adding double quotes around the ${cmd} variable in command -v invocations. This adjustment ensures that command names are properly quoted, preventing issues with word splitting or special characters. No additional logic, error handling, or control flow is modified.

Changes

Files (grouped) Change Summary
scripts/vortex/deploy-container-registry.sh,
scripts/vortex/deploy-webhook.sh,
scripts/vortex/download-db-container-registry.sh,
scripts/vortex/download-db-ftp.sh,
scripts/vortex/download-db-url.sh,
scripts/vortex/export-db.sh,
scripts/vortex/login-container-registry.sh,
scripts/vortex/notify-github.sh,
scripts/vortex/notify-newrelic.sh,
scripts/vortex/task-copy-db-acquia.sh,
scripts/vortex/task-copy-files-acquia.sh,
scripts/vortex/task-custom-lagoon.sh,
scripts/vortex/task-purge-cache-acquia.sh,
scripts/vortex/update-vortex.sh
Updated command -v ${cmd} to command -v "${cmd}" in command existence checks; no logic or flow changes.
scripts/vortex/deploy-lagoon.sh,
scripts/vortex/doctor.sh,
scripts/vortex/download-db-acquia.sh,
scripts/vortex/download-db-lagoon.sh,
scripts/vortex/export-db-image.sh,
scripts/vortex/notify-jira.sh,
scripts/vortex/notify-webhook.sh,
scripts/vortex/reset.sh
Same quoting change as above, affecting multi-command checks or scripts with more complex pre-checks.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇
Quoting commands, we hop with care,
Wrapping ${cmd} in double-layered air.
No more splits or globs to fear,
Our scripts run smooth, the path is clear.
With every check, a bunny’s delight—
Robustness shines in shell script night!
🌙✨

Note

⚡️ Unit Test Generation is now available in beta!

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

✨ 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-reqs-check-in-scripts

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

@AlexSkrypnyk AlexSkrypnyk enabled auto-merge (rebase) July 25, 2025 10:58
@github-actions github-actions bot temporarily deployed to commit July 25, 2025 10:59 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

🔭 Outside diff range comments (2)
scripts/vortex/download-db-acquia.sh (1)

59-63: Duplicate command-existence checks – consider DRYing up

You already verify php, curl, and gunzip here. A second standalone command -v curl appears at lines 82-84 (unchanged in this PR), resulting in redundant checks and a minor maintenance smell.

-# Pre-flight checks.
-command -v curl >/dev/null || (fail "curl command is not available." && exit 1)
+# Pre-flight checks handled above (php curl gunzip loop)

Removing the duplicate keeps the script concise while preserving behaviour.

scripts/vortex/task-copy-db-acquia.sh (1)

74-80: Add php to the pre-flight command list

The script invokes PHP in both extract_json_last_value() and extract_json_value() yet the pre-flight loop currently checks only for curl. When PHP is missing the script will fail later at runtime instead of up-front.

-#shellcheck disable=SC2043
-for cmd in curl; do command -v "${cmd}" >/dev/null || {
+#shellcheck disable=SC2043
+for cmd in php curl; do command -v "${cmd}" >/dev/null || {

Adding the extra check keeps the behaviour consistent with other Vortex scripts and surfaces the problem early.

♻️ Duplicate comments (8)
scripts/vortex/login-container-registry.sh (1)

47-51: Identical hardening already covered

Same quoting hardening as noted in deploy-container-registry.sh; feedback applies here too.

scripts/vortex/reset.sh (1)

22-26: Identical hardening already covered

Same quoting hardening as noted earlier; feedback applies here too.

scripts/vortex/notify-newrelic.sh (1)

56-60: Identical hardening already covered

Same quoting hardening as noted earlier; feedback applies here too.

scripts/vortex/update-vortex.sh (1)

44-47: Identical hardening already covered

Same quoting hardening as noted earlier; feedback applies here too.

scripts/vortex/task-copy-files-acquia.sh (1)

53-57: Comment duplicated – see earlier note about command -v --

Exactly the same concern/suggestion applies here.

scripts/vortex/notify-github.sh (1)

52-55: Comment duplicated – see earlier note about command -v --

Same recommendation as in doctor.sh.

scripts/vortex/notify-webhook.sh (1)

48-51: Comment duplicated – see earlier note about command -v --

Same recommendation as in doctor.sh.

scripts/vortex/export-db-image.sh (1)

40-43: Comment duplicated – see earlier note about command -v --

Same recommendation as in doctor.sh.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 66ebea6 and 73bbe01.

📒 Files selected for processing (22)
  • scripts/vortex/deploy-container-registry.sh (1 hunks)
  • scripts/vortex/deploy-lagoon.sh (1 hunks)
  • scripts/vortex/deploy-webhook.sh (1 hunks)
  • scripts/vortex/doctor.sh (1 hunks)
  • scripts/vortex/download-db-acquia.sh (1 hunks)
  • scripts/vortex/download-db-container-registry.sh (1 hunks)
  • scripts/vortex/download-db-ftp.sh (1 hunks)
  • scripts/vortex/download-db-lagoon.sh (1 hunks)
  • scripts/vortex/download-db-url.sh (1 hunks)
  • scripts/vortex/export-db-image.sh (1 hunks)
  • scripts/vortex/export-db.sh (1 hunks)
  • scripts/vortex/login-container-registry.sh (1 hunks)
  • scripts/vortex/notify-github.sh (1 hunks)
  • scripts/vortex/notify-jira.sh (1 hunks)
  • scripts/vortex/notify-newrelic.sh (1 hunks)
  • scripts/vortex/notify-webhook.sh (1 hunks)
  • scripts/vortex/reset.sh (1 hunks)
  • scripts/vortex/task-copy-db-acquia.sh (1 hunks)
  • scripts/vortex/task-copy-files-acquia.sh (1 hunks)
  • scripts/vortex/task-custom-lagoon.sh (1 hunks)
  • scripts/vortex/task-purge-cache-acquia.sh (1 hunks)
  • scripts/vortex/update-vortex.sh (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). (12)
  • GitHub Check: build (0)
  • GitHub Check: build (1)
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-deployment (1)
🔇 Additional comments (12)
scripts/vortex/deploy-container-registry.sh (1)

45-49: Quote addition prevents word-splitting – solid hardening

command -v "${cmd}" avoids edge-case word splitting/globbing and is shell-portable. No further changes needed.

scripts/vortex/download-db-container-registry.sh (1)

38-42: Quoting in command -v hardens the availability check – looks good

Adding quotes around ${cmd} eliminates any edge-case breakage from word-splitting or globs. No further issues spotted in this hunk.

scripts/vortex/deploy-lagoon.sh (1)

123-127: Consistent quoting improves robustness of the prerequisite check

Same positive change as in the other scripts; prevents accidental splitting if a command name were ever to contain spaces (unlikely but correct practice). 👍

scripts/vortex/download-db-lagoon.sh (1)

80-83: Good defensive shell practice applied

The loop now uses command -v "${cmd}", closing a subtle shell-safety gap. Implementation is correct.

scripts/vortex/export-db.sh (1)

32-35: Availability check quoting fixed

Quoting ${cmd} removes a shell-parsing pitfall. Change is sound.

scripts/vortex/notify-jira.sh (1)

57-60: Prerequisite detection made shell-safe

The quoted form of command -v is the right pattern; no other issues in this snippet.

scripts/vortex/task-custom-lagoon.sh (1)

90-93: Robustness improved by quoting ${cmd}

Quoting the loop variable eliminates word-splitting/globbing edge-cases. No further issues spotted in this hunk.

scripts/vortex/download-db-url.sh (1)

35-38: Correct quoting applied in command check

Good catch – the check is now safe against names containing spaces/special chars.

scripts/vortex/download-db-ftp.sh (1)

46-49: Command check hardened

The quoting fix looks correct and fully resolves the shellcheck SC2046 concern.

scripts/vortex/deploy-webhook.sh (1)

34-37: Safer ${cmd} lookup

Change is straightforward and correct.

scripts/vortex/task-copy-db-acquia.sh (1)

74-80: Quoting fix is correct

The newly added quotes around ${cmd} are a no-op for simple command names but make the loop safe against word-splitting or wildcards. Nice catch.

scripts/vortex/task-purge-cache-acquia.sh (1)

53-57: Quoted variable improves robustness — nothing else to change

The added quotes around ${cmd} make the existence check immune to accidental globbing/IFS issues. The command list already includes both php and curl, so the loop now meets best-practice expectations.

Comment on lines +76 to 79
for cmd in docker pygmy ahoy; do command -v "${cmd}" >/dev/null || {
fail "Command ${cmd} is not available"
exit 1
}; done
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Prefer command -v -- for full POSIX-safety

Quoting ${cmd} is the right call. One tiny follow-up is to pass -- so that an unlikely command name starting with - can’t be interpreted as an option by command.

-for cmd in docker pygmy ahoy; do command -v "${cmd}" >/dev/null || {
+for cmd in docker pygmy ahoy; do command -v -- "${cmd}" >/dev/null || {
🤖 Prompt for AI Agents
In scripts/vortex/doctor.sh around lines 76 to 79, the command check loop uses
`command -v "${cmd}"` but lacks the `--` option for POSIX safety. Update the
command to `command -v -- "${cmd}"` to ensure that any command names starting
with a dash are not misinterpreted as options, preserving correct behavior and
robustness.

@codecov
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

❌ Patch coverage is 59.09091% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.09%. Comparing base (66ebea6) to head (73bbe01).
⚠️ Report is 6 commits behind head on develop.

Files with missing lines Patch % Lines
scripts/vortex/doctor.sh 0.00% 1 Missing ⚠️
scripts/vortex/download-db-acquia.sh 0.00% 1 Missing ⚠️
scripts/vortex/download-db-container-registry.sh 0.00% 1 Missing ⚠️
scripts/vortex/download-db-ftp.sh 0.00% 1 Missing ⚠️
scripts/vortex/download-db-lagoon.sh 0.00% 1 Missing ⚠️
scripts/vortex/task-copy-db-acquia.sh 0.00% 1 Missing ⚠️
scripts/vortex/task-copy-files-acquia.sh 0.00% 1 Missing ⚠️
scripts/vortex/task-custom-lagoon.sh 0.00% 1 Missing ⚠️
scripts/vortex/task-purge-cache-acquia.sh 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1841   +/-   ##
========================================
  Coverage    74.09%   74.09%           
========================================
  Files           84       84           
  Lines         4830     4830           
  Branches        35       35           
========================================
  Hits          3579     3579           
  Misses        1251     1251           

☔ 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 disabled auto-merge July 25, 2025 11:22
@AlexSkrypnyk AlexSkrypnyk enabled auto-merge (rebase) July 25, 2025 11:22
@AlexSkrypnyk AlexSkrypnyk disabled auto-merge July 25, 2025 11:22
@AlexSkrypnyk AlexSkrypnyk merged commit a3ac6dc into develop Jul 25, 2025
29 of 30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-reqs-check-in-scripts branch July 25, 2025 11:22
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Jul 25, 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