Skip to content

Commit 4a4e5dd

Browse files
committed
Remove all print statements
1 parent 436fc4b commit 4a4e5dd

File tree

4 files changed

+1
-38
lines changed

4 files changed

+1
-38
lines changed

.github/scripts/check_labels.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212

1313
def delete_all_label_err_comments(pr: "GitHubPR") -> None:
1414
for comment in pr.get_comments():
15-
print(f"comment: {comment}")
1615
if is_label_err_comment(comment):
17-
print("is label err comment")
18-
print(f"comment.database_id: {comment.database_id}")
1916
gh_delete_comment(pr.org, pr.project, comment.database_id)
2017

2118

@@ -41,14 +38,10 @@ def parse_args() -> Any:
4138

4239

4340
def main() -> None:
44-
print("main")
4541
args = parse_args()
4642
repo = GitRepo(get_git_repo_dir(), get_git_remote_name())
4743
org, project = repo.gh_owner_and_name()
4844
pr = GitHubPR(org, project, args.pr_num)
49-
print(f"repo: {repo}")
50-
print(f"org, project: {org}, {project}")
51-
print(f"pr: {pr}")
5245

5346
try:
5447
if not has_required_labels(pr):
@@ -57,15 +50,11 @@ def main() -> None:
5750
if args.exit_non_zero:
5851
raise RuntimeError("PR does not have required labels")
5952
else:
60-
print("pass")
6153
delete_all_label_err_comments(pr)
6254
except Exception as e:
63-
print("general exception")
64-
print(e)
6555
if args.exit_non_zero:
6656
raise RuntimeError(f"Error checking labels: {e}") from e
6757

68-
print("success")
6958
sys.exit(0)
7059

7160

.github/scripts/github_utils.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,6 @@ def gh_fetch_url_and_headers(
6666
raise
6767

6868

69-
# def gh_fetch_url(
70-
# url: str,
71-
# *,
72-
# headers: Optional[Dict[str, str]] = None,
73-
# data: Union[Optional[Dict[str, Any]], str] = None,
74-
# method: Optional[str] = None,
75-
# reader: Callable[[Any], Any] = lambda x: x.read(),
76-
# ) -> Any:
77-
# print(f"api return conent: {gh_fetch_url_and_headers(url, headers=headers, data=data, reader=json.load, method=method)}")
78-
# return gh_fetch_url_and_headers(
79-
# url, headers=headers, data=data, reader=json.load, method=method
80-
# )[1]
81-
8269
def gh_fetch_url(
8370
url: str,
8471
*,
@@ -180,12 +167,6 @@ def gh_post_commit_comment(
180167
)
181168

182169

183-
# def gh_delete_comment(org: str, repo: str, comment_id: int) -> None:
184-
# print("deleting comment")
185-
# url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/comments/{comment_id}"
186-
# print(f"url: {url}")
187-
# gh_fetch_url(url, method="DELETE")
188-
189170
def gh_delete_comment(org: str, repo: str, comment_id: int) -> None:
190171
url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/comments/{comment_id}"
191172
gh_fetch_url(url, method="DELETE", reader=lambda x: x.read())

.github/scripts/label_utils.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def get_last_page_num_from_header(header: Any) -> int:
6464
@lru_cache
6565
def gh_get_labels(org: str, repo: str) -> List[str]:
6666
prefix = f"https://api.github.com/repos/{org}/{repo}/labels?per_page=100"
67-
print(f"prefix: {prefix}")
6867
header, info = request_for_labels(prefix + "&page=1")
6968
labels: List[str] = []
7069
update_labels(labels, info)
@@ -77,8 +76,6 @@ def gh_get_labels(org: str, repo: str) -> List[str]:
7776
_, info = request_for_labels(prefix + f"&page={page_number}")
7877
update_labels(labels, info)
7978

80-
print(f"all labels on gh: {labels}")
81-
8279
return labels
8380

8481

@@ -115,15 +112,11 @@ def get_release_notes_labels(org: str, repo: str) -> List[str]:
115112

116113

117114
def has_required_labels(pr: "GitHubPR") -> bool:
118-
print(f"pr: {pr}, pr.org: {pr.org}, pr.project: {pr.project}")
119115
pr_labels = pr.get_labels()
120-
print(f"pr_labels: {pr_labels}")
121116
# Check if PR is not user facing
122117
is_not_user_facing_pr = any(
123118
label.strip() == "topic: not user facing" for label in pr_labels
124119
)
125-
print(f"is_not_user_facing_pr: {is_not_user_facing_pr}")
126-
print(f"release note labels: {get_release_notes_labels(pr.org, pr.project)}")
127120
return is_not_user_facing_pr or any(
128121
label.strip() in get_release_notes_labels(pr.org, pr.project)
129122
for label in pr_labels

.github/workflows/check-labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
# a PR that targets a gh/**/base branch.
1717
pull_request:
1818
types: [opened, synchronize, reopened, labeled, unlabeled]
19-
branches: [gh/**/base, main]
19+
branches: [gh/**/base]
2020

2121
workflow_dispatch:
2222
inputs:

0 commit comments

Comments
 (0)