ci_run_n_monitor: implicitly include parallel: jobs

This avoids the surprising behaviour where `--target jobname` works for
some jobs but not others, because gitlab adds `X/N` at the end of these
job names.

If the user does specify something like `jobname 1/.*` to only run the
first, the extra `\d+/\d+` is ignored, just like if the job isn't
`parallel:` and therefore doesn't end with `X/N`.

If the user really wants to fail to match parallel jobs (previous
behaviour), they can simply add a `$` at the end of the job name/regex
(but also, I don't see why someone would want that behaviour).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27530>
This commit is contained in:
Eric Engestrom
2024-02-08 17:56:20 +00:00
committed by Marge Bot
parent f40d32770a
commit 7154c1eb77

View File

@@ -453,7 +453,12 @@ if __name__ == "__main__":
print(f"Pipeline: {pipe.web_url}")
target = '|'.join(args.target)
target_jobs_regex = re.compile(target.strip())
target = target.strip()
# Implicitly include `parallel:` jobs
target = f'({target})' + r'( \d+/\d+)?'
target_jobs_regex = re.compile(target)
deps = set()
print("🞋 job: " + Fore.BLUE + target + Style.RESET_ALL)