ci: trigger a Cursor review on new commits, debounced by 5 minutes - #2895
Conversation
The Cursor automation webhook only fired at PR open (or ready-for-review, label, /cursor review command): commits pushed after the initial review — including autofix passes — were never re-reviewed. Add the synchronize trigger with a per-PR debounce: - All synchronize events of one PR share a concurrency group with cancel-in-progress, and the job sleeps 5 minutes before calling the webhook. A burst of pushes therefore yields ONE review, of its last commit — important because a Cursor run cannot be cancelled once fired. - After the sleep, the job re-checks the PR: if the head moved anyway (cancellation race) or the PR closed meanwhile, it skips instead of firing a stale or useless review. - Pushes to drafts are ignored (same as opened), and the existing AUTO_ALLOWED gate applies: no automatic review for dependency bots or authors without a merged contribution. Other triggers (open, label, command, manual) are unaffected: they get a unique concurrency group and are never debounced nor cancelled. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VU6y2pzeyAXZWPrS4YNGwx
|
Warning Review limit reached
Next review available in: 23 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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. Comment |
Deploying gladys-plus with
|
| Latest commit: |
014df5b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://334c3d15.gladys-plus.pages.dev |
| Branch Preview URL: | https://claude-cursor-review-on-push.gladys-plus.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2895 +/- ##
=======================================
Coverage 99.51% 99.51%
=======================================
Files 1235 1235
Lines 88064 88064
=======================================
Hits 87638 87638
Misses 426 426 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🐳 A Docker image has been built for this branch and pushed to the GitHub Container Registry. You can test this pull request (AMD64 only) by pulling the image below: For example, run it with: sudo docker run -d \
--log-driver json-file \
--log-opt max-size=10m \
--cgroupns=host \
--restart=always \
--privileged \
--network=host \
--name gladys-claude-cursor-review-on-push \
-e NODE_ENV=production \
-e SERVER_PORT=80 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
ghcr.io/gladysassistant/gladys-preview:claude-cursor-review-on-pushThis comment and the image are automatically updated on every new commit pushed to this pull request. Need an ARM64 image (Raspberry Pi, Apple Silicon, …)? Comment |
There was a problem hiding this comment.
Stale comment
CI-only change to
.github/workflows/cursor-automation-webhook.yml:synchronizeis added next to the existingopened/ready_for_review/labeledtriggers, with a per-PR concurrency group + 5-minute sleep so a burst of pushes yields one Cursor run of the last commit.The YAML itself is well thought through and keeps the security model of #2824/#2833 (no checkout of PR head, metadata via the API only,
AUTO_ALLOWED+ draft gates reused, other triggers isolated onrun_idso they are not cancelled or delayed). I would not addrisk:high(no Gladys runtime, auth, DB, or host path) and I would not addneeds:human-review(ops/quota call for the automation owner, who is the author — same class as #2890).Please update
.github/CONTRIBUTING.mdin this diff before merge. That file is the user-facing contract for this workflow (#2824 rewrote it when the command/auto-trigger rules landed). It still says an automatic review runs on open, and that the way to get a new review after pushing is/cursor review. After this change that sequence is a double spend: the comment path uses a unique concurrency group (intentional, so it is not debounced), so it fires immediately, and the sleepingsynchronizejob still fires ~5 minutes later on the same SHA. Contributors following the current docs — and anyone in the habit of commenting after a push — would pay twice. The docs should describe the new automatic-on-push behaviour and keep/cursor review/needs:cursor-reviewas the on-demand / first-timer / “don't wait 5 minutes” escape hatches.Non-blocking residuals, for awareness:
- GitHub also emits
synchronizefor “Update branch” / rebase onto the base, so a PR that is only staying current withmasterstill consumes a Cursor run after the debounce.- Cancellation of the sleeping job is best-effort; the post-sleep SHA/state re-fetch covers the usual race. A tiny window remains if the head moves after that check and during the webhook POST — inherent to Actions, and the comment in the workflow already describes it.
- Every
synchronizestill starts a runner (drafts anddependabot/renovateincluded); the gate then no-ops. Cheap, but the job-levelifcould skip drafts earlier if GHA minutes ever become noisy.- This is
pull_request_target, so the new path only runs once this YAML is on the default branch. Worth watching the first post-merge push on an eligible PR.No
server/utils/constants.jsdevice categories/types.needs:cursor-reviewis not on the PR.Sent by Cursor Automation: Automatic PR review
Addresses the review feedback on the synchronize trigger: CONTRIBUTING.md still described the initial-review-only contract. It now explains the automatic re-review ~5 minutes after a push (and why the delay exists), repositions /cursor review and the needs:cursor-review label as the on-demand / first-timer / skip-the-wait hatches, and warns that commenting right after a push can start a second review of the same commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VU6y2pzeyAXZWPrS4YNGwx
|
/cursor-review |
There was a problem hiding this comment.
Re-review of 014df5b. The previous blocker is addressed: .github/CONTRIBUTING.md now documents the automatic re-review ~5 minutes after a push, keeps /cursor review / needs:cursor-review as the on-demand / first-timer / skip-the-wait hatches, and warns that commenting right after a push can start a second run of the same SHA. That matches the YAML (comment path stays on a unique run_id group on purpose).
The workflow change itself is unchanged and still looks sound: synchronize reuses the AUTO_ALLOWED + draft gates, other triggers are isolated so they are not cancelled or delayed, the job sleeps 5 minutes then re-fetches SHA/state before POSTing, and there is still no checkout of PR head. CI is green. I would not add risk:high (no Gladys runtime, auth, DB, or host path) and I would not add needs:human-review (ops/quota call for the automation owner, who is the author — same class as #2890).
Non-blocking residuals, unchanged:
- GitHub also emits
synchronizefor “Update branch” / rebase ontomaster, so a PR that is only staying current still consumes a Cursor run after the debounce. - Cancellation of the sleeping job is best-effort; the post-sleep SHA/state check covers the usual race. A tiny window remains if the head moves after that check and during the webhook POST.
- Every
synchronizestill starts a runner (drafts anddependabot/renovateincluded); the gate then no-ops. - This is
pull_request_target, so the new path only runs once this YAML is on the default branch. Worth watching the first post-merge push on an eligible PR.
No server/utils/constants.js device categories/types. needs:cursor-review is not on the PR.
Sent by Cursor Automation: Automatic PR review


Description
The Cursor automation webhook only fired at PR open (or ready-for-review, the
needs:cursor-reviewlabel,/cursor review, manual dispatch): commits pushed after the initial review — including autofix passes — were never re-reviewed.This adds the
synchronizetrigger tocursor-automation-webhook.yml, with a 5-minute per-PR debounce:synchronizeevents of a given PR share a concurrency group withcancel-in-progress: true, and the job sleeps 5 minutes before calling the webhook. A new push cancels the sleeping job and restarts the timer — so a burst of commits fires a single review. This matters because a Cursor run cannot be cancelled once fired: without the debounce, 5 quick pushes would stack 5 uncancellable reviews.opened. Pushes to drafts are ignored, and the existingAUTO_ALLOWEDgate applies: no automatic review fordependabot/renovatePRs or authors without a merged contribution (the label and/cursor reviewremain the escape hatches).run_id) and are never debounced nor cancelled. Atimeout-minutes: 15now bounds the job (sleep + API calls).Cost note: every push on an eligible PR now consumes a Cursor run (minus the bursts collapsed by the debounce). Combined with the autofix running every 3 hours (#2890), this closes the loop: autofix pushes get re-reviewed the same day instead of never.
Forum
Checklist
Generated by Claude Code