Closed jftanner closed 2 years ago
In my past experience, GitHub won't allow a merge if there's a pending codeowner review, even if others have approved. In other words, automerge and codeowners are unfortunately incompatible due to how GitHub works
I should clarify that the CODEOWNERS file defines a team (microservices-maintainers
) as the owner, which the automation user is a member of. So after it approves, the PR is fully green with no pending reviews.
As an example, this is what it looks like on the PR page:
I think I maybe misunderstood your original post, because of the title.
Do you really just mean "Renovate takes too long to automerge PRs?" because you have an expectation that it should run a job immediately after the branch turns green?
If so, such a feature is not supported or documented, so it's a matter of mistaken expectations. Renovate enqueues jobs hourly by default and should automerge the next time it runs.
As far as I can tell, it doesn't seem to ever auto-merge for some repos. Even if left overnight.
What is the (debug) log for when it does run on that repo? It should run on each repo up to once per hour (depends on how many repos you have, but a job is enqueued hourly for each repo).
That's a good question. I don't have any PRs open at the moment and am on vacation until Thursday, but I'll create one and stream the logs when I get back.
BTW setting LOG_FORMAT=json
is useful if you are streaming them to an external log system
It looks like there's a couple things going on here. The first is quite embarrassing. Apparently, I already figured out that PRs won't get auto-merged immediately. My auto-approve bot automatically merges PRs by itself, when possible. I compared two PRs: one that had auto-merged immediately and another that was approved but pending. I realized, way too late, that the auto-merged one wasn't merged by Renovate, but rather by my own bot. Apparently I completely forgot an entire feature I wrote a year ago. :'(
I've got three different results:
I have no idea what causes the third result. But, given that it works for other repos, the issue must be somewhere in my repo configuration. So, I'll figure it out. (Or fix my auto-approver to merge everything reliably.)
Sorry for wasting your time!
Odds are good that I'm missing something obvious, so I'm hoping someone can point me in the right direction.
Configuration & Use-Case
Here's the way I have things set up, and why. I'll explain in as much detail as our security policy allows.
We must have branch protection rules in place, along with a CODEOWNERS. However, we have a couple Node modules that are re-used in many, many services, so we want non-breaking changes to those modules to be auto-merged into the other services as quickly as reasonably possible. So, we found a way to get auto-merge working. It's not fully working though, as I'll describe later.
Here's our configuration:
What we expect
What actually happens
Automerge: Enabled
.Watching the logs from Renovate, it seems like it finishes the work queue right away, before the check runs even register. Example:
However, when the checks finish, there's no output that indicates that Renovate received another event that might trigger a merge. It's possible that it would merge automatically the next time it does a scan. But that won't be until the next morning, which is way too long a delay for us.
What's strange, though, is that there are some repositories where it does automatically merge without any problems. I'm still trying to figure out what the difference might be, but haven't had any success so far.
Tl;Dr
Sometimes renovate will merge its PRs, sometimes it won't. I haven't yet figured out the difference between the two situations. Any advice would be greatly appreciated!
And, as a side question: is there an api/mechanism to trigger a scan of all repos (or even specific repos) when we release a new version that we know needs to be consumed?