Skip to content

Commit 6d459c7

Browse files
authored
Update PR labeling requirements (#4618)
1 parent 8fe72d1 commit 6d459c7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.github/process_commit.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,19 @@
1212

1313
import requests
1414

15-
# If the PR has any of these labels, we accept it as properly labeled.
16-
REQUIRED_LABELS = {
15+
# For a PR to be properly labeled it should have one primary label and one secondary label
16+
PRIMARY_LABELS = {
1717
"new feature",
1818
"bug",
1919
"code quality",
2020
"enhancement",
2121
"bc-breaking",
22-
"dependency issue",
2322
"deprecation",
23+
"other",
24+
}
25+
26+
SECONDARY_LABELS = {
27+
"dependency issue",
2428
"module: c++ frontend",
2529
"module: ci",
2630
"module: datasets",
@@ -69,7 +73,7 @@ def get_pr_merger_and_labels(pr_number: int) -> Tuple[str, Set[str]]:
6973
sys.exit(0)
7074

7175
merger, labels = get_pr_merger_and_labels(pr_number)
72-
is_properly_labeled = bool(REQUIRED_LABELS.intersection(labels))
76+
is_properly_labeled = bool(PRIMARY_LABELS.intersection(labels) and SECONDARY_LABELS.intersection(labels))
7377

7478
if not is_properly_labeled:
7579
print(f"@{merger}")

.github/workflows/pr-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
message: |
3333
Hey ${{ steps.commit.outputs.merger }}!
3434
35-
You merged this PR, but no labels were added.
35+
You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

0 commit comments

Comments
 (0)