Skip to content

feat: enable automerge for digest, patch, and minor renovate updates - #14

Merged
cbrgm merged 8 commits into
mainfrom
feat/renovate-automerge
Aug 14, 2026
Merged

feat: enable automerge for digest, patch, and minor renovate updates#14
cbrgm merged 8 commits into
mainfrom
feat/renovate-automerge

Conversation

@cbrgm

@cbrgm cbrgm commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What

Enables Renovate automerge for digest, patch, and minor updates, and brings the presets up to date with current Renovate (44.x).

  • adds an automerge label to the digest/patch/minor rules in default.json
  • drops two options that current Renovate removed (matchVulnerabilityAlerts, prPriority inside vulnerabilityAlerts)
  • anchors the Makefile custom-manager patterns so nested Makefiles match
  • documents the enablement runbook in the README

The reusable auto-approve workflow itself lives in dev-kit (opendefensecloud/dev-kit#25); this PR just points the caller at it. Part of opendefensecloud/solution-arsenal#580 (config side). The GitHub-side settings land in the consuming repo, see "Whats left" below.

Why

The story wants digest/patch/minor Renovate PRs to merge without us approving them by hand. The presets already set automerge: true for those, so the real blocker is the required-review gate: Renovate cant approve its own PRs, so automerge never fires. The fix is a label plus a small auto-approve workflow: the update-type logic stays in Renovate (single source of truth) via an automerge label, and the workflow just reacts to it.

  • automerge label -> only on digest/patch/minor. Major and security never get it, so they stay human-gated.
  • merge stays gated on the repos required status checks (thats where the e2e/CI safety net the story asks for comes in). We only remove the human gate for the low-risk types, not the CI gate.
  • the workflow lives in dev-kit, next to the shared CI and repo-settings governance. This repo owns the policy (which update types are eligible), dev-kit hosts the workflow that acts on it.

While validating against current Renovate i found the presets fail validation on two removed options, so i fixed those too (they were live errors, not just style):

  • matchVulnerabilityAlerts is gone. Theres no vulnerability matcher in packageRules anymore, so security PRs are configured purely through the vulnerabilityAlerts object, which Renovate applies on top of the normal rules for vulnerability-fix PRs. Behaviour is unchanged: minimumReleaseAge: null (no stability window), automerge: false (no automerge), security label. Ref: https://docs.renovatebot.com/configuration-options/#vulnerabilityalerts
  • prPriority is only allowed in packageRules now, not inside vulnerabilityAlerts. Dropped it, its redundant anyway: vulnerability PRs already "skip the line" (Renovate ignores concurrency/schedule limits for them). Ref: https://docs.renovatebot.com/configuration-options/#prpriority
  • both errors are reproducible with renovate-config-validator (see Testing).

Anchoring ["Makefile"] -> ["/(^|/)Makefile$/"]: the plain form only matches a root-level Makefile, so nested Makefiles in a monorepo would be missed. The regex form matches at any depth and mirrors what go.json already does for flake.nix. Ref: https://docs.renovatebot.com/configuration-options/#managerfilepatterns

Testing

Validated all three presets against current Renovate:

$ npx --yes --package renovate@44.23.3 -- renovate-config-validator default.json go.json k8s.json
 INFO: Validating default.json as global config
 INFO: Validating go.json as global config
 INFO: Validating k8s.json as global config
 INFO: Config validated successfully against 3 file(s)

For reference, before the fix the same validator reported the removed options:

ERROR: Invalid configuration option: packageRules[0].matchVulnerabilityAlerts   (x3 in default.json, x1 in k8s.json)
WARN:  "prPriority" can't be used in "vulnerabilityAlerts". Allowed objects: packageRules.

The workflow (and its actionlint run) lives in the dev-kit PR. End-to-end automerge cant be exercised from this repo, it needs a live Renovate PR + the GitHub settings, which happens in the consuming repo.

Notes for reviewers

Whats left, to be done in the consuming repo (e.g. solution-arsenal) and documented in the new README section:

  • add the caller workflow (from dev-kit's example/.github/workflows/renovate-auto-approve.yml), pinned to a dev-kit tag/SHA
  • Settings -> Actions -> General: enable "Allow GitHub Actions to create and approve pull requests" (GitHub docs), otherwise the bot approval is rejected
  • branch ruleset: require the CI/e2e checks, require 1 approval (the workflow provides it), give Renovate write + allow auto-merge

Pairs with opendefensecloud/dev-kit#25 (hosts the reusable workflow). Merge order doesnt matter, nothing runs until a consuming repo adds the caller.

Checklist

  • Tests added/updated (config validated with renovate-config-validator; no unit-test harness in this repo)
  • No breaking changes (security-update behaviour is preserved via the vulnerabilityAlerts object; automerge only fires once required checks pass)
  • Readable commit history (semantic commits, each validates on its own)
  • AI code review considered and comments resolved

cbrgm added 5 commits August 11, 2026 10:22
…ority

Renovate 44.x rejects matchVulnerabilityAlerts (no vulnerability matcher
exists in packageRules anymore) and prPriority inside vulnerabilityAlerts.
Security PRs keep their behaviour via the vulnerabilityAlerts object
(minimumReleaseAge: null, automerge: false, security label); those PRs
already skip queues, so prPriority was redundant.
Plain "Makefile" only matched the repo root. Anchoring with
/(^|/)Makefile$/ also matches Makefiles in subdirectories, matching
the flake.nix pattern already used in go.json.
Adds an automerge label to exactly the update types that are safe to
merge without a human. The reusable auto-approve workflow reacts to this
label. Major and security updates never get it, so they stay
human-gated.
Reusable workflow_call workflow that approves a Renovate PR carrying the
automerge label (and not the security block label) using the gh CLI, no
third-party action. Consuming repos call it from a pull_request trigger.
The merge stays gated on required status checks; security PRs are never
approved.
Adds an "Enabling automerge in a consuming repo" runbook (caller
workflow + required GitHub settings) and a Workflows section. Also
updates the security-window note, which referenced the removed
matchVulnerabilityAlerts option, to describe the vulnerabilityAlerts
object instead.
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cbrgm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fe477979-5c84-444b-b85b-89ed9c820ddc

📥 Commits

Reviewing files that changed from the base of the PR and between 37b16ca and 266c91c.

📒 Files selected for processing (1)
  • README.md
📝 Walkthrough

Walkthrough

Changes

Renovate automerge

Layer / File(s) Summary
Renovate update policy
default.json, k8s.json, README.md
Patch, digest, and minor updates receive the automerge label. Vulnerability alerts are no longer excluded from these rules. Makefile matching now supports any repository directory.
Repository adoption
README.md
The README documents vulnerability-alert behavior, reusable workflow usage, required permissions, branch settings, Renovate access, and Code Owners limitations.

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

Possibly related issues

  • opendefensecloud/solution-arsenal#580: The changes configure and document automerge behavior for digest, patch, and minor Renovate updates.

Possibly related PRs

Suggested reviewers: dermorz

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description check ✅ Passed The description includes all required sections, explains the changes and motivation, documents testing, and records reviewer notes and checklist status.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: enabling automerge for Renovate digest, patch, and minor updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/renovate-automerge

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

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/renovate-auto-approve.yml:
- Around line 38-42: Update .github/workflows/renovate-auto-approve.yml lines
38-42 to handle pull requests that gain the security label by dismissing
approvals created by this workflow’s github-actions[bot], while preserving the
existing Renovate auto-approval path. Align the documented behavior and claims
in README.md lines 33, 49, and 80 with this security-label revocation behavior.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f43fd3a2-aaec-4df7-a3dd-36d36e070f67

📥 Commits

Reviewing files that changed from the base of the PR and between bde1c19 and c562095.

📒 Files selected for processing (4)
  • .github/workflows/renovate-auto-approve.yml
  • README.md
  • default.json
  • k8s.json

Comment thread .github/workflows/renovate-auto-approve.yml Outdated
@cbrgm

cbrgm commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

This PR is just the mechanism, turning it on is something we should discuss in the team. i'm for it.

Pro: kills noise, faster patch uptake, no reviewer bottleneck. Stability window + digest pinning + required CI still gate every merge.

Con: CI becomes the only gate, so it has to be trustworthy. Plus supply-chain risk inside the 3-day window, semver might not always honest (depending on the project :D)

Decide:

  • Do we trust e2e/CI enough to merge on green with nobody looking? which checks are required?
  • Window: keep 3 days or bump it? add Merge Confidence?
  • Pilot scope: digest+patch first, or all three? which repo first? Solar + Arc?

my personal suggestion: pilot solution-arsenal, digest+patch only, watch 2-3 weeks, then expand. Precondition: required checks include a real e2e run. Major/security stay human-gated either way..

A label change does not dismiss existing reviews, so a PR approved while
labeled automerge could keep that approval after later gaining the
security label, satisfying the review gate without a human. The workflow
now also runs on the block label and, if it finds its own prior approval,
supersedes it with a request-changes review. Uses request-changes rather
than a dismissal because dismissing a review on a protected branch needs
admin rights that github-actions[bot] does not have.
The reusable workflow moves to opendefensecloud/dev-kit, which already
owns shared CI and repo-settings governance. This repo keeps the config
(the automerge label + the automerge model docs) and points the caller
at dev-kit.

@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

🧹 Nitpick comments (1)
README.md (1)

80-80: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Document the reusable-workflow access policy.

If a repository or organization restricts allowed actions and reusable workflows, it must allow the referenced opendefensecloud/dev-kit workflow. Otherwise, the caller fails before it can approve Renovate pull requests. Add this prerequisite to the settings checklist. (docs.github.com)

🤖 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 `@README.md` at line 80, Update the README settings checklist near the existing
workflow-permissions prerequisite to document that repository or organization
action policies must allow the referenced opendefensecloud/dev-kit reusable
workflow, linking to the relevant GitHub documentation.
🤖 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 `@README.md`:
- Around line 71-76: Update the reusable workflow reference in the README to use
a full 40-character commit SHA instead of the mutable <sha-or-tag> placeholder
or tag. Preserve the corresponding released tag in an adjacent comment for
Renovate, and leave the pull-request event types and permissions unchanged.

---

Nitpick comments:
In `@README.md`:
- Line 80: Update the README settings checklist near the existing
workflow-permissions prerequisite to document that repository or organization
action policies must allow the referenced opendefensecloud/dev-kit reusable
workflow, linking to the relevant GitHub documentation.
🪄 Autofix

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2e09898b-c2aa-41f6-96c2-6ac74ce29e53

📥 Commits

Reviewing files that changed from the base of the PR and between c562095 and 37b16ca.

📒 Files selected for processing (1)
  • README.md

Comment thread README.md Outdated
@cbrgm

cbrgm commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

For the record: we decided to host shared/reusable workflows in dev-kit for now (next to the CI + repo-settings governance), so the auto-approve workflow moved there -> opendefensecloud/dev-kit#25. This repo keeps the config/policy only.

Keeps the documented caller in sync with dev-kit so removing the
security label re-evaluates the PR.

@olzemal olzemal 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.

lgtm, let's adopt it in one of our repos for a while as you suggested.

@cbrgm
cbrgm merged commit f58ca29 into main Aug 14, 2026
4 checks passed
@cbrgm
cbrgm deleted the feat/renovate-automerge branch August 14, 2026 09:12
cbrgm added a commit to opendefensecloud/dev-kit that referenced this pull request Aug 14, 2026
## What

Adds a reusable `renovate-auto-approve.yml` workflow to dev-kit, plus an
example caller and an onboarding note.

## Why

We want Renovate to auto-merge digest/patch/minor PRs without a manual
approval. The renovate-config presets already set `automerge: true` and
add an `automerge` label to those update types, but Renovate cant
approve its own PRs, so the required-review gate never clears. This
workflow provides the approval for labeled PRs and revokes it if a PR
later turns out to be a `security` one.

Originally i put this in renovate-config
(opendefensecloud/renovate-config#14), but dev-kit is the better home:
it already owns the shared CI workflows and the `repo-settings`
governance (labels, merge strategy, the `protect-main` ruleset).
renovate-config keeps the *policy* (which update types are eligible),
dev-kit hosts the *workflow* that acts on it. So renovate-config#14 now
just points its caller at dev-kit.

Context: opendefensecloud/solution-arsenal#580.

## Testing

Linted the reusable workflow (the one that actually runs in this repo):

```
$ actionlint .github/workflows/renovate-auto-approve.yml
(no findings)
```

The `example/` copy is a template (GitHub only runs workflows under
`.github/workflows/`, not `example/...`), so it never executes here. The
`@<sha-or-tag>` ref is an intentional placeholder consumers pin when
they copy it. End-to-end automerge can only be exercised on a real
Renovate PR in a consuming repo with the GitHub settings applied.

## Notes for reviewers

- Follow-up worth considering: teach `make repo-settings` to also flip
"Allow GitHub Actions to create and approve pull requests" so it isnt a
manual step. Left out here to keep this PR focused. Can open an issue if
we want it.
- Pairs with opendefensecloud/renovate-config#14 (repoints the caller to
dev-kit). Merge order doesnt matter, nothing runs until a consuming repo
adds the caller.

## Checklist
- [x] Tests added/updated (workflow linted with `actionlint`; no runtime
harness for a reusable workflow in this repo)
- [x] No breaking changes (new opt-in workflow; nothing runs until a
repo copies the caller)
- [x] Readable commit history
- [x] AI code review considered and comments resolved


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added automated approval for eligible Renovate update pull requests
labeled for auto-merge.
* Automatically withdraws approval when a security-related label is
applied.
* Keeps merging subject to required status checks and configurable
workflow settings.
* Added an example configuration for enabling the automation in a
repository.

* **Documentation**
* Added setup guidance, permission requirements, status-check
configuration, and update eligibility details to the repository
checklist.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
cbrgm added a commit to opendefensecloud/solution-arsenal that referenced this pull request Aug 14, 2026
## What

- adds the renovate auto-approve caller workflow -> calls dev-kit's
reusable `renovate-auto-approve.yml` (opendefensecloud/dev-kit#25),
pinned to `8cb6197` (post-v1.0.13 re-pin to the next release tag once
cut, noted in the file)
- created the missing `automerge` label

## Why

The renovate-config presets set `automerge: true` + the `automerge`
label on digest/patch/minor PRs, but Renovate cant approve its own PRs,
so the required-review gate never clears. This workflow provides that
approval for labeled PRs; anything labeled `security` is skipped and an
earlier approval revoked

Everything else was already in place, verified via API: "Allow GitHub
Actions to approve PRs" enabled, `protect-main` requires 1 approval +
`check`/`lint`/`test`/`CodeQL`, `allow_auto_merge` on -> merges stay
gated on CI, majors and security updates stay human-gated.

Related: automerge policy (labels, update types, stability window) ->
opendefensecloud/renovate-config#14, reusable workflow ->
opendefensecloud/dev-kit#25.

## Testing

CI config only, no runnable behavior change
YAML parses clean, `uses:` ref resolves to the merged dev-kit workflow.

## Checklist

- [x] Tests added/updated (not applicable, CI config only)
- [x] No breaking changes
- [x] Readable commit history (squashed and cleaned up as desired)
- [ ] AI code review considered and comments resolved
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.

3 participants