ci: hard-block Gate 3 on CodeRabbit CHANGES_REQUESTED, add Gate 5 aggregate - #32
ci: hard-block Gate 3 on CodeRabbit CHANGES_REQUESTED, add Gate 5 aggregate#32NavpreetST wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRemoves the explicit ChangesCI Gate Enforcement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Line 79: Replace the floating tag "actions/github-script@v7" with a pinned
commit SHA for the actions/github-script action (e.g.,
"actions/github-script@<commit-sha>"); locate the workflow step that currently
uses actions/github-script@v7 and update the action reference to the specific
commit hash of the desired release to eliminate the supply-chain risk, then
verify the workflow still runs correctly and update any related documentation or
version notes if needed.
- Around line 87-90: The current logic uses reviews.find(...) which returns the
oldest CodeRabbit review; update the check to use the most recent CodeRabbit
review instead by selecting the last matching review (e.g., reverse the reviews
array or use a findLast equivalent) and assign that to cr before evaluating
cr.state; keep the existing core.setFailed('CodeRabbit has CHANGES_REQUESTED —
fix before merge.') behavior but only trigger it when the most recent cr has
state === 'CHANGES_REQUESTED'.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 057aeb9c-6d31-4098-9f50-63e8742a71d5
📒 Files selected for processing (1)
.github/workflows/ci.yml
388f7d1 to
7000b5a
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
12-12: 💤 Low valueOptional: Verify the
checks: readpermission is needed.The
checks: readpermission was added, but the Gate 3 script (lines 84-110) only callsgithub.rest.pulls.getandgithub.rest.pulls.listReviews, both of which requirepull-requests: read(already present on line 11). Unless this permission is used elsewhere or planned for future use, it may be unnecessary.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml at line 12, The workflow adds the checks: read permission but Gate 3 only uses github.rest.pulls.get and github.rest.pulls.listReviews (which need pull-requests: read); either remove the unnecessary checks: read entry from the permissions mapping in .github/workflows/ci.yml or update the Gate 3 script (the calls to github.rest.pulls.get and github.rest.pulls.listReviews) to actually use the Checks API if you intend to keep checks: read—choose one: delete the checks: read permission to minimize surface area, or add explicit usage of the Checks API where checks: read is required and document why it’s needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 91-95: The listReviews call currently fetches only a single page;
update the logic to paginate through all review pages using Octokit pagination
(e.g., replace github.rest.pulls.listReviews with github.paginate or use the
listReviews iterator) so you collect all reviews for the PR into the reviews
variable, then continue to filter for CodeRabbit; ensure you pass the same
params (owner, repo, pull_number) to the paginator and optionally set per_page
if limiting to the most recent N reviews is desired.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Line 12: The workflow adds the checks: read permission but Gate 3 only uses
github.rest.pulls.get and github.rest.pulls.listReviews (which need
pull-requests: read); either remove the unnecessary checks: read entry from the
permissions mapping in .github/workflows/ci.yml or update the Gate 3 script (the
calls to github.rest.pulls.get and github.rest.pulls.listReviews) to actually
use the Checks API if you intend to keep checks: read—choose one: delete the
checks: read permission to minimize surface area, or add explicit usage of the
Checks API where checks: read is required and document why it’s needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0a417661-df7b-46f2-9699-e92530787271
📒 Files selected for processing (1)
.github/workflows/ci.yml
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)
12-12: 💤 Low valueOptional: Verify the
checks: readpermission is needed.The
checks: readpermission was added, but the Gate 3 script (lines 84-110) only callsgithub.rest.pulls.getandgithub.rest.pulls.listReviews, both of which requirepull-requests: read(already present on line 11). Unless this permission is used elsewhere or planned for future use, it may be unnecessary.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml at line 12, The workflow adds the checks: read permission but Gate 3 only uses github.rest.pulls.get and github.rest.pulls.listReviews (which need pull-requests: read); either remove the unnecessary checks: read entry from the permissions mapping in .github/workflows/ci.yml or update the Gate 3 script (the calls to github.rest.pulls.get and github.rest.pulls.listReviews) to actually use the Checks API if you intend to keep checks: read—choose one: delete the checks: read permission to minimize surface area, or add explicit usage of the Checks API where checks: read is required and document why it’s needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/ci.yml:
- Around line 91-95: The listReviews call currently fetches only a single page;
update the logic to paginate through all review pages using Octokit pagination
(e.g., replace github.rest.pulls.listReviews with github.paginate or use the
listReviews iterator) so you collect all reviews for the PR into the reviews
variable, then continue to filter for CodeRabbit; ensure you pass the same
params (owner, repo, pull_number) to the paginator and optionally set per_page
if limiting to the most recent N reviews is desired.
---
Nitpick comments:
In @.github/workflows/ci.yml:
- Line 12: The workflow adds the checks: read permission but Gate 3 only uses
github.rest.pulls.get and github.rest.pulls.listReviews (which need
pull-requests: read); either remove the unnecessary checks: read entry from the
permissions mapping in .github/workflows/ci.yml or update the Gate 3 script (the
calls to github.rest.pulls.get and github.rest.pulls.listReviews) to actually
use the Checks API if you intend to keep checks: read—choose one: delete the
checks: read permission to minimize surface area, or add explicit usage of the
Checks API where checks: read is required and document why it’s needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0a417661-df7b-46f2-9699-e92530787271
📒 Files selected for processing (1)
.github/workflows/ci.yml
🛑 Comments failed to post (1)
.github/workflows/ci.yml (1)
91-95:
⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoffMissing pagination for reviews (inconsistent with commit message).
The commit message states "Add pagination for fetching reviews," but the
listReviewscall has no pagination logic. GitHub's REST API returns a maximum of 30 reviews per page by default. If a PR accumulates more than 30 reviews, this script will only examine the first page and may miss the most recent CodeRabbit review, leading to an incorrect gate decision.📄 Proposed fix using octokit pagination
- const { data: reviews } = await github.rest.pulls.listReviews({ + const reviews = await github.paginate(github.rest.pulls.listReviews, { owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number, });Alternatively, if you want to limit to the most recent 100 reviews for performance:
- const { data: reviews } = await github.rest.pulls.listReviews({ + const { data: reviews } = await github.rest.pulls.listReviews({ owner: context.repo.owner, repo: context.repo.repo, pull_number: context.issue.number, + per_page: 100, });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/ci.yml around lines 91 - 95, The listReviews call currently fetches only a single page; update the logic to paginate through all review pages using Octokit pagination (e.g., replace github.rest.pulls.listReviews with github.paginate or use the listReviews iterator) so you collect all reviews for the PR into the reviews variable, then continue to filter for CodeRabbit; ensure you pass the same params (owner, repo, pull_number) to the paginator and optionally set per_page if limiting to the most recent N reviews is desired.
|
Closing as duplicate — this nitpick (remove if:success()) was already addressed in PR #30 which is merged to main. Root cause: branch was created from a stale local copy instead of origin/main. Agent protocol updated to prevent repeat: always branch from origin/main, check if the fix already exists. |
Replaces the advisory-only Gate 3 with a real CodeRabbit check using
actions/github-script@v7that fails CI when CodeRabbit has requested changes. Adds Gate 5merge-readyaggregate that requires all prior gates to pass.Summary by CodeRabbit