ci/run_n_monitor: Remove --force-manual
Now that we can exclude by stages instead, we don't need --force-manual. Having mandatory arguments which also do the wrong thing is not great. Signed-off-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30784>
This commit is contained in:
@@ -117,7 +117,6 @@ def monitor_pipeline(
|
|||||||
include_stage_regex: re.Pattern,
|
include_stage_regex: re.Pattern,
|
||||||
exclude_stage_regex: re.Pattern,
|
exclude_stage_regex: re.Pattern,
|
||||||
dependencies: set[str],
|
dependencies: set[str],
|
||||||
force_manual: bool,
|
|
||||||
stress: int,
|
stress: int,
|
||||||
) -> tuple[Optional[int], Optional[int], Dict[str, Dict[int, Tuple[float, str, str]]]]:
|
) -> tuple[Optional[int], Optional[int], Dict[str, Dict[int, Tuple[float, str, str]]]]:
|
||||||
"""Monitors pipeline and delegate canceling jobs"""
|
"""Monitors pipeline and delegate canceling jobs"""
|
||||||
@@ -128,12 +127,7 @@ def monitor_pipeline(
|
|||||||
target_id: int = -1
|
target_id: int = -1
|
||||||
name_field_pad: int = len(max(dependencies, key=len))+2
|
name_field_pad: int = len(max(dependencies, key=len))+2
|
||||||
# In a running pipeline, we can skip following job traces that are in these statuses.
|
# In a running pipeline, we can skip following job traces that are in these statuses.
|
||||||
skip_follow_statuses: frozenset[str] = (
|
skip_follow_statuses: frozenset[str] = (COMPLETED_STATUSES)
|
||||||
COMPLETED_STATUSES
|
|
||||||
if force_manual
|
|
||||||
# If the target job is marked as manual and we don't force it to run, it will be skipped.
|
|
||||||
else frozenset({*COMPLETED_STATUSES, "manual"})
|
|
||||||
)
|
|
||||||
|
|
||||||
# Pre-populate the stress status counter for already completed target jobs.
|
# Pre-populate the stress status counter for already completed target jobs.
|
||||||
if stress:
|
if stress:
|
||||||
@@ -154,7 +148,6 @@ def monitor_pipeline(
|
|||||||
enable_job,
|
enable_job,
|
||||||
project=project,
|
project=project,
|
||||||
pipeline=pipeline,
|
pipeline=pipeline,
|
||||||
force_manual=force_manual,
|
|
||||||
job_name_field_pad=name_field_pad,
|
job_name_field_pad=name_field_pad,
|
||||||
jobs_waiting=jobs_waiting,
|
jobs_waiting=jobs_waiting,
|
||||||
)
|
)
|
||||||
@@ -267,7 +260,6 @@ def enable_job(
|
|||||||
pipeline: gitlab.v4.objects.ProjectPipeline,
|
pipeline: gitlab.v4.objects.ProjectPipeline,
|
||||||
job: gitlab.v4.objects.ProjectPipelineJob,
|
job: gitlab.v4.objects.ProjectPipelineJob,
|
||||||
action_type: Literal["target", "dep", "retry"],
|
action_type: Literal["target", "dep", "retry"],
|
||||||
force_manual: bool,
|
|
||||||
job_name_field_pad: int = 0,
|
job_name_field_pad: int = 0,
|
||||||
jobs_waiting: list[str] = [],
|
jobs_waiting: list[str] = [],
|
||||||
) -> gitlab.v4.objects.ProjectPipelineJob:
|
) -> gitlab.v4.objects.ProjectPipelineJob:
|
||||||
@@ -279,7 +271,6 @@ def enable_job(
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
(job.status in COMPLETED_STATUSES and action_type != "retry")
|
(job.status in COMPLETED_STATUSES and action_type != "retry")
|
||||||
or (job.status == "manual" and not force_manual)
|
|
||||||
or job.status in {"skipped"} | RUNNING_STATUSES
|
or job.status in {"skipped"} | RUNNING_STATUSES
|
||||||
):
|
):
|
||||||
return job
|
return job
|
||||||
@@ -401,7 +392,8 @@ def parse_args() -> argparse.Namespace:
|
|||||||
f"otherwise it's read from {TOKEN_DIR / 'gitlab-token'}",
|
f"otherwise it's read from {TOKEN_DIR / 'gitlab-token'}",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--force-manual", action="store_true", help="Force jobs marked as manual"
|
"--force-manual", action="store_true",
|
||||||
|
help="Deprecated argument; manual jobs are always force-enabled"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--stress",
|
"--stress",
|
||||||
@@ -643,7 +635,6 @@ def main() -> None:
|
|||||||
include_stage_regex,
|
include_stage_regex,
|
||||||
exclude_stage_regex,
|
exclude_stage_regex,
|
||||||
deps,
|
deps,
|
||||||
args.force_manual,
|
|
||||||
args.stress
|
args.stress
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user