[INFRA-1039] - fix(deployments): find the latest release when the GitHub API returns compact JSON - #9916
[INFRA-1039] - fix(deployments): find the latest release when the GitHub API returns compact JSON#9916akshat5302 wants to merge 1 commit into
Conversation
… compact JSON
install.sh and swarm.sh grep for '"tag_name": "' with a space, but the
GitHub API now returns '"tag_name":"v1.4.2"', so the lookup is empty.
Allow optional whitespace after the colon.
The exit 1 in checkLatestRelease runs inside $(...), so it only left the
subshell and install carried on with an empty APP_RELEASE ("invalid
reference format"). Exit at the call sites when the lookup fails.
Co-Authored-By: WOZCODE <contact@withwoz.com>
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe CLI installer and Swarm script now accept optional whitespace in release-tag JSON and stop when release lookup fails during install, deploy, or upgrade operations. ChangesCommunity release lookup
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The updated scripts handle the reported release-tag spacing and stop affected operations when lookup fails. No actionable merge risk remains in the reviewed changes. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation The changes satisfy the release lookup requirement in [
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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.
Copilot review overview
🟢 Approval recommended
The parser handles both JSON formats, and failed lookups now terminate all affected call paths.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes release detection and failure handling for Community installers using compact GitHub API JSON.
Changes:
- Supports compact and spaced
tag_nameJSON. - Stops installation or upgrade when release lookup fails.
| File | Description |
|---|---|
deployments/cli/community/install.sh |
Fixes Compose installer release lookup and error propagation. |
deployments/swarm/community/swarm.sh |
Applies equivalent fixes to Swarm deployment flows. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
The Community Docker Compose installer (
deployments/cli/community/install.sh) and the Swarm script (deployments/swarm/community/swarm.sh) can't find the latest release, so a fresh install withAPP_RELEASE=stablefails.grep -o '"tag_name": "[^"]*"', which expects a space after the colon. The GitHub API now returns compact JSON ("tag_name":"v1.4.2"), so the result is empty. The pattern now allows optional whitespace ("tag_name": *"), so it handles both formats.checkLatestReleasecallsexit 1, but it runs inside$(...), so that only exits the subshell.installcarried on with an emptyAPP_RELEASE, producingX86_64 images are not available for selected release ()and theninvalid reference format. The call sites nowexit 1when the lookup fails. (export VAR=$(...)andlocal var=$(...)hide the exit status, so the assignments are split out.)Type of Change
Test Scenarios
bash -npasses for both scripts.checkLatestReleasefrom each script against the live API: returnsv1.4.2. With the old pattern it returns an empty string."tag_name":"v1.4.2") and pretty-printed ("tag_name": "v1.4.2") JSON: both returnv1.4.2.References
Fixes #8841
Fixes #9745
Fixes #9199
🧙 Built with WOZCODE
Summary by CodeRabbit