-
-
Notifications
You must be signed in to change notification settings - Fork 150
fix the download url in install script #1397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Script
participant GitHub API
User->>Script: Run download.sh
Script->>Script: Detect OS and CPU architecture
Script->>Script: Validate supported platform and architecture
Script->>GitHub API: Fetch latest release tag
GitHub API-->>Script: Return release tag
Script->>Script: Construct download URL with binary prefix
Script->>User: Print download URL
Script->>Script: Download binary (curl or wget) with error checks
Script->>Script: Append binary path to PATH in shell RC file
Script->>Script: Source shell RC file to refresh environment
Script->>User: Output success or error message
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🔭 Outside diff range comments (1)
scripts/download.sh (1)
15-17
:uname -s
→windows
mapping is unreliable on Git Bash / MSYS
uname -s
on Windows commonly returns strings likeMINGW64_NT-10.0-19045
, not “windows”.
A simple lowercase transform therefore fails the supported-OS check.-OS=$(uname -s | tr '[:upper:]' '[:lower:]') +raw_os=$(uname -s) +case "${raw_os}" in + Linux*) OS=linux ;; + Darwin*) OS=darwin ;; + MINGW*|MSYS*|CYGWIN*) OS=windows ;; + *) OS=$(echo "${raw_os}" | tr '[:upper:]' '[:lower:]') ;; +esacThis normalises the typical Windows variants and preserves existing behaviour for Linux/macOS.
🧹 Nitpick comments (1)
scripts/download.sh (1)
108-110
: PATH export may be duplicated on re-runsEach execution blindly appends
export PATH=…
to the RC file, producing multiple identical lines.
Before appending, grep the file for the string or wrap the stanza with a marker comment to avoid clutter.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/download.sh
(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: in the parseable project, the linux-specific environment variables (pkg_config_path, sasl2_dir, open...
Learnt from: nikhilsinhaparseable
PR: parseablehq/parseable#1302
File: .github/workflows/build.yaml:170-175
Timestamp: 2025-04-26T03:58:02.341Z
Learning: In the parseable project, the Linux-specific environment variables (PKG_CONFIG_PATH, SASL2_DIR, OPENSSL_DIR, OPENSSL_ROOT_DIR, SASL2_STATIC) in the Kafka build step of GitHub Actions workflows don't cause issues for macOS builds and can safely be applied to both platforms.
Applied to files:
scripts/download.sh
⏰ 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). (10)
- GitHub Check: Build Default x86_64-pc-windows-msvc
- GitHub Check: Build Default x86_64-unknown-linux-gnu
- GitHub Check: coverage
- GitHub Check: Build Default aarch64-unknown-linux-gnu
- GitHub Check: Build Default aarch64-apple-darwin
- GitHub Check: Build Default x86_64-apple-darwin
- GitHub Check: Build Kafka x86_64-unknown-linux-gnu
- GitHub Check: Build Kafka aarch64-apple-darwin
- GitHub Check: Quest Smoke and Load Tests for Standalone deployments
- GitHub Check: Quest Smoke and Load Tests for Distributed deployments
There was a problem hiding this 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
🧹 Nitpick comments (2)
scripts/download.sh (2)
43-46
: Usejq
to extract the tag name, fail fast on network errors
grep | cut
is brittle if GitHub changes its JSON formatting.
curl -f
already aborts on HTTP errors; pipe directly tojq
for robustness:release_tag=$(curl -fsSL \ https://api.github.com/repos/parseablehq/parseable/releases/latest | jq -r '.tag_name') if [[ -z "$release_tag" || "$release_tag" == "null" ]]; then echo "Error: could not determine the latest release"; exit 1 fiRequires adding
jq
to prerequisites (most macOS/Linux users already have it via package managers).
101-103
: Avoid sourcing a potentially enormous rc file inside the installer
source ${RC_FILE_PATH}
executes arbitrary user configuration and may produce side-effects or prompt for input in non-interactive installs.Prefer instructing the user to
exec $SHELL
or reopen their terminal instead of auto-sourcing:echo "Add '${BIN_DIR}' to PATH by running: source ${RC_FILE_PATH} or start a new shell session."
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
scripts/download.sh
(4 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: in the parseable project, the linux-specific environment variables (pkg_config_path, sasl2_dir, open...
Learnt from: nikhilsinhaparseable
PR: parseablehq/parseable#1302
File: .github/workflows/build.yaml:170-175
Timestamp: 2025-04-26T03:58:02.341Z
Learning: In the parseable project, the Linux-specific environment variables (PKG_CONFIG_PATH, SASL2_DIR, OPENSSL_DIR, OPENSSL_ROOT_DIR, SASL2_STATIC) in the Kafka build step of GitHub Actions workflows don't cause issues for macOS builds and can safely be applied to both platforms.
Applied to files:
scripts/download.sh
⏰ 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 Default aarch64-unknown-linux-gnu
- GitHub Check: Build Default x86_64-pc-windows-msvc
- GitHub Check: Build Default x86_64-apple-darwin
- GitHub Check: Build Default x86_64-unknown-linux-gnu
- GitHub Check: Build Kafka aarch64-apple-darwin
- GitHub Check: Build Kafka x86_64-unknown-linux-gnu
- GitHub Check: coverage
- GitHub Check: Quest Smoke and Load Tests for Standalone deployments
- GitHub Check: Quest Smoke and Load Tests for Distributed deployments
🔇 Additional comments (1)
scripts/download.sh (1)
85-92
: Extract the tarball and verify the binary before advertising successAfter the previous fix, you will have a
*.tar.gz
.
Before printing “successfully installed”, add:tar -xf "${BIN_NAME}${ASSET_EXT}" -C "${BIN_DIR}" parseable || { echo "Error: failed to extract binary"; exit 1; } rm "${BIN_NAME}${ASSET_EXT}"Also run a trivial smoke test (
"${BIN_DIR}/parseable" --version
) and abort if it fails.
Summary by CodeRabbit
New Features
Bug Fixes
Chores