From 17208c869da48681e897114196743122ae9e247e Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Sat, 23 Mar 2024 01:15:46 +0300 Subject: [PATCH 1/5] import koji-1.34.0-3.el9 --- SPECS/koji.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SPECS/koji.spec b/SPECS/koji.spec index 56100e0..8a55438 100644 --- a/SPECS/koji.spec +++ b/SPECS/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.34.0 -Release: 2%{?dist} +Release: 3%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools @@ -222,7 +222,7 @@ sed -e '/util\/koji/g' -e '/koji_cli_plugins/g' -i setup.py %py3_install_wheel %{name}-%{version}-py3-none-any.whl mkdir -p %{buildroot}/etc/koji.conf.d cp cli/koji.conf %{buildroot}/etc/koji.conf -for D in kojihub builder plugins util www vm ; do +for D in kojihub builder plugins util www vm schemas ; do pushd $D make DESTDIR=$RPM_BUILD_ROOT PYTHON=%{__python3} %{?install_opt} install popd @@ -249,6 +249,7 @@ done %files %{_bindir}/* +%{_datadir}/koji %config(noreplace) /etc/koji.conf %dir /etc/koji.conf.d %doc docs Authors COPYING LGPL @@ -364,6 +365,9 @@ done %systemd_postun kojira.service %changelog +* Fri Mar 22 2024 Kevin Fenzi - 1.34.0-3 +- Add back in missing schema files. rhbz#2270743 + * Mon Mar 18 2024 Kevin Fenzi - 1.34.0-2 - Carry scm policy plugin for hub, it's already upstream - Use dnf5 compatible 'group install' command From 1b728100e27beedc108500c3ef297f1f97c15737 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Mon, 23 Sep 2024 01:14:37 +0300 Subject: [PATCH 2/5] import koji-1.35.0-1.el9 --- .gitignore | 2 +- .koji.metadata | 2 +- ...961929a45ccae1d635b7e85a9d8826baf72d.patch | 29 --- ...5927aeb3e3c052fc9208ca71133d9d097fc0.patch | 229 ------------------ ...18fa356f1aa2a1b5099e55e0af1c89ae4163.patch | 26 -- SOURCES/3974.patch | 43 ---- SOURCES/4013.patch | 52 ---- SOURCES/4026.patch | 38 --- SPECS/koji.spec | 76 +++--- 9 files changed, 49 insertions(+), 448 deletions(-) delete mode 100644 SOURCES/0251961929a45ccae1d635b7e85a9d8826baf72d.patch delete mode 100644 SOURCES/1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch delete mode 100644 SOURCES/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch delete mode 100644 SOURCES/3974.patch delete mode 100644 SOURCES/4013.patch delete mode 100644 SOURCES/4026.patch diff --git a/.gitignore b/.gitignore index 0f21b56..926985d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/koji-1.34.0.tar.bz2 +SOURCES/koji-1.35.0.tar.bz2 diff --git a/.koji.metadata b/.koji.metadata index 9228bfb..59032f4 100644 --- a/.koji.metadata +++ b/.koji.metadata @@ -1 +1 @@ -5f67829ac737963d05fc5c337a42e5d6439d1004 SOURCES/koji-1.34.0.tar.bz2 +54bd1953f8f5c16dfa5f5dd6f037110ec6b995e4 SOURCES/koji-1.35.0.tar.bz2 diff --git a/SOURCES/0251961929a45ccae1d635b7e85a9d8826baf72d.patch b/SOURCES/0251961929a45ccae1d635b7e85a9d8826baf72d.patch deleted file mode 100644 index c910262..0000000 --- a/SOURCES/0251961929a45ccae1d635b7e85a9d8826baf72d.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0251961929a45ccae1d635b7e85a9d8826baf72d Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Feb 07 2024 13:45:08 +0000 -Subject: PR#3989: Oz: don't hardcode the image size unit as 'G' - - -Merges #3989 -https://pagure.io/koji/pull-request/3989 - -Fixes: #3993 -https://pagure.io/koji/issue/3993 - Oz: don't hardcode the image size unit as 'G' - ---- - -diff --git a/builder/kojid b/builder/kojid -index fe35e47..b4536dd 100755 ---- a/builder/kojid -+++ b/builder/kojid -@@ -4101,7 +4101,7 @@ class OzImageTask(BaseTaskHandler): - template += """ - %s OS - -- %sG -+ %s - - - """ % (name, self.opts.get('disk_size')) # noqa: E501 - diff --git a/SOURCES/1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch b/SOURCES/1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch deleted file mode 100644 index 9be3dcc..0000000 --- a/SOURCES/1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch +++ /dev/null @@ -1,229 +0,0 @@ -From 1d515927aeb3e3c052fc9208ca71133d9d097fc0 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Thu, 13 Apr 2023 11:12:40 +0200 -Subject: [PATCH] scmpolicy plugin - ---- - docs/source/defining_hub_policies.rst | 10 +++- - docs/source/plugins.rst | 30 ++++++++++- - koji/policy.py | 53 +++++++++++++++++++- - plugins/builder/scmpolicy.py | 72 +++++++++++++++++++++++++++ - 4 files changed, 162 insertions(+), 3 deletions(-) - create mode 100644 plugins/builder/scmpolicy.py - -diff --git a/docs/source/defining_hub_policies.rst b/docs/source/defining_hub_policies.rst -index a0b67eed..8f9cf2cd 100644 ---- a/docs/source/defining_hub_policies.rst -+++ b/docs/source/defining_hub_policies.rst -@@ -341,5 +341,13 @@ Available tests - * the user matched is the user performing the action - - ``match`` -- * matches a field in the data against glob patterns -+ * matches a field in the data against glob patterns - * true if any pattern matches -+ -+``match_any`` -+ * matches a field (of list/tuple/set type) in the data against glob patterns -+ * true if any field item matches all patterns -+ -+``match_all`` -+ * matches a field (of list/tuple/set type) in the data against glob patterns -+ * true if all field items match any pattern -diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst -index c370709a..d5b2d13f 100644 ---- a/docs/source/plugins.rst -+++ b/docs/source/plugins.rst -@@ -223,7 +223,7 @@ The ``[message]`` section sets parameters for how messages are formed. - Currently only one field is understood: - - * ``extra_limit`` -- the maximum allowed size for ``build.extra`` fields that -- appear in messages. If the ``build.extra`` field is longer (in terms of -+ appear in messages. If the ``build.extra`` field is longer (in terms of - json-encoded length), then it will be omitted. The default value is ``0`` - which means no limit. - -@@ -441,3 +441,31 @@ For example: - For each RPM in the tag, Koji will use the first signed copy that it finds. In other words, - Koji will try the first key (`45719a39`), and if Koji does not have the first key's signature - for that RPM, then it will try the second key (`9867c58f`), third key (`38ab71f4`), and so on. -+ -+Scm Policies -+============ -+ -+Basic filtering of allowed scms normally happens via standard -+``build_from_scm`` hub policy. Nevertheless, some relevant information can be -+only gathered after cloning the repo. Typical case is that admin would like to -+build content only from some set of allowed branches. If user specify the -+commit via hash, we don't have that information in moment of task creation. -+Just after cloning we can check existing branches and if the given commit is on -+some of the relevant ones. For this purpose there is special -+``postSCMCheckout`` plugin ``scmpolicy``. -+ -+Installation happens only on builder via editing ``/etc/kojid.conf`` by adding -+``plugin = scmpolicy`` there. Plugin itself is not configured but uses hub -+policy ``scm``. Policy data provided there are composed of two parts. First one -+are ``scm_*`` values which are same as in ``build_from_scm``. -+ -+.. code:: -+ -+ scm = -+ # allow scratch builds from any commits -+ bool scratch :: allow -+ # very safe scm, allow anything from there, but only to special target -+ match scm_host very.safe.git.org && buildtag testing-build-tag :: allow -+ match_all branches * !! deny Commit must be present on some branch -+ match_all branches private-* test-* :: deny Private/testing branches are not allowed -+ all :: allow -diff --git a/koji/policy.py b/koji/policy.py -index 729e02e5..8a570575 100644 ---- a/koji/policy.py -+++ b/koji/policy.py -@@ -25,7 +25,7 @@ import logging - import six - - import koji --from koji.util import to_list -+from koji.util import to_list, multi_fnmatch - - - class BaseSimpleTest(object): -@@ -141,6 +141,57 @@ class MatchTest(BaseSimpleTest): - return False - - -+class MatchAnyTest(BaseSimpleTest): -+ """Matches any item of a list/tuple/set value in the data against glob patterns -+ -+ True if any of the expressions matches any item in the list/tuple/set, else False. -+ If the field doesn't exist or isn't a list/tuple/set, the test returns False -+ -+ Syntax: -+ find field pattern1 [pattern2 ...] -+ -+ """ -+ name = 'match_any' -+ field = None -+ -+ def run(self, data): -+ args = self.str.split()[1:] -+ self.field = args[0] -+ args = args[1:] -+ tgt = data.get(self.field) -+ if tgt and isinstance(tgt, (list, tuple, set)): -+ for i in tgt: -+ if i is not None and multi_fnmatch(str(i), args): -+ return True -+ return False -+ -+ -+class MatchAllTest(BaseSimpleTest): -+ """Matches all items of a list/tuple/set value in the data against glob patterns -+ -+ True if any of the expressions matches all items in the list/tuple/set, else False. -+ If the field doesn't exist or isn't a list/tuple/set, the test returns False -+ -+ Syntax: -+ match_all field pattern1 [pattern2 ...] -+ -+ """ -+ name = 'match_all' -+ field = None -+ -+ def run(self, data): -+ args = self.str.split()[1:] -+ self.field = args[0] -+ args = args[1:] -+ tgt = data.get(self.field) -+ if tgt and isinstance(tgt, (list, tuple, set)): -+ for i in tgt: -+ if i is None or not multi_fnmatch(str(i), args): -+ return False -+ return True -+ return False -+ -+ - class TargetTest(MatchTest): - """Matches target in the data against glob patterns - -diff --git a/plugins/builder/scmpolicy.py b/plugins/builder/scmpolicy.py -new file mode 100644 -index 00000000..f120e33b ---- /dev/null -+++ b/plugins/builder/scmpolicy.py -@@ -0,0 +1,72 @@ -+import logging -+import re -+import subprocess -+ -+import six -+ -+from koji import ActionNotAllowed, GenericError -+from koji.plugin import callback -+ -+ -+logger = logging.getLogger('koji.plugins.scmpolicy') -+ -+ -+@callback('postSCMCheckout') -+def assert_scm_policy(clb_type, *args, **kwargs): -+ taskinfo = kwargs['taskinfo'] -+ session = kwargs['session'] -+ build_tag = kwargs['build_tag'] -+ scminfo = kwargs['scminfo'] -+ srcdir = kwargs['srcdir'] -+ scratch = kwargs['scratch'] -+ -+ method = get_task_method(session, taskinfo) -+ -+ policy_data = { -+ 'build_tag': build_tag, -+ 'method': method, -+ 'scratch': scratch, -+ 'branches': get_branches(srcdir) -+ } -+ -+ # Merge scminfo into data with "scm_" prefix. And "scm*" are changed to "scm_*". -+ for k, v in six.iteritems(scminfo): -+ policy_data[re.sub(r'^(scm_?)?', 'scm_', k)] = v -+ -+ logger.info("Checking SCM policy for task %s", taskinfo['id']) -+ logger.debug("Policy data: %r", policy_data) -+ -+ # check the policy -+ try: -+ session.host.assertPolicy('scm', policy_data) -+ logger.info("SCM policy check for task %s: PASSED", taskinfo['id']) -+ except ActionNotAllowed: -+ logger.warning("SCM policy check for task %s: DENIED", taskinfo['id']) -+ raise -+ -+ -+def get_task_method(session, taskinfo): -+ """Get the Task method from taskinfo""" -+ method = None -+ if isinstance(taskinfo, six.integer_types): -+ taskinfo = session.getTaskInfo(taskinfo, strict=True) -+ if isinstance(taskinfo, dict): -+ method = taskinfo.get('method') -+ if method is None: -+ raise GenericError("Invalid taskinfo: %s" % taskinfo) -+ return method -+ -+ -+def get_branches(srcdir): -+ """Determine which remote branches contain the current checkout""" -+ cmd = ['git', 'branch', '-r', '--contains', 'HEAD'] -+ proc = subprocess.Popen(cmd, cwd=srcdir, stdout=subprocess.PIPE) -+ (out, _) = proc.communicate() -+ status = proc.wait() -+ if status != 0: -+ raise Exception('Error getting branches for git checkout') -+ -+ # cut off origin/ prefix -+ branches = [b.strip() for b in out.decode().split('\n') if 'origin/HEAD' not in b and b] -+ branches = [re.sub('^origin/', '', b) for b in branches] -+ return branches --- -GitLab - diff --git a/SOURCES/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch b/SOURCES/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch deleted file mode 100644 index 71f07d5..0000000 --- a/SOURCES/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163 Mon Sep 17 00:00:00 2001 -From: Mike McLean -Date: Feb 05 2024 10:28:43 +0000 -Subject: typo in set_refusal - - -Fixes https://pagure.io/koji/issue/3997 - ---- - -diff --git a/kojihub/scheduler.py b/kojihub/scheduler.py -index 815b0f1..961ef39 100644 ---- a/kojihub/scheduler.py -+++ b/kojihub/scheduler.py -@@ -91,8 +91,8 @@ def get_tasks_for_host(hostID, retry=True): - - def set_refusal(hostID, taskID, soft=True, by_host=False, msg=''): - data = { -- 'task_id': kojihub.convert_value(hostID, cast=int), -- 'host_id': kojihub.convert_value(taskID, cast=int), -+ 'host_id': kojihub.convert_value(hostID, cast=int), -+ 'task_id': kojihub.convert_value(taskID, cast=int), - 'soft': kojihub.convert_value(soft, cast=bool), - 'by_host': kojihub.convert_value(by_host, cast=bool), - 'msg': kojihub.convert_value(msg, cast=str), - diff --git a/SOURCES/3974.patch b/SOURCES/3974.patch deleted file mode 100644 index 7096d54..0000000 --- a/SOURCES/3974.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 36953540662aa39ff1b85218cefededfa4e529a9 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Jan 15 2024 12:48:16 +0000 -Subject: Use dnf5-compatible "group install" command - - - * yum knows only "yum groupinstall" - * dnf < 5 knows both - * dnf-5 only "dnf5 group install" - -It is reasonable to assume that dnf is used in most setups, so changing -default to "group install". If yum is specified *explicitly* via -tags's extra "mock.package_manager", "groupinstall" is used instead. - -Related: https://pagure.io/koji/issue/3971 - ---- - -diff --git a/koji/__init__.py b/koji/__init__.py -index 334b403..9b222cd 100644 ---- a/koji/__init__.py -+++ b/koji/__init__.py -@@ -1804,7 +1804,7 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts) - 'target_arch': opts.get('target_arch', arch), - 'chroothome': '/builddir', - # Use the group data rather than a generated rpm -- 'chroot_setup_cmd': 'groupinstall %s' % opts.get('install_group', 'build'), -+ 'chroot_setup_cmd': 'group install %s' % opts.get('install_group', 'build'), - # don't encourage network access from the chroot - 'rpmbuild_networking': opts.get('use_host_resolv', False), - 'use_host_resolv': opts.get('use_host_resolv', False), -@@ -1817,6 +1817,10 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts) - config_opts['forcearch'] = opts['forcearch'] - if opts.get('package_manager'): - config_opts['package_manager'] = opts['package_manager'] -+ if opts['package_manager'].endswith('yum'): -+ # backward compatibility with yum (doesn't have separate "group") -+ config_opts['chroot_setup_cmd'] = \ -+ 'groupinstall %s' % opts.get('install_group', 'build') - if opts.get('bootstrap_image'): - config_opts['use_bootstrap_image'] = True - config_opts['bootstrap_image'] = opts['bootstrap_image'] - diff --git a/SOURCES/4013.patch b/SOURCES/4013.patch deleted file mode 100644 index 9b3fae8..0000000 --- a/SOURCES/4013.patch +++ /dev/null @@ -1,52 +0,0 @@ -From bc8e6253f519eeb78fbc8740bba25e8a34490814 Mon Sep 17 00:00:00 2001 -From: Mike McLean -Date: Feb 14 2024 06:40:24 +0000 -Subject: let tag.extra override tag arches for noarch - - ---- - -diff --git a/builder/kojid b/builder/kojid -index b4536dd..8b81d66 100755 ---- a/builder/kojid -+++ b/builder/kojid -@@ -1339,23 +1339,33 @@ class BuildTask(BaseTaskHandler): - exclusivearch = koji.get_header_field(h, 'exclusivearch') - excludearch = koji.get_header_field(h, 'excludearch') - -- if exclusivearch or excludearch: -+ buildconfig = self.session.getBuildConfig(build_tag, event=self.event_id) -+ noarch_arches = buildconfig.get('extra', {}).get('noarch_arches') -+ -+ if exclusivearch or excludearch or noarch_arches: - # if one of the tag arches is filtered out, then we can't use a - # noarch task -- buildconfig = self.session.getBuildConfig(build_tag, event=self.event_id) - arches = buildconfig['arches'] - tag_arches = [koji.canonArch(a) for a in arches.split()] - exclusivearch = [koji.canonArch(a) for a in exclusivearch] - excludearch = [koji.canonArch(a) for a in excludearch] -- archlist = list(tag_arches) -+ # tag.extra overrides tag arches for noarch -+ if noarch_arches: -+ archlist = [koji.canonArch(a) for a in noarch_arches.split()] -+ archlist = [a for a in archlist if a in tag_arches] -+ else: -+ archlist = list(tag_arches) - if exclusivearch: - archlist = [a for a in archlist if a in exclusivearch] - if excludearch: - archlist = [a for a in archlist if a not in excludearch] -+ self.logger.info('Filtering arches for noarch subtask. Choices: %r', archlist) - if not archlist: -- raise koji.BuildError("No valid arches were found. tag %r, " -- "exclusive %r, exclude %r" % (tag_arches, -+ raise koji.BuildError("No valid arches were found. tag %r, extra %r," -+ "exclusive %r, exclude %r" % (tag_arches, noarch_arches, - exclusivearch, excludearch)) -+ self.logger.debug('tag: %r, extra: %r, exclusive: %r, exclude: %r', -+ tag_arches, noarch_arches, exclusivearch, excludearch) - if set(archlist) != set(tag_arches): - return random.choice(archlist) - else: - diff --git a/SOURCES/4026.patch b/SOURCES/4026.patch deleted file mode 100644 index edf0b36..0000000 --- a/SOURCES/4026.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f453092d308605707ba1fb3fa314e05b515e7a25 Mon Sep 17 00:00:00 2001 -From: Tomas Kopecek -Date: Feb 29 2024 10:45:55 +0000 -Subject: Better index for rpm lookup - - -Related: https://pagure.io/koji/issue/4022 - ---- - -diff --git a/schemas/schema-upgrade-1.34-1.35.sql b/schemas/schema-upgrade-1.34-1.35.sql -new file mode 100644 -index 0000000..3cc82bc ---- /dev/null -+++ b/schemas/schema-upgrade-1.34-1.35.sql -@@ -0,0 +1,9 @@ -+-- upgrade script to migrate the Koji database schema -+-- from version 1.33 to 1.34 -+ -+BEGIN; -+ -+CREATE INDEX CONCURRENTLY IF NOT EXISTS rpminfo_nvra -+ ON rpminfo(name,version,release,arch,external_repo_id); -+ -+COMMIT; -diff --git a/schemas/schema.sql b/schemas/schema.sql -index e5f3462..7e3298c 100644 ---- a/schemas/schema.sql -+++ b/schemas/schema.sql -@@ -752,6 +752,7 @@ CREATE TABLE rpminfo ( - CREATE INDEX rpminfo_build ON rpminfo(build_id); - CREATE UNIQUE INDEX rpminfo_unique_nvra_not_draft ON rpminfo(name,version,release,arch,external_repo_id) - WHERE draft IS NOT TRUE; -+CREATE INDEX rpminfo_nvra ON rpminfo(name,version,release,arch,external_repo_id); - -- index for default search method for rpms, PG11+ can benefit from new include method - DO $$ - DECLARE version integer; - diff --git a/SPECS/koji.spec b/SPECS/koji.spec index 8a55438..c5b4241 100644 --- a/SPECS/koji.spec +++ b/SPECS/koji.spec @@ -8,31 +8,17 @@ %{?!python3_pkgversion:%global python3_pkgversion 3} Name: koji -Version: 1.34.0 -Release: 3%{?dist} +Version: 1.35.0 +Release: 1%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ -License: LGPLv2 and GPLv2+ +# Automatically converted from old format: LGPLv2 and GPLv2+ - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 AND GPL-2.0-or-later Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 -# scm policy plugin - already upstreamed -Patch1: 1d515927aeb3e3c052fc9208ca71133d9d097fc0.patch # Not upstreamable Patch100: fedora-config.patch -# Use dnf5-compatible "group install" command -# This should work on yum/dnf-4/dnf5 -Patch102: https://pagure.io/koji/pull-request/3974.patch -# noarch builds only happen on some arches -# allows picking what arches will do noarch builds -Patch103: https://pagure.io/koji/pull-request/4013.patch -# oz size patch -# Drop passing a unit to oz so it can determine GiB vs GB -Patch104: https://pagure.io/koji/c/0251961929a45ccae1d635b7e85a9d8826baf72d.patch -# fix typo in refusal - already upstreamed -Patch105: https://pagure.io/koji/c/2a6e18fa356f1aa2a1b5099e55e0af1c89ae4163.patch -# Add index for rpminfo -Patch106: https://pagure.io/koji/pull-request/4026.patch BuildArch: noarch Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} @@ -67,7 +53,8 @@ This subpackage provides python functions and libraries. %package -n python%{python3_pkgversion}-%{name}-cli-plugins Summary: Koji client plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: python%{python3_pkgversion}-%{name} = %{version}-%{release} %description -n python%{python3_pkgversion}-%{name}-cli-plugins @@ -75,7 +62,8 @@ Plugins to the koji command-line interface %package hub Summary: Koji XMLRPC interface -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: %{name}-hub-code %if 0%{?fedora} || 0%{?rhel} > 7 @@ -88,7 +76,8 @@ koji-hub is the XMLRPC interface to the koji database %package -n python%{python3_pkgversion}-%{name}-hub Summary: Koji XMLRPC interface -License: LGPLv2 and GPLv2 +# Automatically converted from old format: LGPLv2 and GPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 AND GPL-2.0-only # rpmdiff lib (from rpmlint) is GPLv2 (only) Requires: httpd Requires: python%{python3_pkgversion}-mod_wsgi @@ -102,7 +91,8 @@ koji-hub is the XMLRPC interface to the koji database %package hub-plugins Summary: Koji hub plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name}-hub-plugins-code = %{version}-%{release} %if 0%{?fedora} || 0%{?rhel} > 7 Suggests: python%{python3_pkgversion}-%{name}-hub-plugins @@ -113,7 +103,8 @@ Plugins to the koji XMLRPC interface %package -n python%{python3_pkgversion}-%{name}-hub-plugins Summary: Koji hub plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: python%{python3_pkgversion}-%{name}-hub = %{version}-%{release} Requires: python%{python3_pkgversion}-qpid-proton Requires: cpio @@ -124,7 +115,8 @@ Plugins to the koji XMLRPC interface %package builder-plugins Summary: Koji builder plugins -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: %{name}-builder = %{version}-%{release} @@ -133,7 +125,8 @@ Plugins for the koji build daemon %package builder Summary: Koji RPM builder daemon -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: mock >= 0.9.14 Requires(pre): /usr/sbin/useradd Requires: squashfs-tools @@ -156,7 +149,8 @@ tasks that come through the Koji system. %package vm Summary: Koji virtual machine management daemon -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires(post): systemd Requires(preun): systemd @@ -172,7 +166,8 @@ virtual machine. This package is not required for most installations. %package utils Summary: Koji Utilities -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: python%{python3_pkgversion}-psycopg2 Requires(post): systemd @@ -184,7 +179,8 @@ Utilities for the Koji system %package web Summary: Koji Web UI -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 Requires: %{name} = %{version}-%{release} Requires: %{name}-web-code = %{version}-%{release} %if 0%{?fedora} || 0%{?rhel} > 7 @@ -196,7 +192,8 @@ koji-web is a web UI to the Koji system. %package -n python%{python3_pkgversion}-%{name}-web Summary: Koji Web UI -License: LGPLv2 +# Automatically converted from old format: LGPLv2 - review is highly recommended. +License: LicenseRef-Callaway-LGPLv2 %{?python_provide:%python_provide python%{python3_pkgversion}-%{name}-web} Requires: httpd Requires: python%{python3_pkgversion}-mod_wsgi @@ -365,6 +362,27 @@ done %systemd_postun kojira.service %changelog +* Wed Sep 18 2024 Kevin Fenzi - 1.35.0-1 +- Update to 1.35.0. Fixes rhbz#2312848 + +* Mon Sep 02 2024 Miroslav Suchý - 1.34.1-6 +- convert license to SPDX + +* Mon Aug 26 2024 Adam Williamson - 1.34.1-5 +- Backport PR #4184 to support overriding version and releasever for Kiwi + +* Thu Aug 22 2024 Adam Williamson - 1.34.1-4 +- Backport PR #4157 to support overriding Kiwi image file name format + +* Thu Jul 18 2024 Fedora Release Engineering - 1.34.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Fri Jun 07 2024 Python Maint - 1.34.1-2 +- Rebuilt for Python 3.13 + +* Wed Jun 05 2024 Kevin Fenzi - 1.34.1-1 +- Upgrade to 1.34.1. Fixes rhbz#2283973 + * Fri Mar 22 2024 Kevin Fenzi - 1.34.0-3 - Add back in missing schema files. rhbz#2270743 From 939c1e96f35f0f09fba35751f4b89dfe9ac457de Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Wed, 9 Oct 2024 01:14:27 +0300 Subject: [PATCH 3/5] import koji-1.35.1-1.el9 --- .gitignore | 2 +- .koji.metadata | 2 +- SPECS/koji.spec | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 926985d..42f3ebf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/koji-1.35.0.tar.bz2 +SOURCES/koji-1.35.1.tar.bz2 diff --git a/.koji.metadata b/.koji.metadata index 59032f4..816db32 100644 --- a/.koji.metadata +++ b/.koji.metadata @@ -1 +1 @@ -54bd1953f8f5c16dfa5f5dd6f037110ec6b995e4 SOURCES/koji-1.35.0.tar.bz2 +7dc628f4206df8865bb4c71db4ce8a0f41891c83 SOURCES/koji-1.35.1.tar.bz2 diff --git a/SPECS/koji.spec b/SPECS/koji.spec index c5b4241..bcdd447 100644 --- a/SPECS/koji.spec +++ b/SPECS/koji.spec @@ -8,7 +8,7 @@ %{?!python3_pkgversion:%global python3_pkgversion 3} Name: koji -Version: 1.35.0 +Version: 1.35.1 Release: 1%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ # Automatically converted from old format: LGPLv2 and GPLv2+ - review is highly recommended. @@ -362,6 +362,10 @@ done %systemd_postun kojira.service %changelog +* Tue Oct 08 2024 Kevin Fenzi - 1.35.1-1 +- Update to 1.35.1. Fixes rhbz#2316304 +- Fixes CVE-2024-9427 + * Wed Sep 18 2024 Kevin Fenzi - 1.35.0-1 - Update to 1.35.0. Fixes rhbz#2312848 From 2404d35bcdc4d6b64765923dc008ab77fc67e236 Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Sat, 26 Oct 2024 01:14:23 +0300 Subject: [PATCH 4/5] import koji-1.35.1-2.el9 --- SOURCES/pr4228-wait-repo-current.patch | 64 ++++++++++++++++++++++++++ SPECS/koji.spec | 6 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 SOURCES/pr4228-wait-repo-current.patch diff --git a/SOURCES/pr4228-wait-repo-current.patch b/SOURCES/pr4228-wait-repo-current.patch new file mode 100644 index 0000000..16903d2 --- /dev/null +++ b/SOURCES/pr4228-wait-repo-current.patch @@ -0,0 +1,64 @@ +commit 9b08aad4f49a7dc432fa466e2361b111a9870a63 (from 57040f731336a77ef308e5101719c65ed2af765c) +Merge: 57040f731 a9f92c503 +Author: Mike McLean +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""" diff --git a/SPECS/koji.spec b/SPECS/koji.spec index bcdd447..a69d67e 100644 --- a/SPECS/koji.spec +++ b/SPECS/koji.spec @@ -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 - 1.35.1-2 +- Backport PR #4228: wait for a current repo by default + * Tue Oct 08 2024 Kevin Fenzi - 1.35.1-1 - Update to 1.35.1. Fixes rhbz#2316304 - Fixes CVE-2024-9427 From ae0f0221b82bb4f3892c66c7385ed83106fb7e3a Mon Sep 17 00:00:00 2001 From: MSVSphere Packaging Team Date: Wed, 6 Nov 2024 01:14:05 +0300 Subject: [PATCH 5/5] import koji-1.35.1-3.el9 --- ...1-repos-check-for-newer-create-event.patch | 25 +++++++++++++++++++ SPECS/koji.spec | 4 ++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-repos-check-for-newer-create-event.patch diff --git a/SOURCES/0001-repos-check-for-newer-create-event.patch b/SOURCES/0001-repos-check-for-newer-create-event.patch new file mode 100644 index 0000000..8f227cd --- /dev/null +++ b/SOURCES/0001-repos-check-for-newer-create-event.patch @@ -0,0 +1,25 @@ +From a0498970e73384a3bce62bc28f5f98f4feeabaff Mon Sep 17 00:00:00 2001 +From: Igor Raits +Date: Nov 05 2024 13:53:22 +0000 +Subject: repos: check for newer create event + + +When the repo was just created, it has create_event that is the same as +we are checking so the repo will never be considered latest. + +--- + +diff --git a/kojihub/repos.py b/kojihub/repos.py +index 5fc08ed..9a7fd03 100644 +--- a/kojihub/repos.py ++++ b/kojihub/repos.py +@@ -333,7 +333,7 @@ def symlink_if_latest(repo): + clauses = [ + ['tag_id', '=', repo['tag_id']], + ['state', '=', koji.REPO_READY], +- ['create_event', '>=', repo['create_event']]] ++ ['create_event', '>', repo['create_event']]] + if repo['dist']: + clauses.append(['dist', 'IS', True]) + else: + diff --git a/SPECS/koji.spec b/SPECS/koji.spec index a69d67e..f9503c1 100644 --- a/SPECS/koji.spec +++ b/SPECS/koji.spec @@ -9,7 +9,7 @@ Name: koji Version: 1.35.1 -Release: 2%{?dist} +Release: 3%{?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 @@ -17,6 +17,8 @@ Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 +Patch1: https://pagure.io/koji/pull-request/4258.patch#/0001-repos-check-for-newer-create-event.patch + # Not upstreamable Patch100: fedora-config.patch Patch101: pr4228-wait-repo-current.patch