mirror of
https://github.com/Comfy-Org/github-workflows.git
synced 2026-11-05 00:17:37 +00:00
[PR #105] [MERGED] fix(cursor-review): download-then-execute the CLI installer + assert the binary (BE-5646) #115
Labels
No labels
cursor-review-catalog-drift
groom
groom
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/github-workflows#115
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/github-workflows/pull/105
Author: @mattmillerai
Created: 8/1/2026
Status: ✅ Merged
Merged: 8/4/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-5646-cursor-review-install-hardening📝 Commits (4)
a2e23e9fix(cursor-review): download-then-execute the CLI installer + assert the binary (BE-5646)951e093fix(cursor-review): export the real install dir on PATH + bound the installer fetch (BE-5646)5cdbeeefix(cursor-review): bound the installer run, reject an empty body, mktemp the download (BE-5646)afb541ffix(cursor-review): SIGKILL escalation, file-not-directory assertion, accurate timeout math (BE-5646)📊 Changes
1 file changed (+153 additions, -6 deletions)
View changed files
📝
.github/workflows/cursor-review.yml(+153 -6)📄 Description
ELI-5
The workflow installed the Cursor CLI with
curl … | bash. If the download failed,bashstill ran (on nothing) and succeeded, so the install step went green — and the run only fell over a step later withcursor-agent: command not found, under an error message blaming the model pins. Now we download the installer to a file first, run it, and then check that the binary actually exists. If either half fails, the install step itself goes red with the real reason.What changed
All three identical
Install Cursor agent CLIsteps in.github/workflows/cursor-review.yml(preflight, review matrix, consolidate) now:curl -fsSL --retry 3 --retry-all-errors --retry-delay 2 … -o /tmp/cursor-install.sh— a failed download is now the step's own exit status, and up to 3 retries ride out a transient 5xx.bash /tmp/cursor-install.sh— separate command, so its status stands on its own.cursor-agentactually exists, emitting an explicit::error::if it does not.The preflight step keeps its
CURSOR_API_KEYskip guard verbatim as its first lines. The three bodies are otherwise byte-identical (verified by parsing the YAML and comparing the step bodies) — GitHub Actions has no YAML anchors and the preflight job has no checkout, so a local composite action is not an option; the triplication matches the rest of the file.Not done, deliberately: no workflow-level
defaults: run: shell: bashwas added — it would flip every run step in the file to-eo pipefail, and this workflow deliberately relies on last-command-wins pipelines and&& … || …exit-capture idioms elsewhere. TheLog Cursor agent versionstep, the model pins, and every caller repo are untouched. Vendor-outage soft-skip is out of scope: hard-red stays, now correctly attributed to the install step.Deviation from the ticket — the assertion path (please read)
The ticket prescribed asserting on
$HOME/.cursor/bin/cursor-agent. That assertion fires on a successful install, which would have hard-red'd every cursor-review run across every pinned caller repo. The currentcursor.com/installscript installs to~/.local/bin:There is no
.cursor/binpath anywhere in the installer. I ran the real installer against an isolatedHOMEand confirmed it creates~/.local/bin/{agent,cursor-agent}and no~/.cursordirectory at all, and a recent successful CI run of this repo's own review panel shows the same in its install log (✓ Detected linux/x64→✓ Symlink created→Start using Cursor Agent: agent), followed bycursor-agent --version→2026.07.23-e383d2b.So the assertion here targets the real location, and is written to err toward not failing — it only errors when both the PATH lookup and the explicit path come up empty:
A false positive on this check would break the review panel in every consumer repo at once, so the lenient direction is the right one.
Related finding, left alone as out of scope: the pre-existing
echo "$HOME/.cursor/bin" >> "$GITHUB_PATH"line is vestigial — that directory is never created, andcursor-agentresolves today only because~/.local/binis already on the GitHub-hosted runner's default PATH. The ticket says the success path and the PATH line must be unchanged, so I left it (and said so in a code comment). Worth a follow-up to either point it at~/.local/binor drop it; today it is a harmless no-op, but it is also the reason the ticket's assertion path looked plausible.Verification
actionlint(withshellcheckintegration) clean on the whole repo and on the changed file;shellcheck -s bashclean on the extracted step body.python3 -m unittest discover -s .github/cursor-review/tests— 40 tests, OK (untouched, sanity only). AGENTS.md integrity checker passes (one pre-existing CODEOWNERS warning, unrelated).run:strings.HOMEwhose.local/binwas deliberately not onPATH(so the explicit-path fallback was the branch under test) → exit 0, symlinks created.curl: (56) The requested URL returned error: 500four times (initial + 3 retries), step exits 56. Pointed it at a URL serving a 200 HTML page →bashfails parsing it, step exits 2. Both go red at the install step, which is the whole point.Notes
/tmp/cursor-install.shis a predictable path, which would matter on a self-hosted runner; every job in this workflow isruns-on: ubuntu-latest(GitHub-hosted, single-tenant per job), so there is no shared-runner race here.--retry-all-errorsneeds curl ≥ 7.71; the ubuntu-latest images ship 8.x.bump-cursor-review-callers.yml, which opens SHA-bump PRs in the pinned caller repos automatically — no caller-side edits in this PR.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
enabledswitch, off by default #125