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
+
1
4
from ci .defs .defs import JobNames
2
5
from ci .defs .job_configs import JobConfigs
3
6
from ci .jobs .scripts .workflow_hooks .new_tests_check import (
@@ -49,6 +52,15 @@ def only_docs(changed_files):
49
52
_info_cache = None
50
53
51
54
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
+
52
64
def should_skip_job (job_name ):
53
65
global _info_cache
54
66
if _info_cache is None :
@@ -157,4 +169,9 @@ def should_skip_job(job_name):
157
169
):
158
170
return True , "Skipped, not labeled with 'pr-performance'"
159
171
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
+
160
177
return False , ""
You can’t perform that action at this time.
0 commit comments