From 74ea9531fc1d68e47f84abdf4910f7949ae56d53 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 14 Oct 2021 18:32:09 +0100 Subject: [PATCH] Update PR labeling requirements --- .github/process_commit.py | 12 ++++++++---- .github/workflows/pr-labels.yml | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/process_commit.py b/.github/process_commit.py index 00cbe6abd12..db08dc132a0 100644 --- a/.github/process_commit.py +++ b/.github/process_commit.py @@ -12,15 +12,19 @@ import requests -# If the PR has any of these labels, we accept it as properly labeled. -REQUIRED_LABELS = { +# For a PR to be properly labeled it should have one primary label and one secondary label +PRIMARY_LABELS = { "new feature", "bug", "code quality", "enhancement", "bc-breaking", - "dependency issue", "deprecation", + "other", +} + +SECONDARY_LABELS = { + "dependency issue", "module: c++ frontend", "module: ci", "module: datasets", @@ -69,7 +73,7 @@ def get_pr_merger_and_labels(pr_number: int) -> Tuple[str, Set[str]]: sys.exit(0) merger, labels = get_pr_merger_and_labels(pr_number) - is_properly_labeled = bool(REQUIRED_LABELS.intersection(labels)) + is_properly_labeled = bool(PRIMARY_LABELS.intersection(labels) and SECONDARY_LABELS.intersection(labels)) if not is_properly_labeled: print(f"@{merger}") diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index 76153ea1302..20c37e4fd88 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -32,4 +32,4 @@ jobs: message: | Hey ${{ steps.commit.outputs.merger }}! - You merged this PR, but no labels were added. + 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