renovatebot / renovate

Home of the Renovate CLI: Cross-platform Dependency Automation by Mend.io
https://mend.io/renovate
GNU Affero General Public License v3.0
17.18k stars 2.25k forks source link

Merge using comments #1355

Open rarkins opened 6 years ago

rarkins commented 6 years ago

Scenario:

The result is that a reviewer/merger needs to keep checking back over a period of perhaps hours as they wait for tests to finish.

Solution:

Inspiration: https://github.com/uber-workflow/probot-app-merge-pr

rarkins commented 6 years ago

To the Algolia team e.g. @samouss and @Haroenv, I often see you merging multiple PRs close together. Would this approach save you time? e.g. you manually review the PRs in a batch and add a comment "!merge" to each that is OK. Renovate will then merge them as fast as is possible allowing for any necessary conflict resolving, rebasing, retesting, etc.

Haroenv commented 6 years ago

I'd like it more if a review would do this, rather than !merge, is that possible?

rarkins commented 6 years ago

It's possible today, although perhaps with some warning.

First of all, how that would work:

The warning is that maybe:

Haroenv commented 6 years ago

Those are good points, is there some way to check if reviewer can merge?

rarkins commented 6 years ago

If you have restricted who can merge to master in the repo (e.g. in branch protection settings you have listed individuals or teams with merge rights) then unfortunately Renovate cannot merge. This is because of a GitHub bug/limitation where they don't offer any way to add an app (bot) to that list so all apps get blocked from merging if you enable that type of branch protection.

Otherwise, if you just mean users with write access to the repository vs read-only, then we can probably look that up. Please confirm if that's what you mean or if it's something else.

rarkins commented 6 years ago

Maybe.. we could also add a new config option to renovate's config that lets you define which users should merge if they review/approve the PR.

ghost commented 6 years ago

I like the idea of using built-in functionality (reviewers) of the GitHub interface for this workflow.

(I use the merge when pipeline succeeds feature in GitLab quite often to help queue up merge requests when several come in at once)

rarkins commented 4 years ago

Closed in favour of #3172

rarkins commented 3 years ago

Reopening to add this comment by @azu in #3172:

Merge via comment is useful for me. GitHub/GitLab supports commenting via email and I can merge the dependabot's PR from email client like gmail.

UseCase: renovatebot/dependabot create same Pull Request to multiple repositories at same time. It is hard that open each PRs and click merge button. Instead of it, I can just reply @dependabot merge from email client.

image

checkbox approach may not cover this case.

rarkins commented 3 years ago

GitHub's native automerge feature is a viable and someway better workaround for this

anantakrishna commented 3 years ago

GitHub's native automerge feature is a viable and someway better workaround for this

Can you please give a link? I cannot find this feature by googling.

rarkins commented 3 years ago

Google for "GitHub automerge"

anantakrishna commented 3 years ago

Thanks, and excuse me for a bit of laziness. I was searching for “GitHub's native automerge feature”, and mostly only Dependabot-related articles came up.

Here is the link for future strangers: https://docs.github.com/en/github/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/automatically-merging-a-pull-request

rushilsrivastava commented 2 years ago

Wanted to jump in here and provide an additional use case for merge using comments. We use Poetry to manage our Python dependencies, which breaks the lock file each time one dependency is updated. This means that there is a lot of time one has to wait before merging in a subsequent dependency (i.e. wait for a rebase with the correct lock file). It would be really convenient to have a "rebase & merge" comment option.

rarkins commented 2 years ago

Which platform/hosting mode are you using?

rushilsrivastava commented 2 years ago

Which platform/hosting mode are you using?

We use the GitHub App.

rarkins commented 2 years ago

Rebasing should happen automatically in the GitHub app without requiring manual intervention. Please create a separate discussion topic if you're not seeing that and can provide some logs or other evidence to help pinpoint it

rushilsrivastava commented 2 years ago

Rebasing should happen automatically in the GitHub app without requiring manual intervention. Please create a separate discussion topic if you're not seeing that and can provide some logs or other evidence to help pinpoint it

Rebasing does happen automatically, it just takes a significant amount of time using Poetry (Between 10-15 minutes if manually triggered, 25-30 minutes if automatic). I can open another discussion topic, but I don't think this is a limitation in Renovate, but with Poetry itself. We had a similar problem on Dependabot, but having the rebase and merge problem made it easy to handle.

rarkins commented 2 years ago

Poetry may be slow and that's not Renovate's fault, but the following should be false:

(Between 10-15 minutes if manually triggered, 25-30 minutes if automatic)

Automatic rebasing should happen as fast/faster than you can achieve with manual, because the merging of any Renovate PR should trigger a priority job in the queue.

I would have hoped that if you enable GitHub automerge in each PR and just leave them you should see them rebased until they are all merged (or failing tests).

Inok commented 1 year ago

Such "semi-auto" merge will be useful. In my case, I don't want to merge everything manually, but I want to review the changelog of the package being updated and changes in my source code before merging them.

Maybe it's possible to add an option that enables such "semi-auto" flow? For example, by adding a new checkbox to PRs? (like force rebase checkbox) If it's checked, Renovate will try to rebase/merge the PR automatically. If it's not - Renovate will wait for confirmation.

So automerge option may be changed from a boolean flag to something like:

Or simply add automergeType=pr-with-confirmation, which enables such behavior.

rarkins commented 1 year ago

automergeType=checkbox might make most sense

HonkingGoose commented 1 year ago

@rarkins said they want to do the linked issue first: ^quote

I'll mark this issue status:blocked. After we've tried the checkbox-approach, we'll decide if we want to work on this issue. 😉

HonkingGoose commented 1 year ago

Related discussion:

HonkingGoose commented 3 weeks ago

Summary

How about prioritizing:

And closing these issues/discussions as won't do:

That way the bulk of users have a good way to speed up the "merge multiple Renovate PRs" workflow.

Why we opened this issue

This is the problem we wanted to solve by making a new "merge using comments" feature:

Scenario:

  • Repository has 5 Renovate PRs
  • All 5 pass tests, and look OK to a reviewer -Reviewer wants to merge them all "right away", but:
  • To be safest, you should merge one, then rebase/retest the rest, then merge, then rebase/retest, etc

The result is that a reviewer/merger needs to keep checking back over a period of perhaps hours as they wait for tests to finish.

Changes since the issue was created

GitHub Merge Queue

GitHub now has Merge Queue, [^footnote-merge-queue] where you can approve a PR, put it in the Queue, and let GitHub merge when the tests pass. GitHub will make sure the combination of PRs passes the tests. You can use GitHub Merge Queue with Renovate. [^footnote-renovate-docs]

GitLab has Merge Trains (we don't support that yet)

We're going to a checkbox-based system?

I think, in general, we're going towards a checkbox-based system? See:

Difficult to verify comment is allowed to merge

If we want to keep this issue open, we still need to decide how to get Renovate to only accept merge comments from allowed users:

[^footnote-merge-queue]: GitHub Docs, managing a merge queue [^footnote-renovate-docs]: Renovate docs, GitHub Merge Queue