fix: use python3 JSON parser in checkLatestRelease() instead of grep#8808
fix: use python3 JSON parser in checkLatestRelease() instead of grep#8808vijaygovindaraja wants to merge 2 commits intomakeplane:previewfrom
Conversation
The grep pattern `"tag_name": "[^"]*"` assumes a space after the colon in the GitHub API JSON response. When GitHub returns compact/minified JSON without spaces, the pattern fails and the install script aborts with "Failed to check for the latest release." Replace grep+sed with python3's json module which handles both compact and formatted JSON reliably. python3 is already a prerequisite for the Docker setup scripts. Applied to both install.sh (CLI) and swarm.sh (Docker Swarm). Closes makeplane#8775
|
Vijay Govindarajan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughUpdated two deployment shell scripts to use Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@deployments/cli/community/install.sh`:
- Line 60: The script currently assumes python3 exists and assigns in one step
which masks command failures; modify the install flow by first checking for
python3 (e.g., test -x "$(command -v python3)" and emit a clear error if
missing) and then split the declaration and assignment for latest_release:
declare local latest_release on its own then assign the output of the
curl|python3 pipeline to it (so failures are visible and SC2155 is avoided).
Apply the identical change to the other occurrence referenced in
deployments/swarm/community/swarm.sh at the line that sets latest_release.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ce46a28b-a5ed-4e81-9321-878153f351e7
📒 Files selected for processing (2)
deployments/cli/community/install.shdeployments/swarm/community/swarm.sh
- Add explicit `command -v python3` check with clear error message - Separate `local` declaration from assignment (SC2155) - Use `-fsSL` curl flags and quote the URL - Quote `$latest_release` in echo Addresses review feedback from CodeRabbit.
Closes #8775
Summary
checkLatestRelease()uses a grep pattern that assumes spaces after colons in GitHub API JSON responses. When GitHubreturns compact/minified JSON, the pattern fails and the install script aborts.
Fix
Replace
grep+sedwithpython3 -c "import sys,json; print(json.load(sys.stdin)['tag_name'])"which handles bothcompact and formatted JSON.
python3is already a prerequisite for the Docker setup.Applied to both:
deployments/cli/community/install.shdeployments/swarm/community/swarm.shVerification