@@ -74,13 +74,13 @@ class GitHubCtx:
74
74
def get_custom_jobs (ctx : GitHubCtx ) -> List [str ]:
75
75
"""
76
76
Tries to parse names of specific CI jobs that should be executed in the form of
77
- ci -job: <job-name>
77
+ try -job: <job-name>
78
78
from the commit message of the passed GitHub context.
79
79
"""
80
80
if ctx .commit_message is None :
81
81
return []
82
82
83
- regex = re .compile (r"^ci -job: (.*)" , re .MULTILINE )
83
+ regex = re .compile (r"^try -job: (.*)" , re .MULTILINE )
84
84
jobs = []
85
85
for match in regex .finditer (ctx .commit_message ):
86
86
jobs .append (match .group (1 ))
@@ -120,16 +120,20 @@ def calculate_jobs(run_type: WorkflowRunType, job_data: Dict[str, Any]) -> List[
120
120
if custom_jobs :
121
121
if len (custom_jobs ) > 10 :
122
122
raise Exception (
123
- f"It is only possible to schedule up to 10 custom jobs,"
123
+ f"It is only possible to schedule up to 10 custom jobs, "
124
124
f"received { len (custom_jobs )} jobs"
125
125
)
126
126
127
127
jobs = []
128
+ unknown_jobs = []
128
129
for custom_job in custom_jobs :
129
130
job = [j for j in job_data ["auto" ] if j ["image" ] == custom_job ]
130
131
if not job :
131
- raise Exception (f"Custom job `{ custom_job } ` not found in auto jobs" )
132
+ unknown_jobs .append (custom_job )
133
+ continue
132
134
jobs .append (job [0 ])
135
+ if unknown_jobs :
136
+ raise Exception (f"Custom job(s) `{ unknown_jobs } ` not found in auto jobs" )
133
137
134
138
return add_base_env (name_jobs (jobs , "try" ), job_data ["envs" ]["try" ])
135
139
elif run_type is AutoRunType :
0 commit comments