Merge pull request #41074 from ClickHouse/can-be-tested

CheckLabels: Print message that 'can be tested' is missing
This commit is contained in:
Mikhail f. Shiryaev 2022-09-07 11:28:53 +02:00 committed by GitHub
commit 7f9d9f6ec7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,14 +87,19 @@ def should_run_checks_for_pr(pr_info: PRInfo) -> Tuple[bool, str, str]:
# Consider the labels and whether the user is trusted.
print("Got labels", pr_info.labels)
if FORCE_TESTS_LABEL in pr_info.labels:
print(f"Label '{FORCE_TESTS_LABEL}' set, forcing remaining checks")
return True, f"Labeled '{FORCE_TESTS_LABEL}'", "pending"
if DO_NOT_TEST_LABEL in pr_info.labels:
print(f"Label '{DO_NOT_TEST_LABEL}' set, skipping remaining checks")
return False, f"Labeled '{DO_NOT_TEST_LABEL}'", "success"
if CAN_BE_TESTED_LABEL not in pr_info.labels and not pr_is_by_trusted_user(
pr_info.user_login, pr_info.user_orgs
):
print(
f"PRs by untrusted users need the '{CAN_BE_TESTED_LABEL}' label - please contact a member of the core team"
)
return False, "Needs 'can be tested' label", "failure"
if OK_SKIP_LABELS.intersection(pr_info.labels):
@ -219,7 +224,7 @@ if __name__ == "__main__":
elif SUBMODULE_CHANGED_LABEL in pr_info.labels:
pr_labels_to_remove.append(SUBMODULE_CHANGED_LABEL)
print(f"change labels: add {pr_labels_to_add}, remove {pr_labels_to_remove}")
print(f"Change labels: add {pr_labels_to_add}, remove {pr_labels_to_remove}")
if pr_labels_to_add:
post_labels(gh, pr_info, pr_labels_to_add)