diff --git a/.gitignore b/.gitignore index 7d8bb53..549acae 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ koji-1.4.0.tar.bz2 /koji-1.28.1.tar.bz2 /koji-1.29.0.tar.bz2 /koji-1.29.1.tar.bz2 +/koji-1.30.0.tar.bz2 diff --git a/0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch b/0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch deleted file mode 100644 index 04dffc4..0000000 --- a/0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch +++ /dev/null @@ -1,36 +0,0 @@ -From 74c34cec10efe19fc591fc0cdc4d2132e31e8b2d Mon Sep 17 00:00:00 2001 -From: Adam Williamson -Date: Wed, 20 Jul 2022 16:04:08 -0700 -Subject: [PATCH] Don't crash in _checkImageState if there's no image.os_plugin - -We've seen some tasks lately where Koji crashed trying to do -`image.os_plugin.abort()`, e.g.: - -https://koji.fedoraproject.org/koji/taskinfo?taskID=89750587 -https://koji.fedoraproject.org/koji/taskinfo?taskID=89671944 - -The fix seems fairly simple: only try and abort if os_plugin -actually exists. - -Signed-off-by: Adam Williamson ---- - builder/kojid | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/builder/kojid b/builder/kojid -index e7ba1888..de6859dd 100755 ---- a/builder/kojid -+++ b/builder/kojid -@@ -4164,7 +4164,8 @@ class BaseImageTask(OzImageTask): - if scrnshot: - ext = scrnshot[-3:] - self.uploadFile(scrnshot, remoteName='screenshot.%s' % ext) -- image.os_plugin.abort() # forcibly tear down the VM -+ if image.os_plugin: -+ image.os_plugin.abort() # forcibly tear down the VM - # TODO abort when a task is CANCELLED - if not self.session.checkUpload('', os.path.basename(self.ozlog)): - self.tlog.removeHandler(self.fhandler) --- -2.37.1 - diff --git a/3459.patch b/3459.patch deleted file mode 100644 index b522581..0000000 --- a/3459.patch +++ /dev/null @@ -1,479 +0,0 @@ -From 9f498f1cf3339f3f41d1bb80df2ada4e391624b3 Mon Sep 17 00:00:00 2001 -From: Jana Cupova -Date: Aug 10 2022 05:38:00 +0000 -Subject: Fix arch in download-task - - -Fixes: https://pagure.io/koji/issue/3456 - ---- - -diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py -index 9e2cc1b..c2b2d97 100644 ---- a/cli/koji_cli/commands.py -+++ b/cli/koji_cli/commands.py -@@ -6952,50 +6952,49 @@ def anon_handle_download_task(options, session, args): - for task in list_tasks: - taskarch = task['arch'] - task_id = str(task['id']) -- if len(suboptions.arches) == 0 or taskarch in suboptions.arches: -- files = list_task_output_all_volumes(session, task["id"]) -- for filename in files: -- if filename.endswith('src.rpm'): -- filetype = 'src.rpm' -- else: -- filetype = filename.rsplit('.', 1)[1] -- if suboptions.all and not (task['method'] in build_methods_list and -- filetype in rpm_file_types): -- if filetype != 'log': -- for volume in files[filename]: -- if suboptions.dirpertask: -- new_filename = '%s/%s' % (task_id, filename) -- else: -- if taskarch not in filename and filetype != 'src.rpm': -- part_filename = filename[:-len('.%s' % filetype)] -- new_filename = "%s.%s.%s" % (part_filename, -- taskarch, filetype) -- else: -- new_filename = filename -- downloads.append((task, filename, volume, new_filename, task_id)) -- elif task['method'] in build_methods_list: -- if filetype in rpm_file_types: -- filearch = filename.split(".")[-2] -- for volume in files[filename]: -- if len(suboptions.arches) == 0 or filearch in suboptions.arches: -- if suboptions.dirpertask: -- new_filename = '%s/%s' % (task_id, filename) -- else: -- new_filename = filename -- downloads.append((task, filename, volume, new_filename, -- task_id)) -- -- if filetype == 'log' and suboptions.logs: -+ files = list_task_output_all_volumes(session, task["id"]) -+ for filename in files: -+ if filename.endswith('src.rpm'): -+ filetype = 'src.rpm' -+ else: -+ filetype = filename.rsplit('.', 1)[1] -+ if suboptions.all and not (task['method'] in build_methods_list and -+ filetype in rpm_file_types): -+ if filetype != 'log': - for volume in files[filename]: - if suboptions.dirpertask: - new_filename = '%s/%s' % (task_id, filename) - else: -- if taskarch not in filename: -- part_filename = filename[:-len('.log')] -- new_filename = "%s.%s.log" % (part_filename, taskarch) -+ if taskarch not in filename and filetype != 'src.rpm': -+ part_filename = filename[:-len('.%s' % filetype)] -+ new_filename = "%s.%s.%s" % (part_filename, -+ taskarch, filetype) - else: - new_filename = filename - downloads.append((task, filename, volume, new_filename, task_id)) -+ elif task['method'] in build_methods_list: -+ if filetype in rpm_file_types: -+ filearch = filename.split(".")[-2] -+ for volume in files[filename]: -+ if len(suboptions.arches) == 0 or filearch in suboptions.arches: -+ if suboptions.dirpertask: -+ new_filename = '%s/%s' % (task_id, filename) -+ else: -+ new_filename = filename -+ downloads.append((task, filename, volume, new_filename, -+ task_id)) -+ -+ if filetype == 'log' and suboptions.logs: -+ for volume in files[filename]: -+ if suboptions.dirpertask: -+ new_filename = '%s/%s' % (task_id, filename) -+ else: -+ if taskarch not in filename: -+ part_filename = filename[:-len('.log')] -+ new_filename = "%s.%s.log" % (part_filename, taskarch) -+ else: -+ new_filename = filename -+ downloads.append((task, filename, volume, new_filename, task_id)) - - if len(downloads) == 0: - print("No files for download found.") -diff --git a/tests/test_cli/test_download_task.py b/tests/test_cli/test_download_task.py -index c35d4a6..3c455e3 100644 ---- a/tests/test_cli/test_download_task.py -+++ b/tests/test_cli/test_download_task.py -@@ -120,26 +120,29 @@ Default behavior without --all option downloads .rpm files only for build and bu - def test_handle_download_task_parent(self): - args = [str(self.parent_task_id), '--arch=noarch,x86_64'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}, -- {'id': 33333, -- 'method': 'buildArch', -- 'arch': 'x86_64', -- 'state': 2}, -- {'id': 44444, -- 'method': 'buildArch', -- 'arch': 's390', -- 'state': 2}, -- {'id': 55555, -- 'method': 'tagBuild', -- 'arch': 'noarch', -- 'state': 2} -- ] -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}, -+ {'id': 33333, -+ 'method': 'buildArch', -+ 'arch': 'x86_64', -+ 'state': 2}, -+ {'id': 44444, -+ 'method': 'buildArch', -+ 'arch': 's390', -+ 'state': 2}, -+ {'id': 55555, -+ 'method': 'tagBuild', -+ 'arch': 'noarch', -+ 'state': 2} -+ ] - self.list_task_output_all_volumes.side_effect = [ -+ {}, - {'somerpm.src.rpm': ['DEFAULT', 'vol1']}, - {'somerpm.x86_64.rpm': ['DEFAULT', 'vol2']}, -+ {'somerpm.s390.rpm': ['DEFAULT']}, - {'somerpm.noarch.rpm': ['vol3'], - 'somelog.log': ['DEFAULT', 'vol1']}, - ] -@@ -156,8 +159,10 @@ Default behavior without --all option downloads .rpm files only for build and bu - self.session.getTaskInfo.assert_called_once_with(self.parent_task_id) - self.session.getTaskChildren.assert_called_once_with(self.parent_task_id) - self.assertEqual(self.list_task_output_all_volumes.mock_calls, [ -+ call(self.session, 123333), - call(self.session, 22222), - call(self.session, 33333), -+ call(self.session, 44444), - call(self.session, 55555)]) - self.assertListEqual(self.download_file.mock_calls, [ - call('https://topurl/work/tasks/3333/33333/somerpm.x86_64.rpm', -@@ -169,10 +174,11 @@ Default behavior without --all option downloads .rpm files only for build and bu - def test_handle_download_task_log(self): - args = [str(self.parent_task_id), '--log'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}] -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}] - self.list_task_output_all_volumes.side_effect = [{}, { - 'somerpm.src.rpm': ['DEFAULT', 'vol1'], - 'somerpm.x86_64.rpm': ['DEFAULT', 'vol2'], -@@ -229,15 +235,17 @@ Default behavior without --all option downloads .rpm files only for build and bu - self.ensure_connection.assert_called_once_with(self.session, self.options) - self.session.getTaskInfo.assert_called_once_with(self.parent_task_id) - self.session.getTaskChildren.assert_called_once_with(self.parent_task_id) -- self.list_task_output_all_volumes.assert_not_called() -+ self.list_task_output_all_volumes.assert_called_once_with( -+ self.session, self.parent_task_id) - self.download_file.assert_not_called() - - def test_handle_download_parent_not_finished(self): - args = [str(self.parent_task_id)] -- self.session.getTaskInfo.return_value = {'id': self.parent_task_id, -- 'method': 'buildArch', -- 'arch': 'taskarch', -- 'state': 3} -+ self.session.getTaskInfo.return_value = { -+ 'id': self.parent_task_id, -+ 'method': 'buildArch', -+ 'arch': 'taskarch', -+ 'state': 3} - self.list_task_output_all_volumes.return_value = { - 'somerpm.src.rpm': ['DEFAULT', 'vol1'], - 'somerpm.x86_64.rpm': ['DEFAULT', 'vol2'], -@@ -265,10 +273,11 @@ Default behavior without --all option downloads .rpm files only for build and bu - def test_handle_download_child_not_finished(self): - args = [str(self.parent_task_id)] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 3}] -+ self.session.getTaskChildren.return_value = [{ -+ 'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 3}] - self.list_task_output_all_volumes.side_effect = [ - {'somerpm.src.rpm': ['DEFAULT', 'vol1']}, - {'somenextrpm.src.rpm': ['DEFAULT', 'vol1']}] -@@ -374,26 +383,29 @@ Options: - def test_handle_download_task_parent_dirpertask(self): - args = [str(self.parent_task_id), '--arch=noarch,x86_64', '--dirpertask', '--log'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}, -- {'id': 33333, -- 'method': 'buildArch', -- 'arch': 'x86_64', -- 'state': 2}, -- {'id': 44444, -- 'method': 'buildArch', -- 'arch': 's390', -- 'state': 2}, -- {'id': 55555, -- 'method': 'tagBuild', -- 'arch': 'noarch', -- 'state': 2} -- ] -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}, -+ {'id': 33333, -+ 'method': 'buildArch', -+ 'arch': 'x86_64', -+ 'state': 2}, -+ {'id': 44444, -+ 'method': 'buildArch', -+ 'arch': 's390', -+ 'state': 2}, -+ {'id': 55555, -+ 'method': 'tagBuild', -+ 'arch': 'noarch', -+ 'state': 2} -+ ] - self.list_task_output_all_volumes.side_effect = [ -+ {}, - {'somerpm.src.rpm': ['DEFAULT', 'vol1'], 'somerpm.noarch.rpm': ['DEFAULT']}, - {'somerpm.x86_64.rpm': ['DEFAULT', 'vol2']}, -+ {'somerpm.s390.rpm': ['DEFAULT']}, - {'somerpm.noarch.rpm': ['vol3'], - 'somelog.log': ['DEFAULT', 'vol1']}, - ] -@@ -410,8 +422,10 @@ Options: - self.session.getTaskInfo.assert_called_once_with(self.parent_task_id) - self.session.getTaskChildren.assert_called_once_with(self.parent_task_id) - self.assertEqual(self.list_task_output_all_volumes.mock_calls, [ -+ call(self.session, 123333), - call(self.session, 22222), - call(self.session, 33333), -+ call(self.session, 44444), - call(self.session, 55555)]) - self.assertListEqual(self.download_file.mock_calls, [ - call('https://topurl/work/tasks/2222/22222/somerpm.noarch.rpm', -@@ -430,26 +444,29 @@ Options: - def test_handle_download_task_parent_all(self): - args = [str(self.parent_task_id), '--arch=noarch,x86_64', '--all'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}, -- {'id': 33333, -- 'method': 'buildArch', -- 'arch': 'x86_64', -- 'state': 2}, -- {'id': 44444, -- 'method': 'buildArch', -- 'arch': 's390', -- 'state': 2}, -- {'id': 55555, -- 'method': 'tagBuild', -- 'arch': 'noarch', -- 'state': 2} -- ] -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}, -+ {'id': 33333, -+ 'method': 'buildArch', -+ 'arch': 'x86_64', -+ 'state': 2}, -+ {'id': 44444, -+ 'method': 'buildArch', -+ 'arch': 's390', -+ 'state': 2}, -+ {'id': 55555, -+ 'method': 'tagBuild', -+ 'arch': 'noarch', -+ 'state': 2} -+ ] - self.list_task_output_all_volumes.side_effect = [ -+ {}, - {'somerpm.src.rpm': ['DEFAULT', 'vol1']}, - {'somerpm.json': ['DEFAULT', 'vol2']}, -+ {'somerpm.s390.rpm': ['DEFAULT']}, - {'somerpm.noarch.rpm': ['vol3'], - 'somelog.log': ['DEFAULT', 'vol1']}, - ] -@@ -466,8 +483,10 @@ Options: - self.session.getTaskInfo.assert_called_once_with(self.parent_task_id) - self.session.getTaskChildren.assert_called_once_with(self.parent_task_id) - self.assertEqual(self.list_task_output_all_volumes.mock_calls, [ -+ call(self.session, 123333), - call(self.session, 22222), - call(self.session, 33333), -+ call(self.session, 44444), - call(self.session, 55555)]) - self.assertListEqual(self.download_file.mock_calls, [ - call('https://topurl/work/tasks/3333/33333/somerpm.json', -@@ -504,23 +523,24 @@ Options: - def test_handle_download_task_parent_dirpertask_all(self): - args = [str(self.parent_task_id), '--dirpertask', '--all'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}, -- {'id': 33333, -- 'method': 'buildArch', -- 'arch': 'x86_64', -- 'state': 2}, -- {'id': 44444, -- 'method': 'buildArch', -- 'arch': 's390', -- 'state': 2}, -- {'id': 55555, -- 'method': 'tagBuild', -- 'arch': 'noarch', -- 'state': 2} -- ] -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}, -+ {'id': 33333, -+ 'method': 'buildArch', -+ 'arch': 'x86_64', -+ 'state': 2}, -+ {'id': 44444, -+ 'method': 'buildArch', -+ 'arch': 's390', -+ 'state': 2}, -+ {'id': 55555, -+ 'method': 'tagBuild', -+ 'arch': 'noarch', -+ 'state': 2} -+ ] - self.list_task_output_all_volumes.side_effect = [ - {}, - {'somerpm.src.rpm': ['DEFAULT', 'vol1'], 'somerpm.noarch.rpm': ['DEFAULT']}, -@@ -568,11 +588,12 @@ Options: - def test_handle_download_task_log_with_arch(self): - args = [str(self.parent_task_id), '--arch=noarch', '--log'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}] -- self.list_task_output_all_volumes.side_effect = [{ -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}] -+ self.list_task_output_all_volumes.side_effect = [{}, { - 'somerpm.src.rpm': ['DEFAULT', 'vol1'], - 'somerpm.x86_64.rpm': ['DEFAULT', 'vol2'], - 'somerpm.noarch.rpm': ['vol3'], -@@ -604,23 +625,24 @@ Options: - def test_handle_download_task_all_log(self): - args = [str(self.parent_task_id), '--all', '--log'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}, -- {'id': 33333, -- 'method': 'buildArch', -- 'arch': 'x86_64', -- 'state': 2}, -- {'id': 44444, -- 'method': 'buildArch', -- 'arch': 's390', -- 'state': 2}, -- {'id': 55555, -- 'method': 'tagBuild', -- 'arch': 'noarch', -- 'state': 2} -- ] -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}, -+ {'id': 33333, -+ 'method': 'buildArch', -+ 'arch': 'x86_64', -+ 'state': 2}, -+ {'id': 44444, -+ 'method': 'buildArch', -+ 'arch': 's390', -+ 'state': 2}, -+ {'id': 55555, -+ 'method': 'tagBuild', -+ 'arch': 'noarch', -+ 'state': 2} -+ ] - self.list_task_output_all_volumes.side_effect = [ - {}, - {'somerpm.src.rpm': ['DEFAULT', 'vol1'], 'somerpm.noarch.rpm': ['DEFAULT']}, -@@ -671,23 +693,24 @@ Options: - def test_handle_download_task_parent_dirpertask_all_conflict_names(self): - args = [str(self.parent_task_id), '--all'] - self.session.getTaskInfo.return_value = self.parent_task_info -- self.session.getTaskChildren.return_value = [{'id': 22222, -- 'method': 'buildArch', -- 'arch': 'noarch', -- 'state': 2}, -- {'id': 33333, -- 'method': 'buildArch', -- 'arch': 'x86_64', -- 'state': 2}, -- {'id': 44444, -- 'method': 'buildArch', -- 'arch': 's390', -- 'state': 2}, -- {'id': 55555, -- 'method': 'tagBuild', -- 'arch': 'noarch', -- 'state': 2} -- ] -+ self.session.getTaskChildren.return_value = [ -+ {'id': 22222, -+ 'method': 'buildArch', -+ 'arch': 'noarch', -+ 'state': 2}, -+ {'id': 33333, -+ 'method': 'buildArch', -+ 'arch': 'x86_64', -+ 'state': 2}, -+ {'id': 44444, -+ 'method': 'buildArch', -+ 'arch': 's390', -+ 'state': 2}, -+ {'id': 55555, -+ 'method': 'tagBuild', -+ 'arch': 'noarch', -+ 'state': 2} -+ ] - self.list_task_output_all_volumes.side_effect = [ - {}, - {'somerpm.src.rpm': ['DEFAULT', 'vol1'], 'somerpm.noarch.rpm': ['DEFAULT']}, - diff --git a/koji.spec b/koji.spec index 6555819..7e08a4f 100644 --- a/koji.spec +++ b/koji.spec @@ -8,23 +8,14 @@ %{?!python3_pkgversion:%global python3_pkgversion 3} Name: koji -Version: 1.29.1 -Release: 4%{?dist} +Version: 1.30.0 +Release: 1%{?dist} # the included arch lib from yum's rpmUtils is GPLv2+ License: LGPLv2 and GPLv2+ Summary: Build system tools URL: https://pagure.io/koji/ Source0: https://releases.pagure.org/koji/koji-%{version}.tar.bz2 -# https://pagure.io/koji/pull-request/3445 -# Don't crash on image build failure path if an imagefactory thing -# isn't there -Patch0: 0001-Don-t-crash-in-_checkImageState-if-there-s-no-image..patch -# https://bugzilla.redhat.com/show_bug.cgi?id=2116674 -# https://pagure.io/koji/pull-request/3459 -# Fix arch filtering in `koji download-task` -Patch1: 3459.patch - # Not upstreamable Patch100: fedora-config.patch @@ -356,6 +347,9 @@ done %systemd_postun kojira.service %changelog +* Mon Aug 29 2022 Kevin Fenzi - 1.30.0-1 +- Update to 1.30.0. Fixes rhbz#2122127 + * Wed Aug 10 2022 Adam Williamson - 1.29.1-4 - Replace PR #3458 with PR #3459 (preferred by upstream) diff --git a/sources b/sources index 2ed3911..e19cc68 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (koji-1.29.1.tar.bz2) = 4822149f6ff80d7a153f02e9ca3e9e4f56652e944b932d13fd76dfe2fc703890a92c8edc835216dee0a313bad60a0468f66418ae60e703eda3a6f14d0e9f83c1 +SHA512 (koji-1.30.0.tar.bz2) = e428ed743415798dc0234c4eb1c6b231c53a87e456ae3c068e079fad28021c2e72b885e477547b252649d37c5a04b877b02e5c5cf2747f8b901a5bae12bc7def