Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partially revert e0252db8d and fix pr-bugfix labeling #48637

Merged
merged 3 commits into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 14 additions & 10 deletions tests/ci/run_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@

# They are used in .github/PULL_REQUEST_TEMPLATE.md, keep comments there
# updated accordingly
# The following lists are append only, try to avoid editing them
# They atill could be cleaned out after the decent time though.
LABELS = {
"pr-backward-incompatible": ["Backward Incompatible Change"],
"pr-bugfix": [
"Bug Fix",
"Bug Fix (user-visible misbehaviour in official stable release)",
"Bug Fix (user-visible misbehavior in official stable release)",
"Bug Fix (user-visible misbehavior in an official stable release)",
"Bug Fix (user-visible misbehaviour in official stable or prestable release)",
"Bug Fix (user-visible misbehavior in official stable or prestable release)",
],
"pr-build": [
"Build/Testing/Packaging Improvement",
Expand Down Expand Up @@ -129,6 +132,7 @@ def check_pr_description(pr_info: PRInfo) -> Tuple[str, str]:

category = ""
entry = ""
description_error = ""

i = 0
while i < len(lines):
Expand Down Expand Up @@ -180,19 +184,19 @@ def check_pr_description(pr_info: PRInfo) -> Tuple[str, str]:
i += 1

if not category:
return "Changelog category is empty", category

description_error = "Changelog category is empty"
# Filter out the PR categories that are not for changelog.
if re.match(
elif re.match(
r"(?i)doc|((non|in|not|un)[-\s]*significant)|(not[ ]*for[ ]*changelog)",
category,
):
return "", category

if not entry:
return f"Changelog entry required for category '{category}'", category
pass # to not check the rest of the conditions
elif category not in CATEGORY_TO_LABEL:
description_error, category = f"Category '{category}' is not valid", ""
elif not entry:
description_error = f"Changelog entry required for category '{category}'"

return "", category
return description_error, category


if __name__ == "__main__":
Expand Down