Skip to content

ci: hard-block Gate 3 on CodeRabbit CHANGES_REQUESTED, add Gate 5 aggregate - #32

Closed
NavpreetST wants to merge 1 commit into
mainfrom
ci/gate-3-cr-hard-block
Closed

ci: hard-block Gate 3 on CodeRabbit CHANGES_REQUESTED, add Gate 5 aggregate#32
NavpreetST wants to merge 1 commit into
mainfrom
ci/gate-3-cr-hard-block

Conversation

@NavpreetST

@NavpreetST NavpreetST commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Replaces the advisory-only Gate 3 with a real CodeRabbit check using actions/github-script@v7 that fails CI when CodeRabbit has requested changes. Adds Gate 5 merge-ready aggregate that requires all prior gates to pass.

Summary by CodeRabbit

  • Chores
    • Enforced automated review and automated-check results as a blocking merge gate to prevent merges when changes are requested or checks fail.
    • Adjusted the final "merge-ready" verification to rely on prior checks (lint, tests, automated-checks, drift detection) rather than an explicit success condition.
    • Updated workflow permissions to allow reading check status for these validations.

@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
axis-dash Ready Ready Preview, Comment Jun 10, 2026 1:15pm

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a417661-df7b-46f2-9699-e92530787271

📥 Commits

Reviewing files that changed from the base of the PR and between 388f7d1 and 7000b5a.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

📝 Walkthrough

Walkthrough

Removes the explicit if: success() condition from the .github/workflows/ci.yml merge-ready job; the job now relies on its needs: [lint, tests, coderabbit-check, drift-guard] gating and still emits the same "All gates passed" message.

Changes

CI Gate Enforcement

Layer / File(s) Summary
Merge-ready aggregation gate (job condition removed)
.github/workflows/ci.yml
Removes if: success() from the merge-ready job declaration; needs remains lint, tests, coderabbit-check, and drift-guard, and the final echo step is unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I nudged a line, removed a gate so slight,
Needs still gather proof before the job takes flight.
One less condition, the pipeline hums,
Tiny change, big hopes — CI drums.
Hops of joy under moonlit bytes.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'hard-block Gate 3 on CodeRabbit CHANGES_REQUESTED' and 'add Gate 5 aggregate', which directly align with the PR's main objectives of implementing a hard check for CodeRabbit and adding an aggregate gate.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/gate-3-cr-hard-block

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between a621374 and 5257e54.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml Outdated
Comment thread .github/workflows/ci.yml Outdated
@NavpreetST

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

12-12: 💤 Low value

Optional: Verify the checks: read permission is needed.

The checks: read permission was added, but the Gate 3 script (lines 84-110) only calls github.rest.pulls.get and github.rest.pulls.listReviews, both of which require pull-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

📥 Commits

Reviewing files that changed from the base of the PR and between 388f7d1 and 7000b5a.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 value

Optional: Verify the checks: read permission is needed.

The checks: read permission was added, but the Gate 3 script (lines 84-110) only calls github.rest.pulls.get and github.rest.pulls.listReviews, both of which require pull-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

📥 Commits

Reviewing files that changed from the base of the PR and between 388f7d1 and 7000b5a.

📒 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 tradeoff

Missing pagination for reviews (inconsistent with commit message).

The commit message states "Add pagination for fetching reviews," but the listReviews call 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.

@NavpreetST

Copy link
Copy Markdown
Owner Author

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.

@NavpreetST NavpreetST closed this Jun 10, 2026
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