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

Control merge method through PR comment #567

Open
kbakk opened this issue Nov 25, 2024 · 1 comment
Open

Control merge method through PR comment #567

kbakk opened this issue Nov 25, 2024 · 1 comment

Comments

@kbakk
Copy link

kbakk commented Nov 25, 2024

Hi! Thanks for sharing and maintaining this project! 🙌

Sometimes we want to use different merge methods, based on the commits to a branch. It would be nice if we could control it per branch - e.g. by commenting on a PR with "bulldozer squash", which would have bulldozer do a squash merge.

merge:
  merge_method:
    - method: squash
      trigger:
        pr_comment: "bulldozer squash"
    - method: rebase
      trigger:
        pr_comment: "bulldozer rebase"

Would this behavior be desired? It could of course be completely disabled by not configuring it.

@bluekeyes
Copy link
Member

It's not obvious from our docs, but I think this actually works today. I created a test project with the following configuration and it worked as you described. Bulldozer triggered when I left a comment (or added a label) and it used the appropriate merge method for that trigger to merge the PR:

version: 1
merge:
  merge_method:
    - method: merge
      trigger:
        comments: ["bulldozer merge"]
    - method: merge
      trigger:
        labels: ["bulldozer: merge"]
    - method: squash
      trigger:
        comments: ["bulldozer squash"]
    - method: squash
      trigger:
        labels: ["bulldozer: squash"]

Please try it out and let me know if this is what you were looking for. Note that unlike the "standard" trigger block, when used in merge_method, all of the triggers much match to select a method. That's why I had to duplicate the definitions for labels and comments, instead of combining them in to a single rule.

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

No branches or pull requests

2 participants