ci_run_n_monitor: add support for new canceling
job status
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29917>
This commit is contained in:

committed by
Marge Bot

parent
2fbdc4d462
commit
fa3d529f55
@@ -53,6 +53,7 @@ STATUS_COLORS = {
|
|||||||
"success": Fore.GREEN,
|
"success": Fore.GREEN,
|
||||||
"failed": Fore.RED,
|
"failed": Fore.RED,
|
||||||
"canceled": Fore.MAGENTA,
|
"canceled": Fore.MAGENTA,
|
||||||
|
"canceling": Fore.MAGENTA,
|
||||||
"manual": "",
|
"manual": "",
|
||||||
"pending": "",
|
"pending": "",
|
||||||
"skipped": "",
|
"skipped": "",
|
||||||
@@ -63,7 +64,7 @@ COMPLETED_STATUSES = ["success", "failed"]
|
|||||||
|
|
||||||
def print_job_status(job, new_status=False) -> None:
|
def print_job_status(job, new_status=False) -> None:
|
||||||
"""It prints a nice, colored job status with a link to the job."""
|
"""It prints a nice, colored job status with a link to the job."""
|
||||||
if job.status == "canceled":
|
if job.status in {"canceled", "canceling"}:
|
||||||
return
|
return
|
||||||
|
|
||||||
if new_status and job.status == "created":
|
if new_status and job.status == "created":
|
||||||
@@ -236,7 +237,7 @@ def enable_job(
|
|||||||
|
|
||||||
pjob = project.jobs.get(job.id, lazy=True)
|
pjob = project.jobs.get(job.id, lazy=True)
|
||||||
|
|
||||||
if job.status in ["success", "failed", "canceled"]:
|
if job.status in ["success", "failed", "canceled", "canceling"]:
|
||||||
new_job = pjob.retry()
|
new_job = pjob.retry()
|
||||||
job = get_pipeline_job(pipeline, new_job["id"])
|
job = get_pipeline_job(pipeline, new_job["id"])
|
||||||
else:
|
else:
|
||||||
@@ -259,6 +260,7 @@ def cancel_job(project, job) -> None:
|
|||||||
"""Cancel GitLab job"""
|
"""Cancel GitLab job"""
|
||||||
if job.status in [
|
if job.status in [
|
||||||
"canceled",
|
"canceled",
|
||||||
|
"canceling",
|
||||||
"success",
|
"success",
|
||||||
"failed",
|
"failed",
|
||||||
"skipped",
|
"skipped",
|
||||||
|
Reference in New Issue
Block a user