about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2024-05-03 10:06:13 +0200
committerJakub Beránek <berykubik@gmail.com>2024-05-05 14:06:23 +0200
commitbf8bcc4c2d3b0b9c44bc7286b9377a9674b67186 (patch)
tree7580de946eb6951d2acc4d2b8c9eec731683e7b5
parente2e280610dba7f37685cd656faf3446d968bfbe0 (diff)
downloadrust-bf8bcc4c2d3b0b9c44bc7286b9377a9674b67186.tar.gz
rust-bf8bcc4c2d3b0b9c44bc7286b9377a9674b67186.zip
Address review comments
-rwxr-xr-xsrc/ci/github-actions/calculate-job-matrix.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ci/github-actions/calculate-job-matrix.py b/src/ci/github-actions/calculate-job-matrix.py
index 7c42c4ec5c6..115f2e0ad78 100755
--- a/src/ci/github-actions/calculate-job-matrix.py
+++ b/src/ci/github-actions/calculate-job-matrix.py
@@ -74,13 +74,13 @@ class GitHubCtx:
 def get_custom_jobs(ctx: GitHubCtx) -> List[str]:
     """
     Tries to parse names of specific CI jobs that should be executed in the form of
-    ci-job: <job-name>
+    try-job: <job-name>
     from the commit message of the passed GitHub context.
     """
     if ctx.commit_message is None:
         return []
 
-    regex = re.compile(r"^ci-job: (.*)", re.MULTILINE)
+    regex = re.compile(r"^try-job: (.*)", re.MULTILINE)
     jobs = []
     for match in regex.finditer(ctx.commit_message):
         jobs.append(match.group(1))
@@ -120,16 +120,20 @@ def calculate_jobs(run_type: WorkflowRunType, job_data: Dict[str, Any]) -> List[
         if custom_jobs:
             if len(custom_jobs) > 10:
                 raise Exception(
-                    f"It is only possible to schedule up to 10 custom jobs,"
+                    f"It is only possible to schedule up to 10 custom jobs, "
                     f"received {len(custom_jobs)} jobs"
                 )
 
             jobs = []
+            unknown_jobs = []
             for custom_job in custom_jobs:
                 job = [j for j in job_data["auto"] if j["image"] == custom_job]
                 if not job:
-                    raise Exception(f"Custom job `{custom_job}` not found in auto jobs")
+                    unknown_jobs.append(custom_job)
+                    continue
                 jobs.append(job[0])
+            if unknown_jobs:
+                raise Exception(f"Custom job(s) `{unknown_jobs}` not found in auto jobs")
 
         return add_base_env(name_jobs(jobs, "try"), job_data["envs"]["try"])
     elif run_type is AutoRunType: