mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Merge pull request #38744 from ClickHouse/ci-required-simple-checks
Add SimpleCheck
This commit is contained in:
commit
af1136c990
@ -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)
|
||||
|
@ -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",
|
||||
|
@ -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: "
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user