bin/ci_run_n_monitor: error out if both --project and --pipeline-url are passed

Signed-off-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24937>
This commit is contained in:
Eric Engestrom
2023-08-29 18:15:47 +01:00
committed by Marge Bot
parent 927a24db14
commit 8366d77e4c

View File

@@ -259,7 +259,16 @@ def parse_args() -> None:
help="URL of the pipeline to use, instead of auto-detecting it.",
)
return parser.parse_args()
args = parser.parse_args()
# argparse doesn't support groups inside add_mutually_exclusive_group(),
# which means we can't just put `--project` and `--rev` in a group together,
# we have to do this by heand instead.
if args.pipeline_url and args.project != parser.get_default("project"):
# weird phrasing but it's the error add_mutually_exclusive_group() gives
parser.error("argument --project: not allowed with argument --pipeline-url")
return args
def find_dependencies(target_job: str, project_path: str, sha: str) -> set[str]: