[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

@ -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