Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Jul 22, 2025

Summary by CodeRabbit

  • Chores
    • Improved the installation process for the Lagoon CLI, making downloads more direct and reliable.
    • Added clearer informational messages during the download and installation steps.

@coderabbitai
Copy link

coderabbitai bot commented Jul 22, 2025

Walkthrough

The deployment script for installing the Lagoon CLI was updated to construct the download URL directly based on the system's platform and architecture, instead of querying the GitHub API for release information. Informational notes were added, and the process for downloading and installing the binary was streamlined.

Changes

File(s) Change Summary
scripts/vortex/deploy-lagoon.sh Refactored Lagoon CLI installation logic to construct download URL directly; added informational notes.

Estimated code review effort

1 (~4 minutes)

Poem

🐇
A script now hops, more swiftly so,
No JSON chase, just URLs to go!
It sniffs the arch and platform right,
Then grabs Lagoon in morning light.
With notes to guide each bunny’s quest,
This update surely is the best!
🌊

✨ 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 22, 2025 01:57 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: 3

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1b401df and 1babf0d.

📒 Files selected for processing (1)
  • scripts/vortex/deploy-lagoon.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). (13)
  • GitHub Check: build (0)
  • GitHub Check: build (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-deployment (1)
  • GitHub Check: vortex-test-deployment (0)
  • 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-common
  • GitHub Check: vortex-test-docs

Comment on lines +92 to +94
platform=$(uname -s | tr '[:upper:]' '[:lower:]')
arch_suffix=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Handle unsupported architectures explicitly instead of silently producing a bad URL

If uname -m returns something other than x86_64 or aarch64 (e.g. armv7l, i686, ppc64le), the sed substitution leaves the value untouched, which leads to a 404 download URL and the script will keep going.
Refactor to fail fast (or extend the mapping) so users immediately see a clear error.

-arch_suffix=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
+case "$(uname -m)" in
+  x86_64)  arch_suffix="amd64"  ;;
+  aarch64|arm64) arch_suffix="arm64" ;;
+  *)
+    fail "Unsupported architecture: $(uname -m)"
+    exit 1
+    ;;
+esac

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In scripts/vortex/deploy-lagoon.sh around lines 92 to 94, the architecture
detection uses sed to map uname -m output but does not handle unsupported
architectures, causing invalid URLs and silent failures. Modify the script to
explicitly check if the architecture is one of the supported values (amd64 or
arm64) after substitution, and if not, print a clear error message and exit the
script immediately to fail fast and avoid continuing with a bad URL.

Comment on lines +95 to 98
download_url="https://github.com/uselagoon/lagoon-cli/releases/latest/download/lagoon-cli-${platform}-${arch_suffix}"
if [ "${VORTEX_LAGOONCLI_VERSION}" != "latest" ]; then
lagooncli_download_url="https://api.github.com/repos/uselagoon/lagoon-cli/releases/tags/${VORTEX_LAGOONCLI_VERSION}"
download_url="https://github.com/uselagoon/lagoon-cli/releases/download/${VORTEX_LAGOONCLI_VERSION}/lagoon-cli-${platform}-${arch_suffix}"
fi
Copy link

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

VORTEX_LAGOONCLI_VERSION may need normalisation

The releases are tagged with a leading v (e.g. v2.20.0).
If a user sets VORTEX_LAGOONCLI_VERSION=2.20.0 the constructed URL will 404.
Consider normalising or at least validating the value and warning the user.

🤖 Prompt for AI Agents
In scripts/vortex/deploy-lagoon.sh around lines 95 to 98, the
VORTEX_LAGOONCLI_VERSION variable may lack the required leading 'v' in version
tags, causing the download URL to 404. Add logic to check if
VORTEX_LAGOONCLI_VERSION starts with 'v'; if not, prepend 'v' to normalize it
before constructing the download URL. Optionally, add a warning message if
normalization occurs to inform the user.

Comment on lines +100 to 104
note "Downloading Lagoon CLI from ${download_url}."
curl -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" "${download_url}"

note "Installing Lagoon CLI to ${VORTEX_LAGOONCLI_PATH}/lagoon."
chmod +x "${VORTEX_LAGOONCLI_PATH}/lagoon"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add --fail (or --fail-with-body) to curl to abort on HTTP errors

curl -L returns 0 even for 404/403 responses, so the script can mark an HTML error page executable and continue, ultimately breaking later Lagoon calls. Ensure the download actually succeeds:

-note "Downloading Lagoon CLI from ${download_url}."
-curl -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" "${download_url}"
+note "Downloading Lagoon CLI from ${download_url}."
+# --fail : non-zero exit on HTTP errors; --silent/--show-error for CI cleanliness
+curl --fail --silent --show-error -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" "${download_url}"

Optionally verify the file is non-empty or checksum-verified before chmod.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
note "Downloading Lagoon CLI from ${download_url}."
curl -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" "${download_url}"
note "Installing Lagoon CLI to ${VORTEX_LAGOONCLI_PATH}/lagoon."
chmod +x "${VORTEX_LAGOONCLI_PATH}/lagoon"
note "Downloading Lagoon CLI from ${download_url}."
# --fail : non-zero exit on HTTP errors; --silent/--show-error for CI cleanliness
curl --fail --silent --show-error -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" "${download_url}"
note "Installing Lagoon CLI to ${VORTEX_LAGOONCLI_PATH}/lagoon."
chmod +x "${VORTEX_LAGOONCLI_PATH}/lagoon"
🤖 Prompt for AI Agents
In scripts/vortex/deploy-lagoon.sh around lines 100 to 104, the curl command
used to download the Lagoon CLI lacks the --fail or --fail-with-body option,
causing it to return success even on HTTP errors like 404 or 403. Modify the
curl command to include --fail or --fail-with-body to ensure it aborts on HTTP
errors. Additionally, add a check after the download to verify the file is
non-empty or matches a checksum before running chmod to avoid marking an invalid
file executable.

@codecov
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.

Project coverage is 72.61%. Comparing base (1b401df) to head (1babf0d).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
scripts/vortex/deploy-lagoon.sh 85.71% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1815      +/-   ##
===========================================
+ Coverage    70.15%   72.61%   +2.45%     
===========================================
  Files           84       84              
  Lines         4725     4725              
  Branches        35       35              
===========================================
+ Hits          3315     3431     +116     
+ Misses        1410     1294     -116     

☔ 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 3521043 into develop Jul 22, 2025
37 of 38 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-deployment-test branch July 22, 2025 05:21
@github-project-automation github-project-automation bot moved this from BACKLOG to Release queue in Vortex Jul 22, 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