PR#4228: cli: wait-repo: wait for a current repo by default

Merges #4228
https://pagure.io/koji/pull-request/4228

Fixes: #4229
https://pagure.io/koji/issue/4229
cli: wait-repo can report an older repo

Fixes: #4226
https://pagure.io/koji/issue/4226
koji wait-repo command behaviour change / regression in 1.35

Relates: #4227
https://pagure.io/koji/issue/4227
koji 1.35: blocking a package from a tag does not seem to cause newRepo tasks
This commit is contained in:
Mike McLean 2024-10-24 08:13:45 -04:00
commit 9b08aad4f4
2 changed files with 9 additions and 3 deletions

View file

@ -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)

View file

@ -206,7 +206,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()
@ -222,7 +222,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"""