Skip to content

fix(ci): only bypass admin review for dependabot patch/minor - #134

Merged
EricAndrechek merged 1 commit into
mainfrom
dependabot-130
May 13, 2026
Merged

fix(ci): only bypass admin review for dependabot patch/minor#134
EricAndrechek merged 1 commit into
mainfrom
dependabot-130

Conversation

@EricAndrechek

@EricAndrechek EricAndrechek commented May 13, 2026

Copy link
Copy Markdown
Member

Summary

Closes #130 (the title-length and admin-bypass halves; the go-mod-tidy half is intentionally deferred — manual make tidy && go mod tidy after a failing CI run is the accepted workflow).

admin-approval.yml previously short-circuited to success for all Dependabot PRs, on the assumption that "no bot approves itself + no auto-merge enabled = major bumps will sit." That assumption broke once CodeRabbit started auto-approving Dependabot PRs after autofixes. PR #127 (major-bump: TypeScript 5→6, Astro 5→6, etc.) reached mergeStateStatus: CLEAN, reviewDecision: APPROVED — one click from main — with no admin review:

  • CodeRabbit's APPROVED review satisfied the ruleset's required_approving_review_count: 1
  • The unconditional bypass posted Admin approval: success
  • CI was green

Changes

admin-approval.yml

  • New Fetch Dependabot metadata step at the top, gated on Dependabot author (continue-on-error: true so a metadata fetch failure on a Dependabot PR fail-safes to "no bypass" rather than erroring the workflow).
  • Bypass logic now only fires when update-type is version-update:semver-patch or version-update:semver-minor. Majors, unknown types, and empty UPDATE_TYPE (metadata fetch failed) fall through to the same admin-review evaluation as human PRs.
  • Updated header comment + inline comments to explain the new model and reference bug: dependabot PRs don't always pass CI #130 / docs: bump the docs-deps group across 1 directory with 4 updates #127 as the trigger.

housekeeping.yml

AGENTS.md

  • Three passages updated to reflect "Dependabot patch/minor PRs bypass; majors require admin review same as human PRs."
  • New note in the Dependabot section explaining that required_approving_review_count: 0 in the ruleset is intentional — the Admin approval status check is the single admin-review gate, so any bot's APPROVED review is no longer load-bearing.

Ruleset change (manual, after merge)

The workflow changes alone close the security hole (majors now post Admin approval: pending, blocking merge). The ruleset count-rule change is defense-in-depth — without it, CodeRabbit's approval can still satisfy count: 1 on a major bump even though the Admin approval status is now correctly pending.

Easiest path is the GitHub UI: Settings → Rules → main branch protection (ruleset 15353356) → Require a pull request before merging → set "Required approving reviews" to 0. All other rule params should stay unchanged — especially dismiss_stale_reviews_on_push: true, strict_required_status_checks_policy: true, the required status checks list, and the admin bypass actor.

(gh api works too but requires fetching the current ruleset, modifying the required_approving_review_count field inside the pull_request rule, and PUT-ing the full payload back. The UI is one click.)

Behavior matrix after this PR (workflow only, before ruleset change)

PR type Title cap Admin approval status Count rule Merges?
Dependabot patch exempt success (bypassed) bot self-approval yes, auto
Dependabot minor exempt success (bypassed) bot self-approval yes, auto
Dependabot major (no admin) exempt pending CodeRabbit may satisfy blocked by status
Dependabot major (admin approved) exempt success yes yes, manual
Human PR (no admin) 72-char pending blocked
Human PR (admin approved) 72-char success yes yes, manual

After the ruleset change (count → 0), the third row stays blocked regardless of CodeRabbit's approval state, closing the defense-in-depth gap.

Test plan

  • Once merged, next Monday's Dependabot patch/minor bumps auto-merge as before (no regression on the auto-merge path).
  • Open a draft test PR with an 80-char title to verify the title-cap exemption only applies to Dependabot (i.e., human long-title still fails).
  • On the next major-version Dependabot PR: confirm Admin approval status posts pending and the PR is blocked until an admin approves.
  • Apply ruleset change (count: 0) and verify the same major PR remains blocked even if CodeRabbit's review is APPROVED.

Notes

  • I considered also touching housekeeping.yml's reviewer-assign skip-for-Dependabot logic, but it's still correct: dependabot-automerge.yml already assigns both admins on majors, so housekeeping's skip avoids a double-request. Left as-is.
  • The CodeRabbit dashboard switch (from APPROVED to COMMENTED) is intentionally NOT part of this PR — it's a separate dashboard setting, not a repo change.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Refined automated dependency update workflows with improved approval handling for different update types.
    • Enhanced pull request validation to better support automated dependency changes while maintaining code quality standards.
    • Updated development governance documentation with clearer guidelines and more explicit rules for approval processes and automation.

Review Change Stack

admin-approval.yml previously short-circuited to success for ALL
Dependabot PRs. That worked while only admins produced APPROVED
reviews, but CodeRabbit started auto-approving — and a major-bump
Dependabot PR (#127) reached mergeStateStatus=CLEAN with no admin
involvement: CodeRabbit's review satisfied the count rule, the
unconditional bypass satisfied the status check.

Changes:
- admin-approval.yml: new fetch-metadata step (continue-on-error,
  Dependabot-gated). Bypass only fires for update-type in
  {patch, minor}. Major / unknown / empty falls through to the
  same admin-review evaluation as human PRs. Fail-safe: a
  metadata-fetch error leaves UPDATE_TYPE empty → no bypass →
  blocked PR, not auto-merged bump.
- housekeeping.yml: exempt Dependabot PRs from the 72-char title
  cap. Format regex still enforced (Dependabot already uses
  lowercase deps:/ci:/docs: prefixes). Closes the half of #130
  about long grouped-update titles.
- AGENTS.md: update gate description in three places to reflect
  the new "patch/minor bypass; majors require admin review" model.
  Note that count:0 in the ruleset is intentional — Admin approval
  status is the single admin-review gate; a bot's APPROVED review
  is no longer load-bearing.

Ruleset change (do after merge):

  gh api -X PUT repos/Wave-RF/WaveHouse/rulesets/15353356 \
    -F 'rules[3].parameters.required_approving_review_count=0'

(or via GitHub UI on ruleset 15353356; keep all other rule params
unchanged, including dismiss_stale_reviews_on_push:true.)

Closes #130. The go-mod-tidy half of the issue is intentionally
deferred — manual `make tidy && go mod tidy` after a failing CI
run is the accepted workflow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the CI automation logic to close a security gap where major Dependabot version bumps could be merged without human admin review due to bot-generated approvals. It introduces granular bypass logic for the admin-approval workflow and relaxes title length constraints for automated dependency updates, while maintaining strict standards for human-authored pull requests.

Highlights

  • Dependabot Admin Bypass Logic: Updated the admin-approval workflow to only bypass admin review for Dependabot patch and minor updates, ensuring major version bumps require explicit admin approval.
  • Title Length Enforcement: Exempted Dependabot PRs from the 72-character title length limit in the housekeeping workflow to prevent blocking grouped dependency updates.
  • Documentation Updates: Updated AGENTS.md to reflect the new security model for Dependabot PRs and clarify the role of the admin-approval status check.
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/admin-approval.yml
    • .github/workflows/housekeeping.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added github_actions Pull requests that update GitHub Actions code area/docs Documentation, site/, README area/infra CI, build, deploy, Docker, release labels May 13, 2026
@github-actions
github-actions Bot requested a review from taitelee May 13, 2026 18:30
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This PR refines Dependabot CI and merge gate behavior: the admin-approval workflow now conditionally bypasses only for patch/minor updates (via metadata fetch and UPDATE_TYPE check), housekeeping exempts Dependabot from title length limits while preserving format validation, and AGENTS.md documents the new governance rules.

Changes

Dependabot-aware CI and merge gates

Layer / File(s) Summary
Admin-approval conditional bypass for patch/minor
.github/workflows/admin-approval.yml
Workflow now fetches Dependabot update metadata, derives UPDATE_TYPE, and only bypasses the admin-review gate for patch/minor updates; major updates and fetch failures post pending status and fall through to normal admin evaluation. Inline documentation updated to reflect conditional bypass behavior.
Housekeeping title validation for Dependabot
.github/workflows/housekeeping.yml
PR author is captured and used to detect Dependabot. Title validation now conditionally enforces the 72-character max-length only for non-Dependabot authors while still validating Conventional Commits format for all authors.
Governance documentation updates
AGENTS.md
Admin-review gate description, Dependabot automation rules, and Governance Files section are clarified: patch/minor PRs bypass via dependabot-automerge.yml, major bumps require explicit admin approval via admin-approval.yml, and enforcement is workflow-driven rather than CODEOWNERS-based.

🐰 The bots now know their place, with rules that are tight,
Patch-and-minor speeds through, but major needs sight,
No more title-length tyranny for our auto-friends,
Governance workflows ensure that the merge queue transcends!
hops around celebrating cleaner CI gates 🎉

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 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 clearly summarizes the main change: restricting Dependabot PR admin-approval bypass to patch/minor updates only.
Linked Issues check ✅ Passed The PR addresses the core coding requirement from issue #130 to exempt Dependabot from the PR title length check; defers the go mod tidy automation as noted.
Out of Scope Changes check ✅ Passed All changes are scoped to the stated objectives: CI workflow modifications, Dependabot handling, title validation exemption, and documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 dependabot-130

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: 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 `@AGENTS.md`:
- Around line 344-349: Add an [Unreleased] CHANGELOG.md entry describing the
governance/workflow change: note that
`.github/workflows/dependabot-automerge.yml` now auto-approves and auto-merges
Dependabot patch/minor bumps (bypassing the `Admin approval` status check),
while major bumps require human admin approval (per `admin-approval.yml`) and
are not auto-bypassed; include that the ruleset's
`required_approving_review_count` remains 0 and that the Admin approval status
check is the single admin-review gate, and place this under the "Changed"
subsection of the [Unreleased] section.
🪄 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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 42e50e2c-421c-4a1e-9ccb-b3042ff72425

📥 Commits

Reviewing files that changed from the base of the PR and between b8fc829 and 2ec2eff.

📒 Files selected for processing (3)
  • .github/workflows/admin-approval.yml
  • .github/workflows/housekeeping.yml
  • AGENTS.md

Comment thread AGENTS.md
@github-project-automation github-project-automation Bot moved this from Backlog to Ready in WaveHouse Task Board May 13, 2026
Comment thread AGENTS.md
@claude

claude Bot commented May 13, 2026

Copy link
Copy Markdown

1 [MUST], 0 [SHOULD], 0 [MAY] — see inline thread for detail.

The workflow logic is correct: the dependabot/fetch-metadata step is properly SHA-pinned, continue-on-error: true gives the right fail-safe (empty UPDATE_TYPE → admin review, not auto-bypass), the patch/minor string comparisons are exact and safe, and the housekeeping title-length exemption is cleanly scoped to Dependabot without loosening the format regex. AGENTS.md is fully updated to match the new security model.

One gap: CHANGELOG.md has no entry for a change that the PR body itself describes as closing a security hole. AGENTS.md's doc-sync rules make this a hard [MUST] — see inline thread.

Iterate — add a CHANGELOG.md [Unreleased] / Fixed entry describing the admin-approval bypass fix.

@EricAndrechek

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates AGENTS.md to document refined governance procedures for Dependabot, specifically closing a security gap by requiring manual admin approval for major version updates while maintaining auto-merge for patch and minor bumps. It also explains the repository's reliance on a custom status check over the native review count rule and notes a title-length exemption for Dependabot. Feedback from the review includes a requirement to document these notable changes in the CHANGELOG.md as per the style guide and a suggestion to clarify which workflow file implements the approval bypass logic for better documentation consistency.

Comment thread AGENTS.md
Comment thread AGENTS.md
@EricAndrechek
EricAndrechek merged commit ab78ba0 into main May 13, 2026
12 of 13 checks passed
@EricAndrechek
EricAndrechek deleted the dependabot-130 branch May 13, 2026 18:48
@github-project-automation github-project-automation Bot moved this from Ready to Done in WaveHouse Task Board May 13, 2026
EricAndrechek added a commit that referenced this pull request May 13, 2026
Resolved conflicts in admin-approval.yml, housekeeping.yml, and AGENTS.md
between main's #134 patch/minor-only Dependabot bypass and this branch's
comment-tightening pass. Took main's new logic (UPDATE_TYPE env var,
scoped bypass, Dependabot title-length exemption) and re-tightened the
accompanying comments / AGENTS.md prose to match this branch's style.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation, site/, README area/infra CI, build, deploy, Docker, release github_actions Pull requests that update GitHub Actions code

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

bug: dependabot PRs don't always pass CI

2 participants