diff --git a/tests/ci/fast_test_check.py b/tests/ci/fast_test_check.py index acc07ccfb23..ce5a4195ceb 100644 --- a/tests/ci/fast_test_check.py +++ b/tests/ci/fast_test_check.py @@ -8,13 +8,13 @@ import sys from github import Github -from env_helper import CACHES_PATH, TEMP_PATH -from pr_info import FORCE_TESTS_LABEL, PRInfo +from env_helper import CACHES_PATH, TEMP_PATH, GITHUB_SERVER_URL, GITHUB_REPOSITORY +from pr_info import FORCE_TESTS_LABEL, PRInfo, SKIP_SIMPLE_CHECK_LABEL from s3_helper import S3Helper from get_robot_token import get_best_robot_token from upload_result_helper import upload_results from docker_pull_helper import get_image_with_version -from commit_status_helper import post_commit_status +from commit_status_helper import post_commit_status, get_commit from clickhouse_helper import ( ClickHouseHelper, mark_flaky_tests, @@ -219,4 +219,16 @@ if __name__ == "__main__": if FORCE_TESTS_LABEL in pr_info.labels and state != "error": print(f"'{FORCE_TESTS_LABEL}' enabled, will report success") else: + if SKIP_SIMPLE_CHECK_LABEL not in pr_info.labels: + url = ( + f"{GITHUB_SERVER_URL}/{GITHUB_REPOSITORY}/" + "blob/master/.github/PULL_REQUEST_TEMPLATE.md?plain=1" + ) + commit = get_commit(gh, pr_info.sha) + commit.create_status( + context="Simple Check", + description=f"{NAME} failed", + state="failed", + target_url=url, + ) sys.exit(1) diff --git a/tests/ci/pr_info.py b/tests/ci/pr_info.py index 4b7c100c300..86b3081f98c 100644 --- a/tests/ci/pr_info.py +++ b/tests/ci/pr_info.py @@ -15,6 +15,7 @@ from env_helper import ( ) FORCE_TESTS_LABEL = "force tests" +SKIP_SIMPLE_CHECK_LABEL = "skip simple check" DIFF_IN_DOCUMENTATION_EXT = [ ".html", diff --git a/tests/ci/run_check.py b/tests/ci/run_check.py index 87139c5bb8a..b6d654c7bed 100644 --- a/tests/ci/run_check.py +++ b/tests/ci/run_check.py @@ -223,6 +223,13 @@ if __name__ == "__main__": if pr_labels_to_remove: remove_labels(gh, pr_info, pr_labels_to_remove) + commit.create_status( + context="Simple Check", + description="Skipped", + state="success", + target_url=GITHUB_RUN_URL, + ) + if description_error: print( "::error ::Cannot run, PR description does not match the template: " diff --git a/tests/ci/style_check.py b/tests/ci/style_check.py index 198db86ae6a..84ed9e5a124 100644 --- a/tests/ci/style_check.py +++ b/tests/ci/style_check.py @@ -7,13 +7,18 @@ import sys from github import Github -from env_helper import RUNNER_TEMP, GITHUB_WORKSPACE +from env_helper import ( + RUNNER_TEMP, + GITHUB_WORKSPACE, + GITHUB_REPOSITORY, + GITHUB_SERVER_URL, +) from s3_helper import S3Helper -from pr_info import PRInfo +from pr_info import PRInfo, SKIP_SIMPLE_CHECK_LABEL from get_robot_token import get_best_robot_token from upload_result_helper import upload_results from docker_pull_helper import get_image_with_version -from commit_status_helper import post_commit_status +from commit_status_helper import post_commit_status, get_commit from clickhouse_helper import ( ClickHouseHelper, mark_flaky_tests, @@ -120,4 +125,16 @@ if __name__ == "__main__": ch_helper.insert_events_into(db="default", table="checks", events=prepared_events) if state == "error": + if SKIP_SIMPLE_CHECK_LABEL not in pr_info.labels: + url = ( + f"{GITHUB_SERVER_URL}/{GITHUB_REPOSITORY}/" + "blob/master/.github/PULL_REQUEST_TEMPLATE.md?plain=1" + ) + commit = get_commit(gh, pr_info.sha) + commit.create_status( + context="Simple Check", + description=f"{NAME} failed", + state="failed", + target_url=url, + ) sys.exit(1)