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

[Typing] Skip coverage check if title has typing #65058

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions tools/get_pr_title.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,22 @@

import json
import os
import re
import sys

import requests

SKIP_COVERAGE_CHECKING_LABELS = [
"cinn",
"typing",
]

SKIP_COVERAGE_CHECKING_REGEX = re.compile(
rf"[\[【]({'|'.join(SKIP_COVERAGE_CHECKING_LABELS)})[\]】]",
re.IGNORECASE,
)


pr_id = os.getenv('GIT_PR_ID')
if not pr_id:
print('PREC No PR ID')
Expand All @@ -32,9 +44,10 @@

title = data['title']

prefixes = ['【CINN】', '[CINN]', '[cinn]', '【cinn】']
if any(title.startswith(prefix) for prefix in prefixes):
print('The title starts with cinn')
if match_obj := SKIP_COVERAGE_CHECKING_REGEX.search(title):
print(f'The title starts with {match_obj.group(0)}')
else:
print('The title does not start with cinn')
print(
f'The title does not start with {" or ".join(SKIP_COVERAGE_CHECKING_LABELS)}'
)
sys.exit(1)