Follow CODEOWNERS file

Open
#483 3 comments 36 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
32/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
github-actions, typescript
Domain
ci-cd, tooling

Research direction

No source file or test is named. Start by reviewing the labeler configuration and how CODEOWNERS ownership is represented for pull requests, then compare that with the proposed codeowner and codeowners entries. Done means a documented, tested mapping can apply labels when the corresponding owner is pinged without breaking existing glob and negation rules.

Written by the indexing model from the issue text.

Description

feature request needs eyes

Description:

Add the option to use the CODEOWNERS (+ a file that map some codeowners to labels) to the labeler

For instance:

# Add 'repo' label to any root file changes
repo:
- '*'

# Add '@domain/core' label to any change within the 'core' package
'@domain/core':
- package/core/*
- package/core/**/*

# Add 'test' label to any change to *.spec.js files within the source dir
test:
- src/**/*.spec.js

# Add 'source' label to any change to src files within the source dir EXCEPT for the docs sub-folder
source:
- any: ['src/**/*', '!src/docs/*']

# Add 'frontend` label to any change to *.js files as long as the `main.js` hasn't changed
frontend:
- any: ['src/**/*.js']
  all: ['!src/main.js']

# HERE IS THE ADDITION
# Add 'label-from-codeowner' label that gets added when the owner '@name-of-the-owner' gets pinged on a PR
label-from-codeowner: 
- codeowner: @name-of-the-owner
  # or could be follow multiple owners
  codeowners: ['@name-of-the-owner']

Justification:

In project with teams, codeowners is a great feature to get pinged, but it cannot really help to view afterwards which teams were pinged by a PR (as the team gets replaced by the person that reviewed the PR).

To fix this, I use labels with a similar subset of the CODEOWNERS config.
But sometimes it can be a bit tricky to find the perfect equivalent for the CODEOWNERS syntax using glob pattern.

Are you willing to submit a PR?

Yes, if this PR is approved, I can work on a PR for that

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.