Fix release tag parsing to tolerate spaces around JSON colon - #9571
Fix release tag parsing to tolerate spaces around JSON colon#9571davidmz wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThe release tag parsers in the CLI and Swarm deployment scripts now accept optional whitespace around the ChangesRelease tag parsing
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Pull request overview
This pull request fixes release version detection in the Community CLI and Swarm installation scripts by making the tag_name extraction tolerant of optional spaces around the JSON colon, preventing failures when the GitHub Releases API returns minified JSON.
Changes:
- Update
grep/sedpatterns to match both"tag_name": "vX.Y.Z"and"tag_name":"vX.Y.Z"formats. - Apply the same parsing fix consistently to both the CLI installer and Swarm installer scripts.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| deployments/swarm/community/swarm.sh | Relax tag_name JSON matching to allow optional spaces around : when extracting the latest release tag. |
| deployments/cli/community/install.sh | Relax tag_name JSON matching to allow optional spaces around : when extracting the latest release tag. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
deployments/cli/community/install.sh (1)
60-60: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winHandle release API failures before parsing.
Both scripts assign the pipeline directly through
local, which masks command status. Capture and validate thecurlresponse before extractingtag_name.
deployments/cli/community/install.sh#L60-L60: declarelatest_releaseseparately and handle a failedcurlrequest before parsing.deployments/swarm/community/swarm.sh#L41-L41: apply the same command-status handling.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@deployments/cli/community/install.sh` at line 60, Update deployments/cli/community/install.sh at line 60 and deployments/swarm/community/swarm.sh at line 41 so latest_release is declared separately, the curl response is captured and its command status is checked before parsing tag_name, and parsing proceeds only after a successful request.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@deployments/cli/community/install.sh`:
- Line 60: Update deployments/cli/community/install.sh at line 60 and
deployments/swarm/community/swarm.sh at line 41 so latest_release is declared
separately, the curl response is captured and its command status is checked
before parsing tag_name, and parsing proceeds only after a successful request.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: dad8c747-5c67-4de6-be80-553e9f893bea
📒 Files selected for processing (2)
deployments/cli/community/install.shdeployments/swarm/community/swarm.sh
Description
Fix release version detection in the Community CLI and Swarm installation scripts.
The GitHub Releases API may return JSON without spaces after
:(for example,"tag_name":"v1.4.1"), while the existing pattern expected"tag_name": "v1.4.1"exactly. As a result, the latest release could not be detected and installation failed with an empty image tag.Updated the patterns in:
deployments/cli/community/install.shdeployments/swarm/community/swarm.shThe new patterns allow optional spaces around
:.Type of Change
Screenshots and Media (if applicable)
N/A
Test Scenarios
Verified release detection with both JSON formatting variants:
and:
Confirmed that both scripts correctly extract
v1.4.1.Summary by CodeRabbit