Skip to content

Fix regex check for tag_name to get latest release - #9548

Open
sjsadowski wants to merge 1 commit into
makeplane:previewfrom
sjsadowski:preview
Open

Fix regex check for tag_name to get latest release#9548
sjsadowski wants to merge 1 commit into
makeplane:previewfrom
sjsadowski:preview

Conversation

@sjsadowski

@sjsadowski sjsadowski commented Aug 4, 2026

Copy link
Copy Markdown

Description

When attempting to install the community edition, a check is performed to get the latest release. Due to inconsistent responses from GitHub, the previous regex supplied might not match the return (it always expects a space, sometimes one is not supplied) and then the check fails.

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)

Test Scenarios

$ date && curl -sSL https://api.github.com/repos/makeplane/plane/releases/latest |  grep -o '"tag_name": "[^"]*"' | sed 's/"tag_name": "//;s/"//g'
Tue Aug  4 10:38:41 CDT 2026
$ date && curl -sSL https://api.github.com/repos/makeplane/plane/releases/latest |  grep -o '"tag_name":\s*"[^"]*"' | sed 's/"tag_name":\s*"//;s/"//g'
Tue Aug  4 10:38:45 CDT 2026
v1.4.0

References

#8911

Summary by CodeRabbit

  • Bug Fixes
    • Improved latest-release detection during CLI and Swarm deployments.
    • Release tags are now recognized correctly when GitHub’s response includes varying whitespace formatting.

@sjsadowski
sjsadowski requested a review from mguptahub as a code owner August 4, 2026 15:41
Copilot AI lite review requested due to automatic review settings August 4, 2026 15:41
@CLAassistant

CLAassistant commented Aug 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Both deployment scripts update their release tag parsing logic. The regex used to extract the tag_name value from GitHub release JSON now allows zero or more whitespace characters instead of requiring exactly one space after the colon.

Changes

Release tag parsing fix

Layer / File(s) Summary
Update tag_name whitespace matching
deployments/cli/community/install.sh, deployments/swarm/community/swarm.sh
checkLatestRelease in both scripts now matches optional whitespace after "tag_name": instead of a single required space. The sed expression in install.sh is adjusted to match.

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

Suggested reviewers: mguptahub, copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the regex fix for retrieving the latest release tag.
Description check ✅ Passed The description covers the bug, change type, test scenario, and reference, with all required sections present.
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 PR aims to make the “latest GitHub release” detection in the community install scripts resilient to GitHub API responses that omit spaces in JSON ("tag_name":"vX.Y.Z" vs "tag_name": "vX.Y.Z"), preventing installs/upgrades from failing.

Changes:

  • Updates the grep/sed parsing used to extract tag_name from the GitHub Releases API response in the Swarm installer script.
  • Updates the same parsing logic in the CLI community installer script.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
deployments/swarm/community/swarm.sh Adjusts the tag_name extraction regex in checkLatestRelease() to handle compact JSON responses.
deployments/cli/community/install.sh Adjusts the tag_name extraction regex in checkLatestRelease() to handle compact JSON responses.

Comment thread deployments/swarm/community/swarm.sh
Comment thread deployments/cli/community/install.sh

@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.

Actionable comments posted: 1

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

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

Preserve command failure status in both release lookups.

local latest_release=$(...) can return success when the command substitution fails, so empty responses do not reliably stop set -e scripts. This affects both deployments/cli/community/install.sh:60 and deployments/swarm/community/swarm.sh:41. Declare latest_release separately, assign the pipeline, check both local and the assignment status, and add pipefail if curl, grep, or sed failures must propagate.

🤖 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, Preserve release lookup
failures in both deployments/cli/community/install.sh:60 and
deployments/swarm/community/swarm.sh:41. In each script, declare latest_release
separately, assign the curl/grep/sed pipeline while explicitly checking both the
local declaration and assignment status, and enable pipefail so failures from
any pipeline command propagate under set -e.

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.

Inline comments:
In `@deployments/cli/community/install.sh`:
- Line 60: Update the latest_release assignment’s sed cleanup in the
release-fetch command to remove the tag_name prefix followed by optional
whitespace, matching the preceding grep pattern, while preserving the existing
trailing-quote cleanup.

---

Nitpick comments:
In `@deployments/cli/community/install.sh`:
- Line 60: Preserve release lookup failures in both
deployments/cli/community/install.sh:60 and
deployments/swarm/community/swarm.sh:41. In each script, declare latest_release
separately, assign the curl/grep/sed pipeline while explicitly checking both the
local declaration and assignment status, and enable pipefail so failures from
any pipeline command propagate under set -e.
🪄 Autofix

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 Plus

Run ID: db5c8ba1-4020-4d1a-a641-5163c08a87a3

📥 Commits

Reviewing files that changed from the base of the PR and between ed61f99 and 3554fd1.

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

Comment thread deployments/cli/community/install.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