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

Populate labels from the PR to the backported PRs #3257

Open
v1v opened this issue Sep 23, 2021 · 3 comments
Open

Populate labels from the PR to the backported PRs #3257

v1v opened this issue Sep 23, 2021 · 3 comments

Comments

@v1v
Copy link
Contributor

v1v commented Sep 23, 2021

What

#2288 added support for assigning labels to the backported PRs, I'd like to extend this functionality to populate the labels from the source PR to the backported PRs.

Proposal

Extend the backport action with a new list option, f.i: populate_labels (or something else)

See the below snippet as an example of how to configure mergify with it:

pull_request_rules:
  - name: backport patches to stable branch
    conditions:
      - base=main
      - label=backport-to-stable
    actions:
      backport:
        populate_labels: true
        branches:
          - stable

Therefore, given the PR-1 with the labels ['bug', 'customer', 'backport-to-stable' ] then when it gets merged the PR-2 is created with the labels ['bug', 'customer']

Thanks

@v1v
Copy link
Contributor Author

v1v commented Sep 23, 2021

To give more context with a real use case:

  1. There is a hard requirement that each PR requires a team to be assigned, aka a label should be assigned.
  2. Developers triage their PRs and assign those teams with the specific labels.
  3. When a PR is merged and backported, those backported PRs don't contain the labels from the original PR.
  4. Therefore there is a need to triage an existing triaged PR (well the initial PR)

If the above could be automated, then it can reduce the triaging and developers will be happy about it. :)

@Ryanf55
Copy link

Ryanf55 commented Feb 4, 2024

Do you have any manual ways of doing this now? Perhaps in a workflow file?

@DouglasBlackwood
Copy link

You can't do it using Mergify for now.
But we do something similar with our merge queue. We created a GitHub Action to copy labels from a PR to the merge queue draft PR. https://github.com/Mergifyio/gha-mergify-merge-queue-labels-copier
You could probably do something similar for backports.

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

3 participants