Skip to content

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

@MPV

Description

@MPV

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions