Support merge trains (any platform) #21649
Replies: 27 comments 2 replies
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Thanks, but I don't think this will be helpful here. We don't have a problem with merging - we have a problem with lots of rebasing, which GitHub automerge wouldn't help. |
Beta Was this translation helpful? Give feedback.
-
For future reference: the alternative idea of "rollup" updates has its own issue: |
Beta Was this translation helpful? Give feedback.
-
@rarkins GitHub is starting work on something similar to GitLab's Merge train, they're calling it a "Pull Request Merge Queue". Relevant quote from their issues: 1 2
Footnotes |
Beta Was this translation helpful? Give feedback.
-
I'm wondering if it's more about "keep rebasing until merged" rather than merge trains - which intentionally rebase themselves on top of the PR they trail in the queue (it's more efficient) |
Beta Was this translation helpful? Give feedback.
-
I just checked the GitLab docs on merge trains so I'm on the same page as you. 1
Wow! I'm really impressed with the smart behavior that GitLab managed to build! 🤯 Maybe GitHub is thinking of something similar, it's a bit hidden in this quote:
The bolded part sounds a bit similar to GitLabs merge train? In any case, even if GitHub "only" builds a "brute-force" mechanism that auto-updates the PR branch with Footnotes |
Beta Was this translation helpful? Give feedback.
-
Yes, that quote does sound like they're planning something similar |
Beta Was this translation helpful? Give feedback.
-
Just letting you know that some changes seem to be necessary in order for Renovate to merge using GitHubs new Merge Queue. We have enabled it on one of our repositories recently, and since then no Renovate PRs have been merged automatically for that repository. |
Beta Was this translation helpful? Give feedback.
-
Are you attempting to manually add a Renovate PR to your branch's merge queue as per the description in https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request-with-a-merge-queue ? Please provide much more details of what you're trying to do and what doesn't work. E.g. if you have mandated a merge queue in a branch, and now Renovate can't automerge, that doesn't sound too surprising based on the docs I saw above |
Beta Was this translation helpful? Give feedback.
-
This might differ from one beta tester to another beta tester if GitHub is doing A/B testing, but in our case it seems necessary to require the use of merge queues in order to be able to use it at all. |
Beta Was this translation helpful? Give feedback.
-
It sounds like the current approach of merge queues is potentially incompatible with the concept of automerging, unless we can access those options via API |
Beta Was this translation helpful? Give feedback.
-
Is this a feature that is planned to be implemented? We're having to manually merge Renovate PR's at the moment as we're using GitHub merge queues, but it'll be nice to be able to auto-merge as before so that it's not a chore our engineers are having to maintain. |
Beta Was this translation helpful? Give feedback.
-
Nothing in |
Beta Was this translation helpful? Give feedback.
-
Here's the new upstream issue for general release of the GitHub merge queue: The GitHub Docs, Merging a pull request with a merge queue have some more information about how it works in the GitHub interface. But that's probably not much help for the maintainers of Renovate. The feature is still in beta, per the GitHub docs:
|
Beta Was this translation helpful? Give feedback.
-
Functionally, is this a new type of "automerge" where Renovate adds it to a merge queue once requirements are met, instead of enabling automerge at PR creation or automerging itself? Technically, does the API for this exist yet? |
Beta Was this translation helpful? Give feedback.
-
I don't know if there's an API yet, but there's a new webhook 1 event and GitHub Actions workflow trigger 2 called
I recommend you read all three links, and see if it's what you need. 😉 Footnotes
|
Beta Was this translation helpful? Give feedback.
-
After reading the docs and this thread, I'm 90% sure of the answer to my question but I wanted to clarify... At this time, is there a way to use Renovate + GitHub Merge Queue + Automerge (squash)? (if so, I'd love to know more!) |
Beta Was this translation helpful? Give feedback.
-
There's no way to use Renovate + GitHub Merge Queue + Automerge (squash). The Merge Queue feature is still in limited public beta, and we didn't get in the beta. I think we need to have access to the Merge Queue feature first. That way we can test the feature and see how to integrate it into Renovate bot. |
Beta Was this translation helpful? Give feedback.
-
The feature also needs to be available via API. BTW I think once it's technically feasible, we should break GitHub Merge trains into its own issue. This one was intended originally as a "generic" way to achieve the same without native platform support |
Beta Was this translation helpful? Give feedback.
-
Thank you for the context, I'll bring it up to GitHub in an upcoming discussion about the Netlify Deploy Preview <> GitHub Merge Queue developer workflow. If you'd like, I can ask that they enroll you to the beta? |
Beta Was this translation helpful? Give feedback.
-
Yes please do - best would be this open source org "renovatebot" but if they insist that it should be an enterprise customer only then my and Renovate's parent company "mend" would still be useful for me to test with if included. |
Beta Was this translation helpful? Give feedback.
-
The github merge queue feature is in public beta now and I have been playing around with it. The merge_group event is currently broken but otherwise it seems usable. |
Beta Was this translation helpful? Give feedback.
-
Does it support an API for Renovate to be able to add its PRs to the queue? |
Beta Was this translation helpful? Give feedback.
-
As far as I can tell there isn't a REST api, but there is a github graphql mutation query get_pr_id {
repository(owner: "$REPO_ORG", name: "$REPO_NAME") {
pullRequest(number: PR_NUMBER) {
id
}
}
}
mutation add_to_queue {
enablePullRequestAutoMerge(input: {pullRequestId: "$ID_FROM_PREVIOUS_QUERY", mergeMethod: MERGE}) {
clientMutationId
}
} |
Beta Was this translation helpful? Give feedback.
-
Actually, Renovate can already add to GitHub merge queues. It is necessary to enable auto merge in GitHub's repo settings (even though a merge queue is being used). Renovate is already making the right API call: renovate/lib/modules/platform/github/index.ts Lines 1455 to 1458 in bde9512 So it ends up looking like so: This is using platform auto merge: {
"automerge": true,
"automergeType": "pr",
"platformAutomerge": true
} |
Beta Was this translation helpful? Give feedback.
-
Let's discuss the GitHub Merge Queue in this issue from now on: |
Beta Was this translation helpful? Give feedback.
-
Considering how good GitHub's merge queue feature is, I no longer plan for us to have a "generic" merge train, so have converted this to an Ideas discussion |
Beta Was this translation helpful? Give feedback.
-
What would you like Renovate to be able to do?
Similar to the idea in #5573 but to be implemented completely within Renovate's own logic.
Describe the solution you'd like
Something that means multiple PRs don't need to be rebased after each merge.
Describe alternatives you've considered
Having a "roll up" PR that adds all passing updates (i.e. test them individually, then add to a single group PR after).
Additional context
renovatebot/config-help#610
Beta Was this translation helpful? Give feedback.
All reactions