RepoSense icon indicating copy to clipboard operation
RepoSense copied to clipboard

Renovate Automerge

Open joeng03 opened this issue 8 months ago • 4 comments

Propose to enable auto-merges by Renovate to prevent multiple PRs clogging up the space. We can configure it to merge only if CI passes.

Refer to: https://stackoverflow.com/questions/70453901/configure-renovate-bot-to-merge-minor-and-patch-updates-automatically

joeng03 avatar Mar 31 '25 02:03 joeng03

I believe automerge is already enabled, at least from what I can see in the renovate.json. Is there a misconfiguration or something?

sopa301 avatar Apr 01 '25 04:04 sopa301

According to the StackOverflow post, we should allow auto-merge in the GitHub repository settings too for it to work. Will need help from Prof @damithc to enable it.

joeng03 avatar Apr 01 '25 05:04 joeng03

@joeng03 I've updated repo settings to allow auto-merging and auto-deleting of the branch. The master branch is already protected in the suggested by the s/o post.

damithc avatar Apr 01 '25 08:04 damithc

Automerging defaults to using Pull Requests (automergeType="pr"). In that case Renovate first creates a branch and associated Pull Request, and then automerges the PR on a subsequent run once it detects the PR's status checks are "green". If by the next run the PR is already behind the base branch it will be automatically rebased, because Renovate only automerges branches which are up-to-date and green. If Renovate is scheduled for hourly runs on the repository but commits are made every 15 minutes to the main branch, then an automerge like this will keep getting deferred with every rebase.

We'll have to wait for a day where there's no merges in the previous day to check if the current config works properly.

For now, I'll merge the ones that pass CI to free up our CI resources.

sopa301 avatar Apr 02 '25 16:04 sopa301