Skip to content

[INFRA-1039] - fix(deployments): find the latest release when the GitHub API returns compact JSON - #9916

Open
akshat5302 wants to merge 1 commit into
previewfrom
fix/infra-1039-install-latest-release
Open

akshat5302 wants to merge 1 commit into
previewfrom
fix/infra-1039-install-latest-release

Conversation

@akshat5302

@akshat5302 akshat5302 commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

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 with APP_RELEASE=stable fails.

  1. The lookup pattern no longer matches. Both scripts run 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.
  2. The failure didn't stop the script. checkLatestRelease calls exit 1, but it runs inside $(...), so that only exits the subshell. install carried on with an empty APP_RELEASE, producing X86_64 images are not available for selected release () and then invalid reference format. The call sites now exit 1 when the lookup fails. (export VAR=$(...) and local var=$(...) hide the exit status, so the assignments are split out.)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Test Scenarios

  • bash -n passes for both scripts.
  • Ran the new checkLatestRelease from each script against the live API: returns v1.4.2. With the old pattern it returns an empty string.
  • Parser tested on compact ("tag_name":"v1.4.2") and pretty-printed ("tag_name": "v1.4.2") JSON: both return v1.4.2.
  • With an unknown repo, the lookup prints "Failed to check for the latest release. Exiting..." and the caller exits with code 1 instead of continuing.
  • Did not run a full install end to end.

References

Fixes #8841
Fixes #9745
Fixes #9199

🧙 Built with WOZCODE

Summary by CodeRabbit

  • Bug Fixes
    • Improved release detection when release information contains extra spacing.
    • Install and upgrade operations now stop with an error when release information cannot be retrieved, rather than continuing with an empty release value.

… 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>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 13:03
@makeplane

makeplane Bot commented Sep 29, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2e342ce1-b377-4256-807c-57d46909732f

📥 Commits

Reviewing files that changed from the base of the PR and between e72bf10 and 02ceaac.

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

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

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

Changes

Community release lookup

Layer / File(s) Summary
Release tag parsing
deployments/cli/community/install.sh, deployments/swarm/community/swarm.sh
Both scripts accept zero or more spaces after the tag_name colon when parsing release tags.
Release check handling
deployments/cli/community/install.sh, deployments/swarm/community/swarm.sh
The CLI installer and Swarm script exit when release lookup fails in install, deploy, and upgrade paths. The CLI installer exports APP_RELEASE only after a successful lookup.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 02cea

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 Summary

Architecture risk: 🟡 Medium · up to 02cea

The change affects 1 system.

Changed systems: deployments

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — deployments (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in deployments/cli/community/install.sh: The release-tag grep now accepts zero or more spaces after "tag_name":; previously it required exactly one space.
  • observed — Modified behavior in deployments/cli/community/install.sh: install now exits if checkLatestRelease fails, then exports APP_RELEASE after a successful lookup. Previously the export was part of the command substitution assignment, so a failure inside that substitution did not trigger an explicit exit.
  • observed — Modified behavior in deployments/cli/community/install.sh: upgrade now assigns the release lookup result separately and exits on failure; previously it continued after checkLatestRelease failed.
  • observed — Modified behavior in deployments/swarm/community/swarm.sh: checkLatestRelease now matches optional whitespace after the tag_name colon; the previous pattern required exactly one space.

Reliability and maintainability

  • inferred — Risk-relevant change factors for deployments: blast_radius_1; blast_radius_2; direct_dependents_1; direct_dependents_2
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes satisfy the release lookup requirement in [#8841] by accepting optional whitespace after tag_name: in both community scripts. They satisfy the failed-lookup flow in [#9745] by exiting wi… Normalize x86_64 to amd64 before the image architecture check in the affected community setup script. Add automated coverage for the architecture mapping and the failed-release paths.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the deployment scripts and the primary fix for locating the latest GitHub release when JSON uses compact formatting.
Description check ✅ Passed The description explains the bug, implementation, change type, test scenarios, known test limitation, and related issues. The omitted Screenshots and Media section is not required for this script-only…
Out of Scope Changes check ✅ Passed The changes are limited to deployments/cli/community/install.sh and deployments/swarm/community/swarm.sh. The parser update and explicit failure exits directly support [#8841] and [#9745]. The Swa…
Full details: Linked Issues check

Explanation

The changes satisfy the release lookup requirement in [#8841] by accepting optional whitespace after tag_name: in both community scripts. They satisfy the failed-lookup flow in [#9745] by exiting with status 1 in install, upgrade, deployStack, and upgrade paths instead of continuing with an empty release. The architecture requirement in [#9199] remains unmet. deployments/cli/community/install.sh still assigns CPU_ARCH=$(uname -m) and uses that value for the image manifest check. It has no x86_64 to amd64 mapping.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

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_name JSON.
  • 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.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

2 participants