Option to preserve manually added labels

Open
#624 9 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
devops

Research direction

Start by reviewing the labeller.yml label-matching behavior and the sync-labels handling described in the issue. The work is done when an option such as preserve-labels retains manually added labels while the existing default behavior still adds and removes labels based on changed files.

Written by the indexing model from the issue text.

Description

feature request

Description:
I would like add an option to:

  • Add a label if files are changed, defined in labeller.yml (default behaviour already)
  • Don't remove label, if labeller detects that files "belonging to the label" defined in labeller.yml, are changed

sync-labels: does not work in this case.

Could call the option "preserve-labels" or similar.

Description (usecase):
Suppose we have a repo with 2 generations (versions) of a project.
The src code for generations are in 2 different directories.
Some common code is shared.

I define the labeller like so:
labeller.yml:

GENERATION0_LABELLER_LABEL:
- 'common_files/.**'
- 'generation0_files/.**'

GENERATION1_LABELLER_LABEL:
- 'common_files/.**'
- 'generation1_files/.**'

There are cases where, regardless of the files changed, I want to run tests for both generations.
So I apply the label "GENERATION1_LABELLER_LABEL".
The labeller sees that I haven't changed files in "- 'common_files/.' or 'generation1_files/.'.
It removes the label.

Justification:
Currently we require 2 labels to get this to run.
GENERATION0_LABELLER_LABEL
GENERATION1_LABELLER_LABEL

GENERATION0_MANUAL_LABEL
GENERATION1_MANUAL_LABEL

Are you willing to submit a PR?
Not likely, but a possibility if complexity is low

Dominant language
TypeScript
Stars
2.5k
Forks
488
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from actions/labeler

All issues in actions/labeler

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.