[ez] Make merge blocking sevs be based on label instead of string (#140636)

sev issues are now merge blocking if they are labeled merge blocking, instead of simply having the merge blocking string in the body.  This makes it easier to default to non merge blocking when creating a sev

Pull Request resolved: https://github.com/pytorch/pytorch/pull/140636
Approved by: https://github.com/huydhn, https://github.com/ZainRizvi
This commit is contained in:
Catherine Lee
2024-11-14 19:02:27 +00:00
committed by PyTorch MergeBot
parent 83b6d91d08
commit ea7d1826a2
2 changed files with 10 additions and 10 deletions

View File

@ -5,8 +5,7 @@ about: Tracking incidents for PyTorch's CI infra.
> NOTE: Remember to label this issue with "`ci: sev`"
<!-- uncomment the below line if you don't want this SEV to block merges -->
<!-- **MERGE BLOCKING** -->
<!-- Add the `merge blocking` label to this PR to prevent PRs from being merged while this issue is open -->
## Current Status
*Status could be: preemptive, ongoing, mitigated, closed. Also tell people if they need to take action to fix it (i.e. rebase)*.

View File

@ -2005,17 +2005,18 @@ def check_for_sev(org: str, project: str, skip_mandatory_checks: bool) -> None:
Dict[str, Any],
gh_fetch_json_list(
"https://api.github.com/search/issues",
params={"q": f'repo:{org}/{project} is:open is:issue label:"ci: sev"'},
# Having two label: queries is an AND operation
params={
"q": f'repo:{org}/{project} is:open is:issue label:"ci: sev" label:"merge blocking"'
},
),
)
if response["total_count"] != 0:
for item in response["items"]:
if "MERGE BLOCKING" in item["body"]:
raise RuntimeError(
"Not merging any PRs at the moment because there is a "
+ "merge blocking https://github.com/pytorch/pytorch/labels/ci:%20sev issue open at: \n"
+ f"{item['html_url']}"
)
raise RuntimeError(
"Not merging any PRs at the moment because there is a "
+ "merge blocking https://github.com/pytorch/pytorch/labels/ci:%20sev issue open at: \n"
+ f"{response['items'][0]['html_url']}"
)
return