Skip to content

Fix release tag parsing to tolerate spaces around JSON colon - #9571

Open
davidmz wants to merge 1 commit into
makeplane:previewfrom
davidmz:davidmz-patch-1
Open

Fix release tag parsing to tolerate spaces around JSON colon#9571
davidmz wants to merge 1 commit into
makeplane:previewfrom
davidmz:davidmz-patch-1

Conversation

@davidmz

@davidmz davidmz commented Aug 9, 2026

Copy link
Copy Markdown

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.sh
  • deployments/swarm/community/swarm.sh

The new patterns allow optional spaces around :.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

N/A

Test Scenarios

Verified release detection with both JSON formatting variants:

"tag_name": "v1.4.1"

and:

"tag_name":"v1.4.1"

Confirmed that both scripts correctly extract v1.4.1.

Summary by CodeRabbit

  • Bug Fixes
    • Improved release detection during installation and deployment.
    • Added support for optional spacing in release metadata, ensuring the latest release is identified reliably.

Copilot AI lite review requested due to automatic review settings August 9, 2026 13:27
@davidmz
davidmz requested a review from mguptahub as a code owner August 9, 2026 13:27
@CLAassistant

CLAassistant commented Aug 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The release tag parsers in the CLI and Swarm deployment scripts now accept optional whitespace around the tag_name JSON separator and value.

Changes

Release tag parsing

Layer / File(s) Summary
Update release tag matching
deployments/cli/community/install.sh, deployments/swarm/community/swarm.sh
Both checkLatestRelease implementations use flexible whitespace matching when extracting the GitHub release tag.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

Suggested reviewers: mguptahub

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: allowing spaces around the JSON colon during release tag parsing.
Description check ✅ Passed The description follows the template, identifies the bug, lists changed files, marks the change type, and documents test scenarios.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/sed patterns 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
deployments/cli/community/install.sh (1)

60-60: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Handle release API failures before parsing.

Both scripts assign the pipeline directly through local, which masks command status. Capture and validate the curl response before extracting tag_name.

  • deployments/cli/community/install.sh#L60-L60: declare latest_release separately and handle a failed curl request 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

📥 Commits

Reviewing files that changed from the base of the PR and between 31853ab and 4014d33.

📒 Files selected for processing (2)
  • deployments/cli/community/install.sh
  • deployments/swarm/community/swarm.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants