Mergifyio / Mergifyio/mergify

Populate labels from the PR to the backported PRs

Open
#3,257 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
339
Forks
93
PR merge metrics
No merged PRs in 30d

Description

What

https://github.com/Mergifyio/mergify-engine/issues/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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the backport action and reviewing issue #2288, which added label assignment to backported PRs. Define the option and verify that enabling it copies labels from the source PR to each backported PR while excluding the backport trigger label shown in the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, python
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.