Skip to content

cd(cua-driver): bake latest version into install.sh after each release - #1517

Merged
ddupont808 merged 1 commit into
mainfrom
cd/bake-version-install-sh
May 14, 2026
Merged

cd(cua-driver): bake latest version into install.sh after each release#1517
ddupont808 merged 1 commit into
mainfrom
cd/bake-version-install-sh

Conversation

@ddupont808

@ddupont808 ddupont808 commented May 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a BAKED_VERSION sentinel block to libs/cua-driver/scripts/install.sh that the CD workflow updates automatically after every cua-driver-v* release
  • Version resolution is now: env var override → baked version (no API call) → GitHub API fallback
  • Fixes 403 errors seen by hermes computer-use install users on shared NAT/VPN IPs that exhaust the 60 req/hr GitHub unauthenticated rate limit
  • Also bumps per_page from 40 → 100 on the API fallback path so future releases never fall off the page

How it works

install.sh gains a sentinel block kept in sync by CI:

# ~~~ BAKED_VERSION: auto-updated by CD workflow after each release — do not edit ~~~
CUA_DRIVER_BAKED_VERSION="0.1.9"
# ~~~ END_BAKED_VERSION ~~~

The tag resolution block now tries the baked version before falling back to the API:

if   [[ -n "${CUA_DRIVER_VERSION:-}" ]];       then TAG=...  # env pin
elif [[ -n "${CUA_DRIVER_BAKED_VERSION:-}" ]]; then TAG=...  # baked (no API)
else                                                TAG=$(curl api.github.com ...)  # fallback
fi

cd-swift-cua-driver.yml gains a post-release step:

- name: Bake version into install.sh
  # fetches main, sed-replaces CUA_DRIVER_BAKED_VERSION, commits, pushes main

Test plan

  • Trigger a cua-driver-v* release and confirm the CD step commits an updated CUA_DRIVER_BAKED_VERSION line to main
  • Run install.sh and confirm it prints latest release: cua-driver-vX.Y.Z without making any GitHub API calls (check with tcpdump or network proxy if needed)
  • Confirm CUA_DRIVER_VERSION=0.1.8 ./install.sh still overrides the baked version correctly

🤖 Generated with Claude Code

Adds a BAKED_VERSION sentinel block to libs/cua-driver/scripts/install.sh
that the CD workflow updates automatically after every cua-driver-v* release.

The install script now resolves the version in priority order:
  1. CUA_DRIVER_VERSION env var (explicit pin — unchanged)
  2. CUA_DRIVER_BAKED_VERSION (new — set at release time, no API call needed)
  3. GitHub Releases API walk (fallback only — kept for safety)

This eliminates the GitHub API call for the common case, fixing 403 errors
that hermes users see on shared NAT/VPN IPs that hit the 60 req/hr
unauthenticated rate limit. Also bumps per_page 40→100 on the API fallback
so future releases never fall off the page.

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

vercel Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Ignored Ignored Preview May 14, 2026 4:26pm

Request Review

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR implements automatic baking of CUA driver release versions into the installer script. The install script's version resolution now prioritizes environment pins, then checks a baked constant, then falls back to GitHub API queries (with increased pagination). A new CD workflow step automatically updates this constant when releasing from versioned tags.

Changes

Baked version mechanism

Layer / File(s) Summary
Baked version fallback in release resolution
libs/cua-driver/scripts/install.sh, .github/workflows/cd-swift-cua-driver.yml
Install script resolves release tags in three steps: environment variable override, then CUA_DRIVER_BAKED_VERSION constant (new), then GitHub Releases API with increased pagination. A new workflow step automatically bakes the selected release version into the install script when building from cua-driver-v* tags by fetching origin/main, updating the sentinel-marked constant, and pushing the result.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • trycua/cua#1398: Both PRs modify the GitHub release-tag resolution logic in libs/cua-driver/scripts/install.sh.
  • trycua/cua#1364: Adds the cua-driver-v{version} tags that this PR's workflow automation depends on to trigger the baking behavior.

Poem

A version bakes within the script so fine,
No GitHub calls when the tag aligns with mine,
The workflow's hand rolls out the dough,
And installs know which way to go,
One hop ahead, our drivers shine! 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: automating version baking into install.sh after releases.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cd/bake-version-install-sh

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 and usage tips.

@ddupont808
ddupont808 merged commit 200b36a into main May 14, 2026
6 of 7 checks passed
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.

2 participants