File tree Expand file tree Collapse file tree 6 files changed +21
-41
lines changed
jobs/scripts/workflow_hooks Expand file tree Collapse file tree 6 files changed +21
-41
lines changed Original file line number Diff line number Diff line change 1- import re
2- from functools import lru_cache
3-
41from ci .defs .defs import JobNames
52from ci .defs .job_configs import JobConfigs
63from ci .jobs .scripts .workflow_hooks .new_tests_check import (
@@ -52,15 +49,6 @@ def only_docs(changed_files):
5249_info_cache = None
5350
5451
55- @lru_cache
56- def get_ci_exclude_tags (pr_body ):
57- pattern = r"(#|- \[x\] +<!---ci_exclude_)([|\w]+)"
58- matches = []
59- for match in re .findall (pattern , pr_body ):
60- matches .extend (match [- 1 ].split ("|" ))
61- return matches
62-
63-
6452def should_skip_job (job_name ):
6553 global _info_cache
6654 if _info_cache is None :
@@ -179,7 +167,7 @@ def should_skip_job(job_name):
179167 return False , ""
180168 return True , "Skipped, not labeled with 'pr-performance'"
181169
182- ci_exclude_tags = get_ci_exclude_tags ( _info_cache .pr_body )
170+ ci_exclude_tags = _info_cache .get_kv_data ( "ci_exclude_tags" ) or []
183171 for tag in ci_exclude_tags :
184172 if tag in job_name :
185173 return True , f"Skipped, job name includes excluded tag '{ tag } '"
Original file line number Diff line number Diff line change 1+ import re
2+
3+ from ci .praktika .info import Info
4+
5+
6+ def get_ci_tags (pr_body , tag_prefix ):
7+ pattern = rf"(- \[x\] +<!---{ tag_prefix } _)([|\w]+)"
8+ matches = []
9+ for match in re .findall (pattern , pr_body ):
10+ matches .extend (match [- 1 ].split ("|" ))
11+ return matches
12+
13+
14+ if __name__ == "__main__" :
15+ info = Info ()
16+
17+ info .store_kv_data ("ci_exclude_tags" , get_ci_tags (info .pr_body , "ci_exclude" ))
18+ info .store_kv_data ("ci_regression_jobs" , get_ci_tags (info .pr_body , "ci_regression" ))
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import copy
2- import re
32
43from ci .defs .job_configs import JobConfigs
54from ci .jobs .scripts .clickhouse_version import CHVersion
87from ci .praktika .info import Info
98from ci .praktika .utils import Shell
109
11- def get_ci_exclude_tags (pr_body ):
12- pattern = r"(#|- \[x\] +<!---ci_exclude_)([|\w]+)"
13- matches = []
14- for match in re .findall (pattern , pr_body ):
15- matches .extend (match [- 1 ].split ("|" ))
16- return matches
17-
1810if __name__ == "__main__" :
1911 info = Info ()
2012
@@ -31,9 +23,6 @@ def get_ci_exclude_tags(pr_body):
3123 digest = Digest ().calc_job_digest (some_build_job , {}, {}).split ("-" )[0 ]
3224 info .store_kv_data ("build_digest" , digest )
3325
34- # store ci exclude tags
35- info .store_kv_data ("ci_exclude_tags" , get_ci_exclude_tags (info .pr_body ))
36-
3726 if info .git_branch == "master" and info .repo_name == "ClickHouse/ClickHouse" :
3827 # store previous commits for perf tests
3928 raw = Shell .get_output (
Original file line number Diff line number Diff line change 6363 pre_hooks = [
6464 "python3 ./ci/jobs/scripts/workflow_hooks/store_data.py" ,
6565 "python3 ./ci/jobs/scripts/workflow_hooks/version_log.py" ,
66- "python3 ./ci/jobs/scripts/workflow_hooks/regression_config .py" ,
66+ "python3 ./ci/jobs/scripts/workflow_hooks/parse_ci_tags .py" ,
6767 # "python3 ./ci/jobs/scripts/workflow_hooks/merge_sync_pr.py", # NOTE (strtgbb): we don't do this
6868 ],
6969 workflow_filter_hooks = [should_skip_job ],
Original file line number Diff line number Diff line change 133133 "python3 ./ci/jobs/scripts/workflow_hooks/version_log.py" ,
134134 # "python3 ./ci/jobs/scripts/workflow_hooks/quick_sync.py", # NOTE (strtgbb): we don't do this
135135 # "python3 ./ci/jobs/scripts/workflow_hooks/team_notifications.py",
136- "python3 ./ci/jobs/scripts/workflow_hooks/regression_config .py" ,
136+ "python3 ./ci/jobs/scripts/workflow_hooks/parse_ci_tags .py" ,
137137 ],
138138 workflow_filter_hooks = [should_skip_job ],
139139 post_hooks = [
You can’t perform that action at this time.
0 commit comments