moved some logic around

This commit is contained in:
Karma Riuk
2025-05-20 09:58:49 +02:00
parent b0443cc87f
commit a3a89bb346

View File

@ -41,6 +41,9 @@ EXCLUSION_LIST = [
def is_pull_good(pull: PullRequest, verbose: bool = False) -> bool: def is_pull_good(pull: PullRequest, verbose: bool = False) -> bool:
if pull.merged_at is None:
return False
comments = pull.get_review_comments() comments = pull.get_review_comments()
if pull.user.type == "Bot" or comments.totalCount > 2 or comments.totalCount == 0: if pull.user.type == "Bot" or comments.totalCount > 2 or comments.totalCount == 0:
return False return False
@ -229,6 +232,9 @@ def process_pull(
dataset.entries.append(cache[repo.full_name][pr.number]) dataset.entries.append(cache[repo.full_name][pr.number])
return return
if not is_pull_good(pr):
return
metadata = Metadata( metadata = Metadata(
uuid.uuid4().hex, uuid.uuid4().hex,
repo.full_name, repo.full_name,
@ -407,7 +413,7 @@ def process_repo(
for pr in prs: for pr in prs:
pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs}) pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs})
try: try:
if pr.merged_at is None or pr.number in already_seen_prs or not is_pull_good(pr): if pr.number in already_seen_prs:
continue continue
n_good_prs += 1 n_good_prs += 1