Skip to content

ci(dependabot): gate automatic merges on CodeRabbit review - #133

Merged
acgetchell merged 5 commits into
mainfrom
ci/dependabot-coderabbit-auto-merge
Jul 28, 2026
Merged

ci(dependabot): gate automatic merges on CodeRabbit review#133
acgetchell merged 5 commits into
mainfrom
ci/dependabot-coderabbit-auto-merge

Conversation

@acgetchell

@acgetchell acgetchell commented Jul 28, 2026

Copy link
Copy Markdown
Owner
  • Request CodeRabbit review and enable squash auto-merge for Dependabot PRs.
  • Fail closed when CodeRabbit cannot review and group GitHub Actions updates.

Refs #131

Summary by CodeRabbit

  • Chores
    • Improved automated maintenance for GitHub Actions dependency updates by adding grouping rules for action package updates.
    • Enabled stricter commit-status checking to make review-related status gates more reliable.
    • Added automation for Dependabot pull requests to post review-request feedback when needed and apply squash auto-merge.
    • Updated workflow permissions to allow pull-request commenting and squash auto-merge operations.

- Request CodeRabbit review and enable squash auto-merge for Dependabot PRs.
- Fail closed when CodeRabbit cannot review and group GitHub Actions updates.

Refs #131
@acgetchell acgetchell self-assigned this Jul 28, 2026
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 33d34564-fd19-41d4-968f-ef045c2be469

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The PR configures CodeRabbit commit status failures, groups GitHub Actions Dependabot updates, and adds a gated workflow that requests reviews and enables squash auto-merge for Dependabot pull requests.

Changes

Dependabot automation

Layer / File(s) Summary
Review and update configuration
.coderabbit.yaml, .github/dependabot.yml
CodeRabbit commit statuses now fail when configured checks fail, and GitHub Actions updates are grouped under a wildcard Dependabot rule.
Dependabot pull request workflow
.github/workflows/dependabot-auto-merge.yml
A gated workflow detects the current head SHA, conditionally requests a CodeRabbit review, and enables squash auto-merge for qualifying Dependabot pull requests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Dependabot
  participant GitHub Actions
  participant CodeRabbit
  Dependabot->>GitHub Actions: Open or update pull request
  GitHub Actions->>CodeRabbit: Request review if absent for the current head SHA
  GitHub Actions->>Dependabot: Enable squash auto-merge for the matching head SHA
Loading

Possibly related issues

  • acgetchell/CDT-plusplus issue 131 — Describes the same CodeRabbit, Dependabot grouping, and auto-merge workflow changes.
  • acgetchell/causal-triangulations issue 216 — Covers the same CodeRabbit status, GitHub Actions grouping, and Dependabot auto-merge changes.
  • acgetchell/markov-chain-monte-carlo issue 111 — Covers the same Dependabot grouping, failure status, and auto-merge workflow.
  • acgetchell/la-stack issue 198 — Covers the same Dependabot grouping, CodeRabbit failure enforcement, and review workflow.

Poem

Dependabot updates align,
CodeRabbit guards the status sign.
Reviews arrive, checks turn green,
Then squash merges join the scene.

🚥 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 accurately summarizes the main change: gating Dependabot auto-merges on CodeRabbit review.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/dependabot-coderabbit-auto-merge

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

@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

🤖 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/dependabot-auto-merge.yml:
- Around line 4-9: Add a pull-request-scoped concurrency group to the workflow
configuration alongside the existing "on" triggers, using the pull request
number or another PR-unique identifier and cancelling stale runs. Preserve the
current pull_request event types while ensuring overlapping runs for the same PR
are serialized.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c4766430-fd04-4919-9408-04a65a16dd7c

📥 Commits

Reviewing files that changed from the base of the PR and between ce47776 and 8124227.

📒 Files selected for processing (3)
  • .coderabbit.yaml
  • .github/dependabot.yml
  • .github/workflows/dependabot-auto-merge.yml

Comment thread .github/workflows/dependabot-auto-merge.yml
Cancel stale workflow runs to prevent duplicate CodeRabbit requests and competing auto-merge commands.

@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

🤖 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/dependabot-auto-merge.yml:
- Around line 11-13: Update the unconditional gh pr comment step in the workflow
to make review requests idempotent: before posting `@coderabbitai` review, check
whether an equivalent request already exists for the current pull request head
SHA, and skip posting when it does; otherwise post the comment as before.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 70890047-37ce-4ba5-8e23-c1c79dd36ff0

📥 Commits

Reviewing files that changed from the base of the PR and between 8124227 and 7567372.

📒 Files selected for processing (1)
  • .github/workflows/dependabot-auto-merge.yml

Comment thread .github/workflows/dependabot-auto-merge.yml
Tag each request with the pull request head SHA and skip it when the same revision was already requested.

@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

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/dependabot-auto-merge.yml (1)

48-52: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Pin auto-merge to the reviewed head commit. Add --match-head-commit "${PR_HEAD_SHA}" to this gh pr merge --auto call so a branch update between the review request and auto-merge setup can't arm a newer, unreviewed commit.

🤖 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/dependabot-auto-merge.yml around lines 48 - 52, Update the
“Enable auto-merge” step’s gh pr merge command to include --match-head-commit
using the PR_HEAD_SHA value, while preserving the existing --auto and --squash
options and PR_URL argument.
🤖 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.

Outside diff comments:
In @.github/workflows/dependabot-auto-merge.yml:
- Around line 48-52: Update the “Enable auto-merge” step’s gh pr merge command
to include --match-head-commit using the PR_HEAD_SHA value, while preserving the
existing --auto and --squash options and PR_URL argument.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7a7c5bfb-a961-40b5-aad5-e073619511e5

📥 Commits

Reviewing files that changed from the base of the PR and between 7567372 and 7f23d53.

📒 Files selected for processing (1)
  • .github/workflows/dependabot-auto-merge.yml

Require the pull request head to match the triggering SHA before enabling squash auto-merge.

@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

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/dependabot-auto-merge.yml (2)

35-44: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Require the marker to come from CodeRabbit — the API call only checks comment bodies, so any commenter can plant <!-- coderabbit-review-request:${PR_HEAD_SHA} --> and skip the review request. Match on the bot author/login as well as the marker, or auto-merge can proceed without the intended review path.

🤖 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/dependabot-auto-merge.yml around lines 35 - 44, Update the
duplicate-review check using the comments API in the workflow so it requires
both the exact marker and an author/login identifying CodeRabbit, rather than
matching comment bodies from any user. Preserve the existing early exit only
when a matching CodeRabbit comment exists.

4-9: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Add synchronize to this trigger. Dependabot head updates won’t rerun the workflow, so the CodeRabbit request and auto-merge setup won’t be re-armed after new commits.

🛠️ Proposed fix
   pull_request:
     types:
       - opened
       - reopened
       - ready_for_review
+      - synchronize
🤖 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/dependabot-auto-merge.yml around lines 4 - 9, Update the
pull_request trigger in the workflow’s “on” configuration to include the
synchronize event alongside opened, reopened, and ready_for_review, ensuring
Dependabot head updates rerun the existing auto-merge setup.
🤖 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.

Outside diff comments:
In @.github/workflows/dependabot-auto-merge.yml:
- Around line 35-44: Update the duplicate-review check using the comments API in
the workflow so it requires both the exact marker and an author/login
identifying CodeRabbit, rather than matching comment bodies from any user.
Preserve the existing early exit only when a matching CodeRabbit comment exists.
- Around line 4-9: Update the pull_request trigger in the workflow’s “on”
configuration to include the synchronize event alongside opened, reopened, and
ready_for_review, ensuring Dependabot head updates rerun the existing auto-merge
setup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 388a001a-b806-4ba5-afbd-ffe9fe30417e

📥 Commits

Reviewing files that changed from the base of the PR and between 7f23d53 and 72fc5a1.

📒 Files selected for processing (1)
  • .github/workflows/dependabot-auto-merge.yml

Trust only exact review-request markers posted by GitHub Actions, and rerun
automation when Dependabot synchronizes a new revision.
@acgetchell

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 28, 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.

@acgetchell
acgetchell merged commit a9f19ba into main Jul 28, 2026
14 checks passed
@acgetchell
acgetchell deleted the ci/dependabot-coderabbit-auto-merge branch July 28, 2026 22:16
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