Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic/smart --pr-merge-method (trying several methods) #281

Open
MPV opened this issue Nov 20, 2023 · 1 comment
Open

Add dynamic/smart --pr-merge-method (trying several methods) #281

MPV opened this issue Nov 20, 2023 · 1 comment

Comments

@MPV
Copy link
Contributor

MPV commented Nov 20, 2023

As it's possible to select which kinds of methods for "merging" a PR is allowed, i.e. any/all of these:

  • merge
  • rebase
  • squash

Thus one can run into problems such as this one (if a repo has disallowed "merge commits"):

failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: PUT https://api.github.com/repos/my-org/my-repo/pulls/310/merge: 405 Merge commits are not allowed on this repository. []" repository=my-org/my-repo

Full log row:
time="2023-11-20T10:39:22Z" level=error msg="Repository update failed" error="failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: failed to merge Pull Request https://github.com/my-org/my-repo/pull/310: PUT https://api.github.com/repos/my-org/my-repo/pulls/310/merge: 405 Merge commits are not allowed on this repository. []" repository=my-org/my-repo

Showing on the PR like this in the web UI:

Skärmavbild 2023-11-20 kl  11 46 39

But it's only possible to select one to try with, as per:

--pr-merge-method (string): the merge method to use. Either merge, squash, or rebase. Default to merge.

-- https://dailymotion-oss.github.io/octopilot/v1.5.3/index.html#merging-pull-requests

...and in an organization with hundreds/thousands or repositories it might not be feasible to know/decide with merge method is allowed on the repos 🙈.


Hence I'd like to suggest we add either:

  1. a "smart/auto" --pr-merge-method (which tries all of them, in some kind of order)
  2. --pr-merge-methods with a list (of the ones to try, and in which order)
  3. allow passing a list to --pr-merge-methods (ditto)
@vbehar
Copy link
Collaborator

vbehar commented Nov 22, 2023

thanks, nice idea! I'll have a look at implementing it, I think with a list of methods, and trying each one until one works - or everything fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants