From 91d743c35a4d426b3394ff78b6df54ea616883e3 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Mon, 23 Jun 2025 14:26:23 -0400 Subject: [PATCH] support --wait-repo/--wait-build in wrapper-rpm command --- builder/kojid | 3 ++- cli/koji_cli/commands.py | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/builder/kojid b/builder/kojid index b79f1db6..130b403d 100755 --- a/builder/kojid +++ b/builder/kojid @@ -2256,7 +2256,8 @@ class WrapperRPMTask(BaseBuildTask): if not repo_id: # a parent task will generally pass in the repo it used, but if # we are top level, we'll need to find our own - repo_info = self.getRepo(build_tag['id']) + repo_info = self.getRepo(build_tag['id'], builds=opts.get('wait_builds'), + wait=opts.get('wait_repo')) # (subtask) else: repo_info = self.session.repoInfo(repo_id, strict=True) repo_id = repo_info['id'] diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index 4dbd95c8..d8c7d90e 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -835,6 +835,10 @@ def handle_wrapper_rpm(options, session, args): help="Run the build at a lower priority") parser.add_option("--create-draft", action="store_true", help="Create a new draft build instead") + parser.add_option("--wait-repo", action="store_true", + help="Wait for a current repo for the build tag") + parser.add_option("--wait-build", metavar="NVR", action="append", dest="wait_builds", + default=[], help="Wait for the given nvr to appear in buildroot repo") (build_opts, args) = parser.parse_args(args) if build_opts.inis: @@ -879,14 +883,13 @@ def handle_wrapper_rpm(options, session, args): if build_opts.background: priority = 5 opts = {} - if build_opts.create_build: - opts['create_build'] = True - if build_opts.skip_tag: - opts['skip_tag'] = True - if build_opts.scratch: - opts['scratch'] = True if build_opts.create_draft: opts['draft'] = True + # the other passthough opts have matching names + for key in ('create_build', 'skip_tag', 'scratch', 'wait_repo', 'wait_builds'): + val = getattr(build_opts, key) + if val is not None: + opts[key] = val task_id = session.wrapperRPM(build_id, url, target, priority, opts=opts) print("Created task: %d" % task_id) print("Task info: %s/taskinfo?taskID=%s" % (options.weburl, task_id))