File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
ci/jobs/scripts/workflow_hooks Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ import re
2+ from functools import lru_cache
3+
14from ci .defs .defs import JobNames
25from ci .defs .job_configs import JobConfigs
36from ci .jobs .scripts .workflow_hooks .new_tests_check import (
@@ -49,6 +52,15 @@ def only_docs(changed_files):
4952_info_cache = None
5053
5154
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+
5264def should_skip_job (job_name ):
5365 global _info_cache
5466 if _info_cache is None :
@@ -157,4 +169,9 @@ def should_skip_job(job_name):
157169 ):
158170 return True , "Skipped, not labeled with 'pr-performance'"
159171
172+ ci_exclude_tags = get_ci_exclude_tags (_info_cache .pr_body )
173+ for tag in ci_exclude_tags :
174+ if tag in job_name :
175+ return True , f"Skipped, job name includes excluded tag '{ tag } '"
176+
160177 return False , ""
You can’t perform that action at this time.
0 commit comments