From 495c60443a177080aa21b70fb6e28bf9e070ddca Mon Sep 17 00:00:00 2001 From: Jack Zhang <32371937+jackzhxng@users.noreply.github.com> Date: Mon, 2 Jun 2025 10:28:55 -0700 Subject: [PATCH] Make release labels optional ghstack-source-id: 5b4337b846bd5a209e74489277612d030e87cc32 Pull Request resolved: https://github.com/pytorch/executorch/pull/11287 --- .github/scripts/label_utils.py | 4 +--- .github/scripts/trymerge.py | 10 +--------- .github/workflows/check-labels.yml | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/.github/scripts/label_utils.py b/.github/scripts/label_utils.py index 53daf222250..609316cfe2b 100644 --- a/.github/scripts/label_utils.py +++ b/.github/scripts/label_utils.py @@ -22,9 +22,7 @@ LABEL_ERR_MSG_TITLE = "This PR needs a `release notes:` label" LABEL_ERR_MSG = f"""# {LABEL_ERR_MSG_TITLE} -If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with `release notes:`. - -If not, please add the `release notes: none` label. +If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with `release notes:`. This helps us keep track and include your important work in the next release notes. To add a label, you can comment to pytorchbot, for example `@pytorchbot label "release notes: none"` diff --git a/.github/scripts/trymerge.py b/.github/scripts/trymerge.py index 5a45089508a..124fc4ecbad 100755 --- a/.github/scripts/trymerge.py +++ b/.github/scripts/trymerge.py @@ -59,12 +59,7 @@ patterns_to_regex, retries_decorator, ) -from label_utils import ( - gh_add_labels, - gh_remove_label, - has_required_labels, - LABEL_ERR_MSG, -) +from label_utils import gh_add_labels, gh_remove_label from trymerge_explainer import get_revert_message, TryMergeExplainer # labels @@ -2116,9 +2111,6 @@ def merge( # Check for approvals find_matching_merge_rule(pr, repo, skip_mandatory_checks=True) - if not has_required_labels(pr): - raise RuntimeError(LABEL_ERR_MSG.lstrip(" #")) - if ignore_current: checks = pr.get_checkrun_conclusions() _, failing, _ = categorize_checks( diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml index 19c70c820a8..65da3052155 100644 --- a/.github/workflows/check-labels.yml +++ b/.github/workflows/check-labels.yml @@ -51,4 +51,4 @@ jobs: PR_NUM: ${{ github.event.number || github.event.inputs.pr_number }} run: | set -ex - python3 .github/scripts/check_labels.py --exit-non-zero "${PR_NUM}" + python3 .github/scripts/check_labels.py "${PR_NUM}"