Skip to content

feat(cursor-review): optional dedicated bot identity for review posting (BE-1812)#13

Merged
mattmillerai merged 3 commits into
mainfrom
matt/be-1812-story-11-cursor-review-reusable-workflow-optional-dedicated
Jun 26, 2026
Merged

feat(cursor-review): optional dedicated bot identity for review posting (BE-1812)#13
mattmillerai merged 3 commits into
mainfrom
matt/be-1812-story-11-cursor-review-reusable-workflow-optional-dedicated

Conversation

@mattmillerai

Copy link
Copy Markdown
Contributor

Implements BE-1812 (hunks 1+2 of the BE-1800 approach): the cursor-review reusable workflow can post under an optional dedicated bot identity instead of the shared github-actions[bot], so its review threads become distinct and queryable.

Change — one file, .github/workflows/cursor-review.yml

  1. Two optional workflow_call secrets: BOT_APP_ID, BOT_APP_PRIVATE_KEY (both required: false).
  2. A Detect bot identity step + a conditional actions/create-github-app-token@v2 mint step before Post review.
  3. Post review's token becomes ${{ steps.bot_token.outputs.token || secrets.GITHUB_TOKEN }}.

post-review.py is untouched — the comment author follows whatever token it gets.

Note: secrets can't be referenced in a step if:, so a tiny Detect bot identity step surfaces presence as a step output the mint step gates on (actionlint-clean).

Safe to merge now (red-safe / no-op until configured)

With no creds supplied, the mint step is skipped and posting stays github-actions[bot] — zero behavior change for every consumer, including OSS callers. It posts under the new identity only once the App + org secrets exist (BE-1813) and callers pass them through (BE-1814).

Two usual footguns were already handled here, so no companion edits:

  • Dedup keys on the review body marker, not the author — identity change won't re-trigger reviews.
  • Triggerer attribution already falls back to the PR assignee on a bot actor — Slack DM attribution survives.

Pin style matches the file (bare tags). Caller passthrough is the separate BE-1814.

Refs BE-1812 · parent BE-1800.

…ng (BE-1812)

Post the consolidated review + per-finding line comments under an optional
dedicated GitHub App identity (e.g. cloud-code-bot[bot]) instead of the shared
github-actions[bot], so the threads are distinct and queryable.

- Declare optional workflow_call secrets BOT_APP_ID + BOT_APP_PRIVATE_KEY.
- Conditionally mint an app token (actions/create-github-app-token@v2) when set.
- Post review uses steps.bot_token.outputs.token || secrets.GITHUB_TOKEN.

Red-safe: with no creds the mint step is skipped and posting stays
github-actions[bot] -- zero behavior change for any consumer. Dedup keys on the
review body marker and triggerer attribution already handles a bot actor, so no
companion edits were needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@mattmillerai, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 40 minutes and 48 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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

🚦 How do rate 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 see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 53471e18-6330-4f3e-a325-68fa0d904dba

📥 Commits

Reviewing files that changed from the base of the PR and between 31a2c3e and f4427a4.

📒 Files selected for processing (1)
  • .github/workflows/cursor-review.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch matt/be-1812-story-11-cursor-review-reusable-workflow-optional-dedicated
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch matt/be-1812-story-11-cursor-review-reusable-workflow-optional-dedicated

Comment @coderabbitai help to get the list of available commands.

… secrets-if workaround

App IDs aren't secret, and the org already stores cloud-code-bot's as the APP_ID
*variable* (+ CLOUD_CODE_BOT_PRIVATE_KEY secret), used by several cloud workflows.
Make bot_app_id a workflow_call input instead of a secret; this also lets the mint
step gate on 'if: inputs.bot_app_id != ""' directly, removing the detect-step that
only existed because 'secrets' is not a valid step-if context. Bump
create-github-app-token v2 -> v3 to match cloud's existing pin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mattmillerai mattmillerai marked this pull request as ready for review June 26, 2026 00:22
The reusable workflow is consumed open-source; the example caller comments
named Comfy's specific bot + secret names. Swap them for generic placeholders
(REVIEW_BOT_APP_ID / REVIEW_BOT_PRIVATE_KEY) so consumers plug in their own App.
The interface (bot_app_id / BOT_APP_PRIVATE_KEY) was already identity-agnostic;
this is comments only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mattmillerai mattmillerai merged commit 44ab299 into main Jun 26, 2026
3 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.

1 participant