sorenlouv / backport

A simple CLI tool that automates the process of backporting commits on a GitHub repo
https://github.com/sqren/backport/blob/main/docs/config-file-options.md
Apache License 2.0
241 stars 57 forks source link

branchLabelMapping 1:n mapping #445

Open MstrDC opened 1 year ago

MstrDC commented 1 year ago

Hello,

Playing around to get the backport github action working. I am wondering if the following setup is supporter ( I guess currently not) Am I correct in saying this? => "PR_Label": "Branch_Name"

"branchLabelMapping": {
        "master": "master",
        "2022.2": "release_2022.2",
        "2022.2": "release_2022.2AAA",
        "2022.2": "release_2022.2BBB"
    },

What I am seeing is that 1 label will be executed for only a single line in this list. Any idea how I would get this working? If not, would this be a feature you want in your tool?

Additionally I am wondering what will happen when there is a merge conflict. Will it create the PR which people can checkout and fix? Or will it simple log an error and not create a PR?

sorenlouv commented 1 year ago

Hi there,

I think I can add support for this like:

"branchLabelMapping": {
        "master": "master",
        "2022.2": ["release_2022.2", "release_2022.2AAA", "release_2022.2BBB"]
},

WDYT?

MstrDC commented 1 year ago

@sqren , Looks good to me. If for each label, it is merged to all listed branches and it doesnt break the current regex implementation?

sorenlouv commented 1 year ago

If for each label, it is merged to all listed branches and it doesnt break the current regex implementation?

Yes, that was my intention. Haven't had time to look into it yet but hope to do it soon-ish