Skip to content

Conversation

@AlexSkrypnyk
Copy link
Member

@AlexSkrypnyk AlexSkrypnyk commented Jul 25, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Updated the default Lagoon CLI version used in deployment and task scripts from "latest" to "v0.32.0" for improved stability and consistency.
    • Simplified and improved the reliability of the Lagoon CLI download process during deployments and custom tasks.
  • Documentation
    • Updated documentation to reflect the new default Lagoon CLI version.

@coderabbitai
Copy link

coderabbitai bot commented Jul 25, 2025

Walkthrough

The default Lagoon CLI version was updated from "latest" to "v0.32.0" across documentation and deployment scripts. The scripts for deploying and running custom tasks were refactored to simplify and standardize the download logic for the Lagoon CLI binary, removing dynamic version detection and JSON parsing in favor of direct URL construction.

Changes

File(s) Change Summary
.vortex/docs/content/workflows/variables.mdx Updated default value of VORTEX_LAGOONCLI_VERSION from latest to v0.32.0.
scripts/vortex/deploy-lagoon.sh Changed default Lagoon CLI version to v0.32.0; simplified download URL logic; updated curl flags for download.
scripts/vortex/task-custom-lagoon.sh Changed default Lagoon CLI version to v0.32.0; replaced JSON-based URL lookup with direct URL construction.

Sequence Diagram(s)

sequenceDiagram
    participant Script as Deploy/Task Script
    participant GitHub as GitHub Releases
    participant System as Local System

    Script->>System: Detect platform and architecture
    Script->>Script: Construct Lagoon CLI download URL with version v0.32.0
    Script->>GitHub: Download Lagoon CLI binary
    GitHub-->>Script: Serve binary file
    Script->>System: Make binary executable and update PATH
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

A bunny hopped through scripts today,
Swapping "latest" for a tag—hooray!
No more guessing which CLI to fetch,
Now "v0.32.0" is the version we etch.
With simpler curls and URLs anew,
Deployment’s a breeze—thanks to this crew!
🐇✨

✨ 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-lagoon-cli-download

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

@codecov
Copy link

codecov bot commented Jul 25, 2025

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.05%. Comparing base (1455d55) to head (6e76309).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
scripts/vortex/task-custom-lagoon.sh 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1843      +/-   ##
===========================================
+ Coverage    75.01%   75.05%   +0.04%     
===========================================
  Files           84       84              
  Lines         4839     4835       -4     
  Branches        35       35              
===========================================
- Hits          3630     3629       -1     
+ Misses        1209     1206       -3     

☔ 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-lagoon-cli-download branch from 15a76c7 to 6e76309 Compare July 25, 2025 12:17
@github-actions github-actions bot temporarily deployed to commit July 25, 2025 12:19 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

♻️ Duplicate comments (1)
scripts/vortex/task-custom-lagoon.sh (1)

50-52: Same version-pin concern as in deploy script

Keep an eye on manual version bumps here as well; the two scripts must stay aligned.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1455d55 and 6e76309.

📒 Files selected for processing (3)
  • .vortex/docs/content/workflows/variables.mdx (1 hunks)
  • scripts/vortex/deploy-lagoon.sh (2 hunks)
  • scripts/vortex/task-custom-lagoon.sh (2 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 (1)
  • GitHub Check: build (0)
  • GitHub Check: vortex-test-deployment (1)
  • GitHub Check: vortex-test-workflow (1)
  • GitHub Check: vortex-test-workflow (2)
  • GitHub Check: vortex-test-workflow (3)
  • GitHub Check: vortex-test-workflow (0)
  • GitHub Check: vortex-test-deployment (0)
  • GitHub Check: vortex-test-common
  • GitHub Check: vortex-test-installer (8.3)
  • GitHub Check: vortex-test-installer (8.2)
  • GitHub Check: vortex-test-installer (8.4)
  • GitHub Check: vortex-test-docs
🔇 Additional comments (2)
.vortex/docs/content/workflows/variables.mdx (1)

1192-1198: Pinning the default Lagoon CLI version means manual bumps in the future

Moving from latest to a hard-coded tag (v0.32.0) stabilises builds, but remember the trade-off: every CLI release now requires a coordinated commit to keep scripts & docs in sync.
Consider adding a short note here (or in the README) telling maintainers how/when to update this value to avoid silent drift.

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

68-70: Hard-coding the CLI version may break consumers that rely on “latest”

If a downstream environment still sets VORTEX_LAGOONCLI_VERSION=latest, the new default will silently override it to v0.32.0.
Double-check that no CI jobs / local setups depend on auto-upgrading to the newest CLI.

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

download_url="https://github.com/uselagoon/lagoon-cli/releases/latest/download/lagoon-cli-${platform}-${arch_suffix}"
if [ "${VORTEX_LAGOONCLI_VERSION}" != "latest" ]; then
download_url="https://github.com/uselagoon/lagoon-cli/releases/download/${VORTEX_LAGOONCLI_VERSION}/lagoon-cli-${platform}-${arch_suffix}"
fi
download_url="https://github.com/uselagoon/lagoon-cli/releases/download/${VORTEX_LAGOONCLI_VERSION}/lagoon-cli-${VORTEX_LAGOONCLI_VERSION}-${platform}-${arch_suffix}"

note "Downloading Lagoon CLI from ${download_url}."
curl -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon" "${download_url}"
curl -fSLs -o "${VORTEX_LAGOONCLI_PATH}/lagoon" "${download_url}"

Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Download URL construction assumes the binary is shipped plain, not .tar.gz

The asset pattern is:
https://github.com/uselagoon/lagoon-cli/releases/download/${ver}/lagoon-cli-${ver}-${os}-${arch}

For some older/newer releases GitHub publishes …​.tar.gz archives instead of raw binaries. If that happens the curl will fetch a gzipped file, mark it executable, and execve will fail with “Exec format error”.

Recommend adding a quick mime/extension check & fallback to *.tar.gz extraction:

- download_url="https://github.com/uselagoon/lagoon-cli/releases/download/${VORTEX_LAGOONCLI_VERSION}/lagoon-cli-${VORTEX_LAGOONCLI_VERSION}-${platform}-${arch_suffix}"
+base="https://github.com/uselagoon/lagoon-cli/releases/download/${VORTEX_LAGOONCLI_VERSION}"
+for candidate in \
+  "lagoon-cli-${VORTEX_LAGOONCLI_VERSION}-${platform}-${arch_suffix}" \
+  "lagoon-cli-${VORTEX_LAGOONCLI_VERSION}-${platform}-${arch_suffix}.tar.gz"; do
+  if curl --head -fsSL "${base}/${candidate}" >/dev/null; then
+    download_url="${base}/${candidate}"
+    break
+  fi
+done
+
+[[ -z "${download_url:-}" ]] && fail "Unable to locate Lagoon CLI asset" && exit 1

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

🤖 Prompt for AI Agents
In scripts/vortex/deploy-lagoon.sh around lines 107 to 113, the download URL
assumes the Lagoon CLI binary is a plain executable, but some releases provide a
.tar.gz archive instead. To fix this, after downloading, check if the file is a
gzip archive by inspecting its mime type or file extension. If it is a .tar.gz,
extract the binary from the archive to the target path instead of using the
downloaded file directly. This ensures the executable is valid and prevents exec
format errors.

Comment on lines +76 to 84
platform=$(uname -s | tr '[:upper:]' '[:lower:]')
arch_suffix=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
download_url="https://github.com/uselagoon/lagoon-cli/releases/download/${VORTEX_LAGOONCLI_VERSION}/lagoon-cli-${VORTEX_LAGOONCLI_VERSION}-${platform}-${arch_suffix}"

curl -sL "${lagooncli_download_url}" |
grep "browser_download_url" |
grep -i "$(uname -s)-amd64\"$" |
cut -d '"' -f 4 |
xargs curl -L -o "${VORTEX_LAGOONCLI_PATH}/lagoon"
note "Downloading Lagoon CLI from ${download_url}."
curl -fSLs -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.

🧹 Nitpick (assertive)

Duplicated installer logic – consider extracting into a helper

deploy-lagoon.sh and task-custom-lagoon.sh now carry identical 20-line blocks for platform detection, URL building, download & chmod. Moving this into scripts/vortex/_install-lagoon-cli.sh (or similar) would DRY the code and ensure future fixes are applied once.

No functional blocker, just a maintainability win.

🤖 Prompt for AI Agents
In scripts/vortex/task-custom-lagoon.sh around lines 76 to 84, the code for
platform detection, URL construction, downloading, and setting permissions for
the Lagoon CLI is duplicated from deploy-lagoon.sh. To improve maintainability,
extract this repeated installer logic into a new helper script, such as
scripts/vortex/_install-lagoon-cli.sh, and replace the duplicated block in both
scripts with a call to this helper. This will centralize the installation logic
and simplify future updates.

@AlexSkrypnyk AlexSkrypnyk merged commit e2689a1 into develop Jul 25, 2025
29 of 30 checks passed
@AlexSkrypnyk AlexSkrypnyk deleted the feature/fix-lagoon-cli-download branch July 25, 2025 14:26
@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