ci/ci_run_n_monitor: make --target mandatory

There is no point running without a target, just make it mandatory and
simplify the script.

Use ".*" to run all targets.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
This commit is contained in:
Helen Koike
2023-09-29 18:53:19 -03:00
committed by Marge Bot
parent 633c08688b
commit 90da4a6845

View File

@@ -76,7 +76,7 @@ def pretty_wait(sec: int) -> None:
def monitor_pipeline(
project,
pipeline,
target_job: Optional[str],
target_job: str,
dependencies,
force_manual: bool,
stress: bool,
@@ -86,14 +86,13 @@ def monitor_pipeline(
target_statuses: dict[int, str] = defaultdict(str)
stress_status_counter = defaultdict(lambda: defaultdict(int))
if target_job:
target_jobs_regex = re.compile(target_job.strip())
while True:
to_cancel = []
for job in pipeline.jobs.list(all=True, sort="desc"):
# target jobs
if target_job and target_jobs_regex.match(job.name):
if target_jobs_regex.match(job.name):
if force_manual and job.status == "manual":
enable_job(project, job, True)
@@ -115,7 +114,7 @@ def monitor_pipeline(
if job.status == "manual":
enable_job(project, job, False)
elif target_job and job.status not in [
elif job.status not in [
"canceled",
"success",
"failed",
@@ -123,7 +122,6 @@ def monitor_pipeline(
]:
to_cancel.append(job)
if target_job:
cancel_jobs(project, to_cancel)
if stress:
@@ -220,6 +218,7 @@ def parse_args() -> None:
"--target",
metavar="target-job",
help="Target job regex. For multiple targets, separate with pipe | character",
required=True,
)
parser.add_argument(
"--token",