Skip to content

Commit

Permalink
Add label support to REVIEWERS and NOTIFIED files. (#89)
Browse files Browse the repository at this point in the history
## Summary:
This lets you specify rules like this:
```
something_changed: **/* @notifyme
```

And when we add the NOTIFIED section to the github PR, it will now say:
```
@notifyme (something_changed): file1 file2 file3
```
(For rules without labels, the output is unchanged.)

This is helpful for knowing _why_ you were being notified for a
particular PR, since as we add more NOTIFIED rules it can get harder
to tell.

I added the support for REVIEWERS as well, since it was easy, though
I'm not sure how useful it is there.

While in the area, I couldn't help but clean up the existing code a
bit, especially simplifying some of the regexp-parsing logic (at the
cost of more parentheses in the regexp).

Issue: https://khanacademy.atlassian.net/browse/FEI-5970

## Test plan:
yarn flow
yarn jest

Author: csilvers

Reviewers: lillialexis

Required Reviewers:

Approved By: lillialexis

Checks: ✅ gerald, ✅ autofix, ✅ lint_and_unit, ✅ build_index

Pull Request URL: #89
  • Loading branch information
csilvers authored Nov 12, 2024
1 parent 6626012 commit 4f836bc
Show file tree
Hide file tree
Showing 9 changed files with 466 additions and 403 deletions.
4 changes: 4 additions & 0 deletions .github/NOTIFIED
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Examples:
# This rule will notify @owner1 on changes to all files
# **/* @owner1

# This rule will notify @owner1 on changes to all files, and the rule
# has a label "allfiles", which will be included in the github PR info.
# allfiles: **/* @owner1

# This rule will notify @owner1 and @Org/team1 on changes to all .js files
# **/*.js @owner1 @Org/team1

Expand Down
3 changes: 3 additions & 0 deletions .github/REVIEWERS
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Examples:
# This rule will request @owner1 for review on changes to all files. This rule will also request @owner2 for a blocking review.
# **/* @owner1 @owner2!

# This rule will request @owner1 for review on changes to all files, and the rule has a label "allfiles", which will be included in the github PR info.
# allfiles: **/* @owner1

# This rule will request @owner1 and @Org/team1 for review on changes to all .js files
# **/*.js @owner1 @Org/team1

Expand Down
4 changes: 2 additions & 2 deletions dist/index.js

Large diffs are not rendered by default.

Loading

0 comments on commit 4f836bc

Please sign in to comment.