Skip to content

ci: gate Dependabot auto-merge on every check and Gdei exclusions - #690

Merged
Pigbibi merged 2 commits into
mainfrom
ci/dependabot-auto-merge-all-checks
Nov 1, 2026
Merged

Pigbibi merged 2 commits into
mainfrom
ci/dependabot-auto-merge-all-checks

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

AI assistance

Grok Bot (AI agent) wrote this change and its tests for Li SiYi. A human reviewer must approve it before merge.

What changed

  • dependabot_auto_merge.yml now triggers on the CI, Documentation check and Engineering governance workflows (previously only CI), checks out the default-branch gate script, and runs it. Permissions stay least-privilege (contents: write, pull-requests: write, plus read-only checks and statuses). The checkout action is pinned by SHA. A per-branch concurrency group avoids duplicate evaluations.
  • New scripts/dependabot_auto_merge_gate.py (standard library only) enables gh pr merge --auto --rebase --delete-branch --match-head-commit <sha> only when every check run (latest per name and app, including non-required ones such as Commit message convention) and every commit status (risk-gate, pr-template) on the PR head is green. Failed, cancelled, timed-out and pending checks block it. It waits up to 8 minutes for pending checks, and a later workflow_run re-evaluates.
  • It folds in the GdeiAssistant dependabot-policy exclusions, so a human is needed unless:
    • the PR is a same-repository Dependabot PR with the dependencies label, and every commit is authored by dependabot[bot], committed by web-flow and verified (a human push to the branch disables auto-merge);
    • it changes only uv.lock, pyproject.toml or requirements*.txt, or only SHA-pinned uses: version bumps of the same actions in ci.yml / docs-check.yml (never deploy, runtime, release, risk-gate, governance, codeql, hygiene or dependabot workflows);
    • the update is patch or minor, and for dependencies the version is stable and at least 1.0 with no cross-major or prerelease jump.
  • New tests/test_dependabot_auto_merge_gate.py with offline fixtures (18 tests).

How verified

Why

Dependabot PRs were merged while non-required checks (commitlint) were red, because the old workflow waited only for CI and branch protection requires just the five required contexts. It also auto-merged Dependabot bumps of deploy and runtime workflows, Dockerfile base images and 0.x packages, which the GdeiAssistant policy excludes.

Risk

  • High-risk path: .github/workflows/** needs the owner-approved label from the owner. This PR adds no labels and stays a draft.
  • Behaviour change: Dependabot PRs touching Dockerfile, protected or runtime workflows, tests, 0.x packages, build(deps)-style titles (via commitlint) or groups now need a human. Widen DEPENDENCY_FILE or ACTION_FILES in the script to relax this.
  • A cancelled or failed latest check blocks auto-merge until it is re-run. Checks that start later than the 8-minute wait are caught by the next workflow_run.
  • --auto still relies on branch protection for required checks. If Dependabot pushes a new head after auto-merge is enabled, GitHub keeps waiting on required checks only, so the next workflow_run re-evaluates the new head.

The Dependabot auto-merge workflow only waited for the CI workflow, so PRs
were merged while non-required checks such as commitlint were red.

Run a gate script from the default branch that requires every check run
and commit status on the PR head to be green before enabling auto-merge.
Also apply the GdeiAssistant dependency policy exclusions: verified
same-repository Dependabot commits only, dependency manifests or pinned
CI action bumps only, no protected workflows, no major or pre-1.0 updates.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 57dbaafe-60f3-4fac-b745-b28e44b3a89d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A fork PR branch named dependabot/* must not displace a pending same-repository run.

AI assistance: reviewed and edited with Grok Bot.
@Pigbibi Pigbibi added the owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. label Nov 1, 2026
@Pigbibi
Pigbibi marked this pull request as ready for review November 1, 2026 15:40
@Pigbibi
Pigbibi merged commit a43e163 into main Nov 1, 2026
9 of 11 checks passed
@Pigbibi
Pigbibi deleted the ci/dependabot-auto-merge-all-checks branch November 1, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant