Backport PR #4228: wait for a current repo by default

epel9
Mike McLean 4 months ago
parent 29d5571788
commit 9a9c0acdca

@ -9,7 +9,7 @@
Name: koji
Version: 1.35.1
Release: 1%{?dist}
Release: 2%{?dist}
# the included arch lib from yum's rpmUtils is GPLv2+
# Automatically converted from old format: LGPLv2 and GPLv2+ - review is highly recommended.
License: LicenseRef-Callaway-LGPLv2 AND GPL-2.0-or-later
@ -19,6 +19,7 @@ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2
# Not upstreamable
Patch100: fedora-config.patch
Patch101: pr4228-wait-repo-current.patch
BuildArch: noarch
Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release}
@ -362,6 +363,9 @@ done
%systemd_postun kojira.service
%changelog
* Thu Oct 24 2024 Mike McLean <mikem@redhat.com> - 1.35.1-2
- Backport PR #4228: wait for a current repo by default
* Tue Oct 08 2024 Kevin Fenzi <kevin@scrye.com> - 1.35.1-1
- Update to 1.35.1. Fixes rhbz#2316304
- Fixes CVE-2024-9427

@ -0,0 +1,64 @@
commit 9b08aad4f49a7dc432fa466e2361b111a9870a63 (from 57040f731336a77ef308e5101719c65ed2af765c)
Merge: 57040f731 a9f92c503
Author: Mike McLean <mikem@redhat.com>
Date: Thu Oct 24 08:13:45 2024 -0400
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
diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py
index dece662c5..0df721c80 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 2f2714ec5..bbd222665 100644
--- a/tests/test_cli/test_wait_repo.py
+++ b/tests/test_cli/test_wait_repo.py
@@ -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"""
Loading…
Cancel
Save