Dependabot governance

From c9r-io/orchestrator · View interactive version

Dependabot governance is an AI agent skill from the GitHub repository c9r-io/orchestrator. Govern Dependabot dependency upgrade PRs — audit CI, diagnose failures, combine breaking upgrades, rebase, merge, and close. Use when the user asks to handle Dependabot PRs, govern deps, or says '治理依赖', '/dependabot-governance'.

How to use this skill

Skill file

Dependabot PR Governance

Audit, remediate, and merge all open Dependabot PRs in one pass.

Phase 1: Audit

  1. List open Dependabot PRs:

```

gh pr list --state open --author 'app/dependabot'

```

  1. For each PR, fetch CI and mergeability:

```

gh pr view <N> --json title,mergeable,mergeStateStatus,statusCheckRollup,headRefName

```

  1. Record: PR number, package, ecosystem (npm/rust), version bump, CI pass/fail per job, mergeable state.

Phase 2: Classify

| Category | Criteria | Action |

|----------|----------|--------|

| green | All CI pass, mergeable | Merge in Phase 4 |

| rebase-needed | CI fails on fmt/lint only (pre-existing on main), or has merge conflict | @dependabot rebase |

| breaking-combo | CI fails on build/test — shared backend requires combined upgrade | Create combined branch in Phase 3 |

Shared-backend detection

Dependabot upgrades crates independently, but some must be upgraded together because they share a transitive dependency with breaking trait changes. Common Rust groups:

Detection method:

  1. If a PR's CI shows trait-mismatch or version-conflict compile errors, inspect Cargo.toml for the shared transitive dep
  2. Check if another open Dependabot PR bumps the counterpart crate
  3. If so, classify both as breaking-combo

Phase 3: Remediate breaking-combo PRs

  1. Investigate CI failure logs:

```

gh run list --branch <branch> --limit 1 --json databaseId -q '.[0].databaseId'

gh run view <run-id> --log-failed 2>&1 | head -200

```

  1. Find affected source files: grep -r "use <crate>" --include="*.rs" -l
  2. Create combined branch from main: deps/<combined-name>
  3. Apply all version bumps, fix compile errors
  4. Common migration patterns:
  1. Verify: cargo check && cargo fmt --check && cargo clippy && cargo test
  2. Commit, push, create PR referencing superseded Dependabot PRs
  3. Close individual Dependabot PRs: gh pr close <N> --comment "Superseded by #<combined>."

Phase 4: Merge

Order matters — merging one Dependabot PR often causes Cargo.lock conflicts in others.

  1. Merge green PRs one at a time: gh pr merge <N> --merge --delete-branch
  2. After each merge, check remaining PRs for new conflicts
  3. If conflict appears, gh pr comment <N> --body "@dependabot rebase" and wait
  4. Once rebase completes and CI passes, merge
  5. Merge combined PRs last (they tend to touch more of Cargo.lock)

Phase 5: Closure Check

All Dependabot PRs must reach a terminal state before governance is complete. Terminal states: merged, closed.

Closure loop

  1. After Phase 4, list remaining open Dependabot PRs:

```

gh pr list --state open --author 'app/dependabot'

```

  1. If any remain (e.g., waiting for @dependabot rebase):
  1. Repeat until no open Dependabot PRs remain or all remaining are reported as blocked

Completion criteria

Governance is complete only when:

Final report

Present summary table:

| PR | Package | Action | Result |

|----|---------|--------|--------|

| #N | crate x.y→z.w | merged / closed / blocked | status |

Include:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.