From 325d4754c9c70208e96184802bc61c3fe28f1fa0 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Oct 11 2024 16:23:19 +0000 Subject: cli: wait-repo: wait for a current repo by default The pre-1.35 behavior was to wait for a fresh regen. --- diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index dece662..0df721c 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -7360,8 +7360,14 @@ def anon_handle_wait_repo(options, session, args): error('' if suboptions.quiet else msg) return + if builds: + # we're waiting for a repo with these builds, not necessarily a current one + min_event = None + else: + # wait for a current repo + min_event = "last" watcher = _get_watcher(options, suboptions, session, tag['id'], nvrs=suboptions.builds, - min_event=None) + min_event=min_event) try: repoinfo = watcher.waitrepo(anon=anon) diff --git a/tests/test_cli/test_wait_repo.py b/tests/test_cli/test_wait_repo.py index 2d301f6..8067e4b 100644 --- a/tests/test_cli/test_wait_repo.py +++ b/tests/test_cli/test_wait_repo.py @@ -203,7 +203,7 @@ class TestWaitRepo(utils.CliTestCase): expected = "%(name)s is not a build tag for any target" % self.TAG + "\n" self.assert_console_message(stderr, expected) - self.RepoWatcher.assert_called_with(self.session, self.TAG['id'], nvrs=[], min_event=None, logger=self.wait_logger) + self.RepoWatcher.assert_called_with(self.session, self.TAG['id'], nvrs=[], min_event="last", logger=self.wait_logger) # Cas 2. dest is matched, show suggestion self.RepoWatcher.reset_mock() @@ -219,7 +219,7 @@ class TestWaitRepo(utils.CliTestCase): expected = "%(name)s is not a build tag for any target" % self.TAG + "\n" expected += "Suggested tags: build-tag-1, build-tag-2, build-tag-3\n" self.assert_console_message(stderr, expected) - self.RepoWatcher.assert_called_with(self.session, self.TAG['id'], nvrs=[], min_event=None, logger=self.wait_logger) + self.RepoWatcher.assert_called_with(self.session, self.TAG['id'], nvrs=[], min_event="last", logger=self.wait_logger) def test_anon_handle_wait_repo_help(self): """Test anon_handle_wait_repo help message"""