kodiak
kodiak copied to clipboard
Feature Request: Can kodiak use multiple automerge_label?
Problem
We are thinking of changing our PRs to require labels to merge.
Rather than adding a new bot, I was wondering if Kodiak could enforce this requirement.
Possible Solutions
Use an array: merge.automerge_label = ["semver-major", "semver-minor", "semver-patch"]
Use a regex pattern: merge.automerge_label_pattern = "^semver-(.*)$"
Must match all patterns: merge.automerge_label_pattern = ["^semver-(.*)$", "^type-(.*)$"]
I started this as a question and then changed to a feature request 😄
This change hasn't been documented or released yet, but I think it may be what you want: https://github.com/chdsbd/kodiak/pull/516
Although looking at your suggestions it might be less confusing if we have merge.automerge_label
accept an array as you suggested instead of adding the automerge_labels
field.
Although looking at your suggestions it might be less confusing if we have merge.automerge_label accept an array as you suggested instead of adding the automerge_labels field.
Either way seems fine to me 👍
I'm particularly fond of the last solution I suggested because it allows for requiring 2 labels (or more) which opens up really nicely labelled PRs.
merge.automerge_label_pattern = ["^semver-(.*)$", "^type-(.*)$"]
This example would require both the semver prefixed label and the type prefixed label.
Do you foresee needing multiple patterns?
Also, do you think you'll need anything to do semver comparisons, like only matching on minor version changes?
Do you foresee needing multiple patterns?
Perhaps in the future yes.
The idea is to avoid PR Templates with checkboxes because that data is not easily searched/filtered compared to labels.
Also, do you think you'll need anything to do semver comparisons, like only matching on minor version changes?
I didn't think about it at first but now that you bring it up, maybe kodiak could increase the number of reviewers required for semver-major 😮
That part is not necessary though. The purpose of the semver label is to create metadata for release notes and also filter PRs to show all semver-major in the previous release in case there was an unexpected regression.
Would you want to require every PR to have these labels? If so, I think a GitHub action to enforce the label requirements might be helpful.
Would you want to require every PR to have these labels
Yes that is the goal: labels required to merge.
Indeed, another bot or action would help but it would be nice to have requirements to merge codified with Kodiak.
If this is out of scope, feel free to close 🙂
I think #516 will solve the problem for the time being once that is released 👌
#516 was replaced with #522 and deployed on Saturday. However, I'm not sure that change is what you want because any of the labels specified by merge.automerge_label = ["ship it!", "merge"]
will trigger merge.
I'm open to expanding Kodiak to support linting pull requests, but it might be quicker to write an action for your specific use case.
Maybe a pull request lint config could look like the following.
[pull_request.requirement]
# require semver labels
labels = ["semver-major", "semver-minor", "semver-patch"]
# require Jira ticket number in title
title_regex = ".*JIRA-\d+.*"
# not sure what else to lint on
I'm open to expanding Kodiak to support linting pull requests,
That would be really nice 👍
It think #522 is going to solve our use case for now, thanks!
Closing since we don't need this anymore.