Skip to content

ci: let Renovate automerge every non-major update once CI is green - #7171

Merged
compwron merged 2 commits into
mainfrom
renovate-automerge-green-ci
Sep 8, 2026
Merged

ci: let Renovate automerge every non-major update once CI is green#7171
compwron merged 2 commits into
mainfrom
renovate-automerge-green-ci

Conversation

@compwron

@compwron compwron commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Why

Renovate PRs that are fully green sit open instead of merging — e.g. #7158 (tom-select 2.6.1 → 2.6.2), open since Sep 1, approved, lockfile-only.

Two causes, both fixable in renovate.json:

  1. matchDepTypes gating. automerge: true was only set for dependencies/require and devDependencies/development. Lockfile-only and transitive updates carry no matching depType, so they never inherited automerge and waited on a human — which is most of the open Renovate PRs.
  2. Rebase churn cancelling CI. With the default rebaseWhen: auto, Renovate re-pushes the branch while CI is running; rspec.yml / docker.yml use concurrency: cancel-in-progress: true, so those required checks get cancelled rather than finishing. On chore(deps): update dependency tom-select to v2.6.2 #7158 there are three pushes inside three minutes, each cancelling the previous rspec and docker runs — required checks never reach a green conclusion, so auto-merge stays BLOCKED.

What changed

  • Widened the non-major rule to minor, patch, pin, pinDigest, digest, lockFileMaintenance, bump, replacement, rollback with automerge: true. Major stays dashboard-gated and never automerges.
  • Demoted the dev-deps and github-actions rules to labeling only — they inherit automerge from the rule above, so behavior is unchanged for them.
  • rebaseWhen: "conflicted" — only rebase when the branch actually conflicts, so a run that goes green stays green.
  • automergeType: "pr" + automergeStrategy: "squash" — explicit, matches the repo's squash-only merge setting.

minimumReleaseAge: "7 days" is unchanged, so nothing merges inside the stability window (vulnerability alerts still bypass it).

Branch protection (already applied, outside this PR)

main requires code-owner review, and the autoapproval app is not in CODEOWNERS, so its approval of renovate[bot] never satisfied that requirement — #7158 only became approved because @compwron reviewed it by hand. GitHub Apps cannot be listed in CODEOWNERS, so the fix is a bypass allowance instead: the Renovate app (mend/renovate) has been added to bypass_pull_request_allowances on main, alongside the existing @compwron entry. required_approving_review_count: 1 and require_code_owner_reviews: true are unchanged for everyone else.

Scope notes

Deliberately not automerged, so the blast radius stays where it was:

  • major — still dashboard-gated.
  • rollback / replacement — a version downgrade or a package identity swap should get eyes on it.
  • digest outside github-actions, and lockFileMaintenance — these sidestep minimumReleaseAge (digests have no release age; lockFileMaintenance pulls transitive deps straight to latest). GitHub Actions digest automerge is kept because it already existed before this branch.

Verification

renovate-config-validator passes on the new file.

🤖 Generated with Claude Code

compwron and others added 2 commits September 7, 2026 22:25
Renovate automerge was gated on matchDepTypes, so lockfile-only and
transitive updates (the majority of the open Renovate PRs) never got
`automerge: true` and sat waiting for a human. Widen the rule to all
non-major update types and keep the dep-type rules for labeling only.

Also set rebaseWhen=conflicted: Renovate was re-pushing branches while
CI ran, and the workflows' `cancel-in-progress` concurrency group
cancelled rspec/docker each time, so required checks never reached a
green conclusion.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Security review flagged the widened matchUpdateTypes list: `rollback`
and `replacement` would automerge a version downgrade or a package
identity swap, and `digest`/`lockFileMaintenance` sidestep
minimumReleaseAge (digests have no release age, and lockFileMaintenance
pulls transitive deps straight to latest).

Narrow the blanket rule to minor/patch/pin/pinDigest/bump and restore
the explicit automerge on the github-actions rule, so Actions digest
pinning keeps the behavior it had before this branch and nothing else
gains digest automerge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@compwron
compwron requested a lite review from Copilot September 8, 2026 05:32
@compwron
compwron marked this pull request as ready for review September 8, 2026 05:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The Renovate rule changes don’t fully align with the PR’s stated scope (notably around additional updateTypes like lockfile-only maintenance), which risks the main problem remaining unresolved.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the repository’s Renovate configuration to allow automatic merging of eligible non-major dependency updates once required CI checks complete, and reduces CI churn by limiting Renovate rebases.

Changes:

  • Enabled explicit PR automerge behavior (automergeType: "pr", automergeStrategy: "squash") and limited rebases to conflicts (rebaseWhen: "conflicted").
  • Broadened the non-major automerge rule beyond just runtime dependency depTypes to apply across depTypes for several non-major update kinds.
  • Adjusted packageRules so dev dependency updates are primarily differentiated via labeling (rather than separate automerge gating).
File summaries
File Description
renovate.json Expands automerge rules and configures rebase/merge strategy to allow green Renovate PRs to merge automatically.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread renovate.json
Comment on lines +31 to 33
"description": "Minor/patch/pin, any depType: automerge after stability window once CI is green",
"matchUpdateTypes": ["minor", "patch", "pin", "pinDigest", "bump"],
"automerge": true,
Comment thread renovate.json
Comment on lines +37 to 40
"description": "Dev deps get their own label",
"matchUpdateTypes": ["minor", "patch"],
"matchDepTypes": ["devDependencies", "development"],
"automerge": true,
"labels": ["renovate", "devDependencies", "automerge"]
@compwron
compwron merged commit 62fbfc4 into main Sep 8, 2026
14 checks passed
@compwron
compwron deleted the renovate-automerge-green-ci branch September 8, 2026 06:23
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.

2 participants