From 06953ffba112262e50f19c4bbd24f958fe182ed7 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Dec 03 2018 20:33:31 +0000 Subject: PR#1180: Update source when recycling build Merges #1180 https://pagure.io/koji/pull-request/1180 Fixes: #1179 https://pagure.io/koji/issue/1179 Stale source field of recycled builds --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 3207b79..ce18787 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -5180,7 +5180,9 @@ def recycle_build(old, data): data['id'] = old['id'] update = UpdateProcessor('build', clauses=['id=%(id)s'], values=data) - update.set(**dslice(data, ['state', 'task_id', 'owner', 'start_time', 'completion_time', 'epoch'])) + update.set(**dslice(data, + ['state', 'task_id', 'owner', 'start_time', 'completion_time', + 'epoch', 'source', 'extra', 'volume_id'])) update.rawset(create_event='get_event()') update.execute() builddir = koji.pathinfo.build(data) diff --git a/tests/test_hub/test_recycle_build.py b/tests/test_hub/test_recycle_build.py index d5b81c4..e2674d0 100644 --- a/tests/test_hub/test_recycle_build.py +++ b/tests/test_hub/test_recycle_build.py @@ -41,6 +41,8 @@ class TestRecycleBuild(): 'package_name': 'GConf2', 'release': '15.fc23', 'version': '3.2.6', + 'source': None, + 'extra': None, 'volume_id': 0, 'volume_name': 'DEFAULT'} new = {'state': 0, @@ -51,7 +53,10 @@ class TestRecycleBuild(): 'nvr': 'GConf2-3.2.6-15.fc23', 'completion_time': '2016-09-16', 'start_time': '2016-09-16', - 'owner': 2} + 'owner': 2, + 'source': None, + 'extra': None, + 'volume_id': 0} def test_recycle_building(self): new = self.new.copy()