Skip to content

fix(cli): fallback upgrade release selection to built assets#2797

Open
haxzie wants to merge 2 commits intonextfrom
haxzie/fix/upgrade-flow-to-fix-ci-build-process-2026-02-28
Open

fix(cli): fallback upgrade release selection to built assets#2797
haxzie wants to merge 2 commits intonextfrom
haxzie/fix/upgrade-flow-to-fix-ci-build-process-2026-02-28

Conversation

@haxzie
Copy link
Collaborator

@haxzie haxzie commented Mar 2, 2026

Summary

  • make composio upgrade select the newest @composio/cli release that includes the required platform binary asset
  • add fallback behavior so freshly tagged releases with missing CI artifacts do not block upgrades
  • keep explicit tag upgrades unchanged while improving default latest-release resolution

Test plan

  • Run pnpm --filter @composio/cli typecheck
  • Run composio upgrade against a release stream where newest tag is missing assets and verify it upgrades to the previous valid release
  • Run composio upgrade when already on latest valid release and verify it reports no upgrade needed

Made with Cursor

Handle cases where the newest @composio/cli release tag exists before CI has uploaded platform binaries by selecting the latest release that includes required assets for the current platform.

Made-with: Cursor
@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 3, 2026 9:07pm

Request Review

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

⚠️ Security Audit Warning

The pnpm audit --prod check found security vulnerabilities in production dependencies.

Please review and fix the vulnerabilities. You can try running:

pnpm audit --fix --prod
Audit output
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch has a ReDoS via repeated wildcards with      │
│                     │ non-matching literal in pattern                        │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=5.0.0 <5.1.7                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=5.1.7                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__packages__cli>openapi-typescript>@redocly/openapi- │
│                     │ core>minimatch                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-3ppc-4f35-3m26      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch has a ReDoS via repeated wildcards with      │
│                     │ non-matching literal in pattern                        │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=9.0.0 <9.0.6                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=9.0.6                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__examples__google>@google/genai>google-auth-        │
│                     │ library>gaxios>rimraf>glob>minimatch                   │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-3ppc-4f35-3m26      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch has ReDoS: matchOne() combinatorial          │
│                     │ backtracking via multiple non-adjacent GLOBSTAR        │
│                     │ segments                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=5.0.0 <5.1.8                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=5.1.8                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__packages__cli>openapi-typescript>@redocly/openapi- │
│                     │ core>minimatch                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-7r86-cg39-jmmj      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch has ReDoS: matchOne() combinatorial          │
│                     │ backtracking via multiple non-adjacent GLOBSTAR        │
│                     │ segments                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=9.0.0 <9.0.7                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=9.0.7                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__examples__google>@google/genai>google-auth-        │
│                     │ library>gaxios>rimraf>glob>minimatch                   │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-7r86-cg39-jmmj      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch has ReDoS: matchOne() combinatorial          │
│                     │ backtracking via multiple non-adjacent GLOBSTAR        │
│                     │ segments                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=10.0.0 <10.2.3                                       │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=10.2.3                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__packages__cli>ts-morph>@ts-morph/common>minimatch  │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-7r86-cg39-jmmj      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch ReDoS: nested *() extglobs generate          │
│                     │ catastrophically backtracking regular expressions      │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=5.0.0 <5.1.8                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=5.1.8                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__packages__cli>openapi-typescript>@redocly/openapi- │
│                     │ core>minimatch                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-23c5-xmqv-rm74      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch ReDoS: nested *() extglobs generate          │
│                     │ catastrophically backtracking regular expressions      │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=9.0.0 <9.0.7                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=9.0.7                                                │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__examples__google>@google/genai>google-auth-        │
│                     │ library>gaxios>rimraf>glob>minimatch                   │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-23c5-xmqv-rm74      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ high                │ minimatch ReDoS: nested *() extglobs generate          │
│                     │ catastrophically backtracking regular expressions      │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ minimatch                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ >=10.0.0 <10.2.3                                       │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=10.2.3                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__packages__cli>ts-morph>@ts-morph/common>minimatch  │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-23c5-xmqv-rm74      │
└─────────────────────┴────────────────────────────────────────────────────────┘
┌─────────────────────┬────────────────────────────────────────────────────────┐
│ low                 │ Hono added timing comparison hardening in basicAuth    │
│                     │ and bearerAuth                                         │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Package             │ hono                                                   │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Vulnerable versions │ <4.11.10                                               │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Patched versions    │ >=4.11.10                                              │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ Paths               │ ts__e2e-tests__runtimes__cloudflare__cf-workers-       │
│                     │ basic>hono                                             │
├─────────────────────┼────────────────────────────────────────────────────────┤
│ More info           │ https://github.com/advisories/GHSA-gq3j-xvxp-8hrf      │
└─────────────────────┴────────────────────────────────────────────────────────┘
9 vulnerabilities found
Severity: 1 low | 8 high

- Replace O(n²) selection sort with O(n) linear scan in
  fetchLatestReleaseWithRequiredAssets; tracks the best candidate
  with the required platform asset in a single pass
- Remove unreachable onNone branch from fetchLatestRelease; function
  is only ever called from the onSome branch of githubConfig.TAG
  Option.match, so the dead code is eliminated and tag is now passed
  as a parameter instead of re-read from config
- Expand upgrade-binary test suite from 3 to 21 tests with synthetic
  GitHub API response fixtures covering: release filtering (prerelease,
  draft, non-CLI packages), platform binary selection, O(n) scan
  correctness, version comparison, tagged release fetching, runtime
  path detection, and download error handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

}

yield* Effect.logDebug(
`Resolved latest CLI release with required assets: ${release.tag_name}`
Copy link

Choose a reason for hiding this comment

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

Duplicated binary name construction not using new helper

Low Severity

The new getBinaryAssetName helper constructs the binary name string, but downloadBinary still builds the identical string inline at line 230. If the naming convention ever changes, one site could be updated while the other is missed, causing a silent mismatch between the asset-filtering logic and the download logic.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant