Merge pull request #70197 from ClickHouse/run-by-labels

Require bugfix job for a set of labels
This commit is contained in:
Mikhail f. Shiryaev 2024-10-01 23:24:28 +00:00 committed by GitHub
commit b41dcdfcdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 20 additions and 21 deletions

View File

@ -427,7 +427,7 @@ def _mark_success_action(
# do nothing, exit without failure
print(f"ERROR: no status file for job [{job}]")
if job_config.run_by_label or not job_config.has_digest():
if job_config.run_by_labels or not job_config.has_digest():
print(f"Job [{job}] has no digest or run by label in CI - do not cache")
else:
if pr_info.is_master:

View File

@ -261,7 +261,7 @@ class CI:
compiler="clang-18",
package_type="fuzzers",
),
run_by_label=Tags.libFuzzer,
run_by_labels=[Tags.libFuzzer],
),
JobNames.BUILD_CHECK: CommonJobConfigs.BUILD_REPORT.with_properties(),
JobNames.INSTALL_TEST_AMD: CommonJobConfigs.INSTALL_TEST.with_properties(
@ -479,13 +479,13 @@ class CI:
),
JobNames.JEPSEN_KEEPER: JobConfig(
required_builds=[BuildNames.BINARY_RELEASE],
run_by_label="jepsen-test",
run_by_labels=[Labels.JEPSEN_TEST],
run_command="jepsen_check.py keeper",
runner_type=Runners.STYLE_CHECKER_ARM,
),
JobNames.JEPSEN_SERVER: JobConfig(
required_builds=[BuildNames.BINARY_RELEASE],
run_by_label="jepsen-test",
run_by_labels=[Labels.JEPSEN_TEST],
run_command="jepsen_check.py server",
runner_type=Runners.STYLE_CHECKER_ARM,
),
@ -495,7 +495,7 @@ class CI:
JobNames.PERFORMANCE_TEST_ARM64: CommonJobConfigs.PERF_TESTS.with_properties(
required_builds=[BuildNames.PACKAGE_AARCH64],
num_batches=4,
run_by_label="pr-performance",
run_by_labels=[Labels.PR_PERFORMANCE],
runner_type=Runners.FUNC_TESTER_ARM,
),
JobNames.SQLANCER: CommonJobConfigs.SQLLANCER_TEST.with_properties(
@ -520,7 +520,7 @@ class CI:
),
JobNames.LIBFUZZER_TEST: JobConfig(
required_builds=[BuildNames.FUZZERS],
run_by_label=Tags.libFuzzer,
run_by_labels=[Tags.libFuzzer],
timeout=10800,
run_command='libfuzzer_test_check.py "$CHECK_NAME"',
runner_type=Runners.STYLE_CHECKER,
@ -557,7 +557,7 @@ class CI:
runner_type=Runners.STYLE_CHECKER_ARM,
),
JobNames.BUGFIX_VALIDATE: JobConfig(
run_by_label="pr-bugfix",
run_by_labels=[Labels.PR_BUGFIX, Labels.PR_CRITICAL_BUGFIX],
run_command="bugfix_validate_check.py",
timeout=2400,
runner_type=Runners.STYLE_CHECKER,

View File

@ -22,6 +22,7 @@ class Labels:
PR_CHERRYPICK = "pr-cherrypick"
PR_CI = "pr-ci"
PR_FEATURE = "pr-feature"
PR_PERFORMANCE = "pr-performance"
PR_SYNCED_TO_CLOUD = "pr-synced-to-cloud"
PR_SYNC_UPSTREAM = "pr-sync-upstream"
RELEASE = "release"
@ -335,7 +336,7 @@ class JobConfig:
# sets number of batches for a multi-batch job
num_batches: int = 1
# label that enables job in CI, if set digest isn't used
run_by_label: str = ""
run_by_labels: List[str] = field(default_factory=list)
# to run always regardless of the job digest or/and label
run_always: bool = False
# disables CI await for a given job

View File

@ -151,10 +151,10 @@ class CiSettings:
return True
return False
if job_config.run_by_label:
if job_config.run_by_label in labels and is_pr:
if job_config.run_by_labels:
if set(job_config.run_by_labels).intersection(labels) and is_pr:
print(
f"Job [{job}] selected by GH label [{job_config.run_by_label}] - pass"
f"Job [{job}] selected by GH label [{job_config.run_by_labels}] - pass"
)
return True
return False

View File

@ -304,7 +304,7 @@ class TestCIConfig(unittest.TestCase):
for job, config in CI.JOB_CONFIGS.items():
if (
CI.is_build_job(job)
and not config.run_by_label
and not config.run_by_labels
and job not in expected_jobs_to_do
):
# expected to run all builds jobs
@ -358,7 +358,7 @@ class TestCIConfig(unittest.TestCase):
continue
if config.release_only:
continue
if config.run_by_label:
if config.run_by_labels:
continue
expected_jobs_to_do.append(job)
@ -391,7 +391,7 @@ class TestCIConfig(unittest.TestCase):
for job, config in CI.JOB_CONFIGS.items():
if config.pr_only:
continue
if config.run_by_label:
if config.run_by_labels:
continue
if job in CI.MQ_JOBS:
continue

View File

@ -173,9 +173,8 @@ class TestCIOptions(unittest.TestCase):
job: CI.JobConfig(runner_type=CI.Runners.STYLE_CHECKER)
for job in _TEST_JOB_LIST
}
jobs_configs["fuzzers"].run_by_label = (
"TEST_LABEL" # check "fuzzers" appears in the result due to the label
)
# check "fuzzers" appears in the result due to the label
jobs_configs["fuzzers"].run_by_labels = ["TEST_LABEL"]
jobs_configs["Integration tests (asan)"].release_only = (
True # still must be included as it's set with include keywords
)
@ -222,7 +221,7 @@ class TestCIOptions(unittest.TestCase):
}
jobs_configs["Style check"].release_only = True
jobs_configs["Fast test"].pr_only = True
jobs_configs["fuzzers"].run_by_label = "TEST_LABEL"
jobs_configs["fuzzers"].run_by_labels = ["TEST_LABEL"]
# no settings are set
filtered_jobs = list(
CiSettings().apply(
@ -311,9 +310,8 @@ class TestCIOptions(unittest.TestCase):
job: CI.JobConfig(runner_type=CI.Runners.STYLE_CHECKER)
for job in _TEST_JOB_LIST
}
jobs_configs["fuzzers"].run_by_label = (
"TEST_LABEL" # check "fuzzers" does not appears in the result
)
# check "fuzzers" does not appears in the result
jobs_configs["fuzzers"].run_by_labels = ["TEST_LABEL"]
jobs_configs["Integration tests (asan)"].release_only = True
filtered_jobs = list(
ci_options.apply(