From e82102b0bfcb4834e9cbf834eef67910c69c9882 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Sat, 2 Oct 2021 11:35:26 +0200 Subject: [PATCH 01/10] Correct tagging builds when editing side-tag update Signed-off-by: Mattia Verga --- bodhi/server/models.py | 16 ++++++++++------ news/PR4161.bug | 1 + 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 news/PR4161.bug diff --git a/bodhi/server/models.py b/bodhi/server/models.py index 96c133756f..802490d4ae 100644 --- a/bodhi/server/models.py +++ b/bodhi/server/models.py @@ -2540,30 +2540,34 @@ def edit(cls, request, data): data['karma_critipath'] = 0 up.date_testing = None - # Remove all koji tags and change the status back to pending - if up.status is not UpdateStatus.pending: + if up.status != UpdateStatus.pending: + # Remove all koji tags and change the status back to pending up.unpush(db) caveats.append({ 'name': 'status', 'description': 'Builds changed. Your update is being ' 'sent back to testing.', }) + builds_to_tag = [b.nvr for b in up.builds] + else: + # No need to unpush the update, just tag new builds + builds_to_tag = new_builds - # Add the pending_signing_tag to all new builds + # Add the pending_signing_tag to builds where needed tag = None - if up.from_tag: + if up.from_tag and not up.release.composed_by_bodhi: tag = up.release.get_pending_signing_side_tag(up.from_tag) elif up.release.pending_signing_tag: tag = up.release.pending_signing_tag if tag is not None: - tag_update_builds_task.delay(tag=tag, builds=new_builds) + tag_update_builds_task.delay(tag=tag, builds=builds_to_tag) new_bugs = up.update_bugs(data['bugs'], db) del(data['bugs']) req = data.pop("request", None) - if req is not None and not data.get("from_tag"): + if req is not None and up.release.composed_by_bodhi: up.set_request(db, req, request.user.name) for key, value in data.items(): diff --git a/news/PR4161.bug b/news/PR4161.bug new file mode 100644 index 0000000000..376bde56eb --- /dev/null +++ b/news/PR4161.bug @@ -0,0 +1 @@ +Fix an issue that caused the builds in a side-tag update to not be tagged correctly when the build list of the update was modified From 4264c41c3f6080ab4a05bc6a3c89a976f6f720d6 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Sun, 3 Oct 2021 16:04:39 +0200 Subject: [PATCH 02/10] Do not hardcode Bugzilla URL in bug links Signed-off-by: Mattia Verga --- bodhi/server/util.py | 5 ++--- news/4238.bug | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 news/4238.bug diff --git a/bodhi/server/util.py b/bodhi/server/util.py index 515aeb5e82..e294034c4e 100644 --- a/bodhi/server/util.py +++ b/bodhi/server/util.py @@ -630,9 +630,8 @@ def bug_link(context, bug, short=False): Returns: str: The requested link. """ - url = "https://bugzilla.redhat.com/show_bug.cgi?id=" + str(bug.bug_id) - display = "BZ#%i" % bug.bug_id - link = "%s" % (url, display) + url = config.get('buglink') % str(bug.bug_id) + link = f"BZ#{bug.bug_id}" if not short: if bug.title: # We're good, but we do need to clean the bug title in case it contains malicious diff --git a/news/4238.bug b/news/4238.bug new file mode 100644 index 0000000000..5381209528 --- /dev/null +++ b/news/4238.bug @@ -0,0 +1 @@ +Staging Bodhi now uses staging Bugzilla URL for bug links From e6700c2856c7a2c2fee04a1003d875fe80af7571 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Thu, 14 Oct 2021 19:18:16 +0200 Subject: [PATCH 03/10] Remove cGroupsV1 tweak for vagrant machine Signed-off-by: Mattia Verga --- devel/ansible/roles/bodhi/tasks/main.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/devel/ansible/roles/bodhi/tasks/main.yml b/devel/ansible/roles/bodhi/tasks/main.yml index f4382edf3b..a66df842f0 100644 --- a/devel/ansible/roles/bodhi/tasks/main.yml +++ b/devel/ansible/roles/bodhi/tasks/main.yml @@ -69,13 +69,6 @@ - zlib-devel state: present - -- name: Configure Cgroups v1 for docker in grub.cfg - command: sed -i '/^GRUB_CMDLINE_LINUX/ s/"$/ systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub - -- name: Generate the new grub configuration with cgroups v1 - command: grub2-mkconfig -o /boot/grub2/grub.cfg - - name: Initialize PostgreSQL command: postgresql-setup initdb args: From 15ac8ae098badf67d9acd014543f5d3eb8ac2aa6 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Sat, 16 Oct 2021 16:35:43 +0200 Subject: [PATCH 04/10] Do not override existing request when editing an update Signed-off-by: Mattia Verga --- bodhi/server/models.py | 5 +++-- news/4263.bug | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 news/4263.bug diff --git a/bodhi/server/models.py b/bodhi/server/models.py index 96c133756f..97641d8dbd 100644 --- a/bodhi/server/models.py +++ b/bodhi/server/models.py @@ -2452,6 +2452,8 @@ def edit(cls, request, data): buildinfo = request.buildinfo up = db.query(Update).filter_by(alias=data['edited']).first() del(data['edited']) + data.pop("request", None) + req = None caveats = [] edited_builds = [build.nvr for build in up.builds] @@ -2534,7 +2536,7 @@ def edit(cls, request, data): # Updates with new or removed builds always go back to testing if new_builds or removed_builds: - data['request'] = UpdateRequest.testing + req = UpdateRequest.testing # And, updates with new or removed builds always get their karma reset. # https://github.com/fedora-infra/bodhi/issues/511 data['karma_critipath'] = 0 @@ -2562,7 +2564,6 @@ def edit(cls, request, data): new_bugs = up.update_bugs(data['bugs'], db) del(data['bugs']) - req = data.pop("request", None) if req is not None and not data.get("from_tag"): up.set_request(db, req, request.user.name) diff --git a/news/4263.bug b/news/4263.bug new file mode 100644 index 0000000000..ce99df26c1 --- /dev/null +++ b/news/4263.bug @@ -0,0 +1 @@ +Fixed an issue where editing Updates always caused to set the request to Testing From b933a0790bdd9cfee1313ba40ccfc64667fc6f05 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 15 Oct 2021 09:48:06 -0700 Subject: [PATCH 05/10] Greenwave: query both contexts for critpath updates (#4259) As discussed in #4259 and also reported in https://pagure.io/fedora-ci/general/issue/263 , my previous change to have Bodhi query on a different Greenwave 'decision context' for critical path updates - allowing us to gate critpath updates on openQA test results - caused a problem with package-specific gating policies. The instructions and examples for writing these only include the original decision contexts (bodhi_update_push_testing and bodhi_update_push_stable), they do not also recommend including the _critpath contexts, and this is indeed how all real-world package-specific policies have been written. This has resulted in package-specific policies being effectively ignored when the package in question is a part of a critical path update, because Bodhi is querying on the _critpath context but the package-specific policy doesn't include it. To avoid this problem, this change makes Bodhi query greenwave on *both* relevant contexts for critical path updates. The logic for parsing the results doesn't need to change because we were already coping with multiple queries for the case where an update has too many subjects for a single query. This does change the behaviour of one method - Update.get_test_gating_info() - and one API endpoint - /updates/{id}/get-test-results . These now both return lists of Greenwave decision dicts, rather than a single Greenwave decision dict. There's no way I can see to maintain behaviour here, and the existing behaviour was already wrong for updates with lots of packages (this method and endpoint should have been adjusted when we initially implemented batched requests for such updates, but they were missed). I don't think the method or the endpoint were commonly used. Signed-off-by: Adam Williamson --- bodhi/server/models.py | 34 +- bodhi/server/services/updates.py | 8 +- bodhi/tests/server/services/test_updates.py | 38 +- .../tests/server/tasks/test_check_policies.py | 531 +++++++++++------- bodhi/tests/server/test_models.py | 46 ++ news/4259.bic | 1 + 6 files changed, 406 insertions(+), 252 deletions(-) create mode 100644 news/4259.bic diff --git a/bodhi/server/models.py b/bodhi/server/models.py index 96c133756f..24c0171bf8 100644 --- a/bodhi/server/models.py +++ b/bodhi/server/models.py @@ -2150,12 +2150,13 @@ def greenwave_request_batches(self, verbose): subjects = self.greenwave_subject data = [] while count < len(subjects): - data.append({ - 'product_version': self.product_version, - 'decision_context': self._greenwave_decision_context, - 'subject': subjects[count:count + batch_size], - 'verbose': verbose, - }) + for context in self._greenwave_decision_contexts: + data.append({ + 'product_version': self.product_version, + 'decision_context': context, + 'subject': subjects[count:count + batch_size], + 'verbose': verbose, + }) count += batch_size return data @@ -2183,37 +2184,32 @@ def _greenwave_api_url(self): return '{}/decision'.format(config.get('greenwave_api_url')) @property - def _greenwave_decision_context(self): + def _greenwave_decision_contexts(self): # We retrieve updates going to testing (status=pending) and updates # (status=testing) going to stable. # We also query on different contexts for critpath and non-critpath # updates. # this is correct if update is already in testing... - context = "bodhi_update_push_stable" + contexts = ["bodhi_update_push_stable"] if self.request == UpdateRequest.testing and self.status == UpdateStatus.pending: # ...but if it is pending, we want to know if it can go to testing - context = "bodhi_update_push_testing" + contexts = ["bodhi_update_push_testing"] if self.critpath: - context = context + "_critpath" - return context + contexts.insert(0, contexts[0] + "_critpath") + return contexts def get_test_gating_info(self): """ Query Greenwave about this update and return the information retrieved. Returns: - dict: The response from Greenwave for this update. + list: A list of response dicts from Greenwave for this update. Raises: BodhiException: When the ``greenwave_api_url`` is undefined in configuration. RuntimeError: If Greenwave did not give us a 200 code. """ - data = { - 'product_version': self.product_version, - 'decision_context': self._greenwave_decision_context, - 'subject': self.greenwave_subject, - 'verbose': True, - } - return util.greenwave_api_post(self._greenwave_api_url, data) + return [util.greenwave_api_post(self._greenwave_api_url, data) + for data in self.greenwave_request_batches(verbose=True)] @property def _greenwave_requirements_generator(self): diff --git a/bodhi/server/services/updates.py b/bodhi/server/services/updates.py index e0e857c06c..7e96a398fd 100644 --- a/bodhi/server/services/updates.py +++ b/bodhi/server/services/updates.py @@ -698,13 +698,13 @@ def get_test_results(request): Args: request (pyramid.request): The current request. Returns: - dict: A dictionary mapping the key "update" to the update. + dict: A dictionary mapping the key 'decisions' to a list of result dictionaries. """ update = request.validated['update'] - decision = None + decisions = [] try: - decision = update.get_test_gating_info() + decisions = update.get_test_gating_info() except RequestsTimeout as e: log.error("Error querying greenwave for test results - timed out") request.errors.add('body', 'request', str(e)) @@ -722,7 +722,7 @@ def get_test_results(request): request.errors.add('body', 'request', str(e)) request.errors.status = 500 - return dict(decision=decision) + return dict(decisions=decisions) @update_trigger_tests.post(schema=bodhi.server.schemas.TriggerTestsSchema, diff --git a/bodhi/tests/server/services/test_updates.py b/bodhi/tests/server/services/test_updates.py index cba032cabb..56a5a7f6f8 100644 --- a/bodhi/tests/server/services/test_updates.py +++ b/bodhi/tests/server/services/test_updates.py @@ -6449,7 +6449,7 @@ def test_get_test_results_calling_greenwave(self, call_api, *args): service_name='Greenwave' ) - assert res.json_body == {'decision': {'foo': 'bar'}} + assert res.json_body == {'decisions': [{'foo': 'bar'}]} @mock.patch.dict(config, [('greenwave_api_url', 'https://greenwave.api')]) @mock.patch('bodhi.server.util.call_api') @@ -6464,23 +6464,25 @@ def test_get_test_results_calling_greenwave_critpath(self, call_api, *args): res = self.app.get(f'/updates/{update.alias}/get-test-results') - call_api.assert_called_once_with( - 'https://greenwave.api/decision', - data={ - 'product_version': 'fedora-17', - 'decision_context': 'bodhi_update_push_testing_critpath', - 'subject': [ - {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - {'item': update.alias, 'type': 'bodhi_update'} - ], - 'verbose': True, - }, - method='POST', - retries=3, - service_name='Greenwave' - ) + assert call_api.call_args_list == [ + mock.call( + 'https://greenwave.api/decision', + data={ + 'product_version': 'fedora-17', + 'decision_context': context, + 'subject': [ + {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, + {'item': update.alias, 'type': 'bodhi_update'} + ], + 'verbose': True, + }, + method='POST', + retries=3, + service_name='Greenwave' + ) for context in ('bodhi_update_push_testing_critpath', 'bodhi_update_push_testing') + ] - assert res.json_body == {'decision': {'foo': 'bar'}} + assert res.json_body == {'decisions': [{'foo': 'bar'}, {'foo': 'bar'}]} @mock.patch('bodhi.server.util.call_api') def test_get_test_results_calling_greenwave_no_session(self, call_api, *args): @@ -6513,7 +6515,7 @@ def test_get_test_results_calling_greenwave_no_session(self, call_api, *args): service_name='Greenwave' ) - assert res.json_body == {'decision': {'foo': 'bar'}} + assert res.json_body == {'decisions': [{'foo': 'bar'}]} @mock.patch('bodhi.server.util.call_api') def test_get_test_results_calling_greenwave_unauth(self, call_api, *args): diff --git a/bodhi/tests/server/tasks/test_check_policies.py b/bodhi/tests/server/tasks/test_check_policies.py index 3abb7d00b0..ee0d11c936 100644 --- a/bodhi/tests/server/tasks/test_check_policies.py +++ b/bodhi/tests/server/tasks/test_check_policies.py @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """This module contains tests for the bodhi.server.tasks.check_policies module.""" -from unittest.mock import patch +from unittest.mock import patch, call import datetime from bodhi.server import models @@ -58,40 +58,57 @@ def test_policies_satisfied(self): self.db.info['messages'] = [] self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: - greenwave_response = { - 'policies_satisfied': True, - 'summary': 'All required tests passed', - 'applicable_policies': [ - 'kojibuild_bodhipush_no_requirements', - 'kojibuild_bodhipush_remoterule', - 'bodhiupdate_bodhipush_no_requirements', - 'bodhiupdate_bodhipush_openqa' - ], - 'satisfied_requirements': [ - { - 'result_id': 39603316, - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-passed' - }, - ], - 'unsatisfied_requirements': [] - } - mock_greenwave.return_value = greenwave_response + greenwave_responses = [ + { + 'policies_satisfied': True, + 'summary': 'All required tests passed', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [ + { + 'result_id': 39603316, + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-passed' + }, + ], + 'unsatisfied_requirements': [] + }, + { + 'policies_satisfied': True, + 'summary': 'no tests are required', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [], + } + ] + mock_greenwave.side_effect = greenwave_responses check_policies_main() update = self.db.query(models.Update).filter(models.Update.id == update.id).one() assert update.test_gating_status == models.TestGatingStatus.passed - expected_query = { - 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', - 'subject': [ - {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update'}], - 'verbose': False - } - mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', - expected_query) + expected_queries = [ + { + 'product_version': 'fedora-17', 'decision_context': context, + 'subject': [ + {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, + {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update'}], + 'verbose': False + } for context in ('bodhi_update_push_stable_critpath', 'bodhi_update_push_stable') + ] + expected_calls = [ + call(config['greenwave_api_url'] + '/decision', query) for query in expected_queries + ] + assert mock_greenwave.call_args_list == expected_calls @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) def test_policies_pending_satisfied(self): @@ -102,41 +119,58 @@ def test_policies_pending_satisfied(self): update.critpath = True self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: - greenwave_response = { - 'policies_satisfied': True, - 'summary': 'All required tests passed', - 'applicable_policies': [ - 'kojibuild_bodhipush_no_requirements', - 'kojibuild_bodhipush_remoterule', - 'bodhiupdate_bodhipush_no_requirements', - 'bodhiupdate_bodhipush_openqa' - ], - 'satisfied_requirements': [ - { - 'result_id': 39603316, - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-passed' - }, - ], - 'unsatisfied_requirements': [] - } - mock_greenwave.return_value = greenwave_response + greenwave_responses = [ + { + 'policies_satisfied': True, + 'summary': 'All required tests passed', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [ + { + 'result_id': 39603316, + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-passed' + }, + ], + 'unsatisfied_requirements': [] + }, + { + 'policies_satisfied': True, + 'summary': 'no tests are required', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [], + } + ] + mock_greenwave.side_effect = greenwave_responses check_policies_main() update = self.db.query(models.Update).filter(models.Update.id == update.id).one() assert update.test_gating_status == models.TestGatingStatus.passed - expected_query = { - 'product_version': 'fedora-17', - 'decision_context': 'bodhi_update_push_testing_critpath', - 'subject': [ - {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update'}], - 'verbose': False, - } - mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', - expected_query) + expected_queries = [ + { + 'product_version': 'fedora-17', + 'decision_context': context, + 'subject': [ + {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, + {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update'}], + 'verbose': False, + } for context in ('bodhi_update_push_testing_critpath', 'bodhi_update_push_testing') + ] + expected_calls = [ + call(config['greenwave_api_url'] + '/decision', query) for query in expected_queries + ] + assert mock_greenwave.call_args_list == expected_calls @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) def test_policies_unsatisfied_waiting(self): @@ -152,40 +186,54 @@ def test_policies_unsatisfied_waiting(self): update.date_submitted = datetime.datetime.utcnow() self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: - greenwave_response = { - 'policies_satisfied': False, - 'summary': '2 of 2 required test results missing', - 'applicable_policies': [ - 'kojibuild_bodhipush_no_requirements', - 'kojibuild_bodhipush_remoterule', - 'bodhiupdate_bodhipush_no_requirements', - 'bodhiupdate_bodhipush_openqa' - ], - 'satisfied_requirements': [], - 'unsatisfied_requirements': [ - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + item = 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year) + greenwave_responses = [ + { + 'policies_satisfied': False, + 'summary': '2 of 2 required test results missing', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [ + { + 'item': { + 'item': item, + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-missing' - }, - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + { + 'item': { + 'item': item, + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-missing' - }, - ] - } - mock_greenwave.return_value = greenwave_response + ] + }, + { + 'policies_satisfied': True, + 'summary': 'no tests are required', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [], + } + ] + mock_greenwave.side_effect = greenwave_responses check_policies_main() update = self.db.query(models.Update).filter(models.Update.id == update.id).one() assert update.test_gating_status == models.TestGatingStatus.waiting @@ -193,16 +241,20 @@ def test_policies_unsatisfied_waiting(self): expected_comment = "This update's test gating status has been changed to 'waiting'." assert update.comments[-1].text == expected_comment - expected_query = { - 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', - 'subject': [ - {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update'}], - 'verbose': False - } - mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', - expected_query) + expected_queries = [ + { + 'product_version': 'fedora-17', 'decision_context': context, + 'subject': [ + {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, + {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update'}], + 'verbose': False + } for context in ('bodhi_update_push_stable_critpath', 'bodhi_update_push_stable') + ] + expected_calls = [ + call(config['greenwave_api_url'] + '/decision', query) for query in expected_queries + ] + assert mock_greenwave.call_args_list == expected_calls @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) def test_policies_unsatisfied_waiting_too_long(self): @@ -218,40 +270,54 @@ def test_policies_unsatisfied_waiting_too_long(self): update.date_submitted = datetime.datetime.utcnow() - datetime.timedelta(days=1) self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: - greenwave_response = { - 'policies_satisfied': False, - 'summary': '2 of 2 required test results missing', - 'applicable_policies': [ - 'kojibuild_bodhipush_no_requirements', - 'kojibuild_bodhipush_remoterule', - 'bodhiupdate_bodhipush_no_requirements', - 'bodhiupdate_bodhipush_openqa' - ], - 'satisfied_requirements': [], - 'unsatisfied_requirements': [ - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + item = 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year) + greenwave_responses = [ + { + 'policies_satisfied': False, + 'summary': '2 of 2 required test results missing', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [ + { + 'item': { + 'item': item, + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-missing' - }, - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + { + 'item': { + 'item': item, + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-missing' - }, - ] - } - mock_greenwave.return_value = greenwave_response + ] + }, + { + 'policies_satisfied': True, + 'summary': 'no tests are required', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [], + } + ] + mock_greenwave.side_effect = greenwave_responses check_policies_main() update = self.db.query(models.Update).filter(models.Update.id == update.id).one() assert update.test_gating_status == models.TestGatingStatus.failed @@ -267,13 +333,20 @@ def test_policies_unsatisfied_waiting_too_long(self): 'type': 'bodhi_update'}], 'verbose': False } + # we only expect *one* call here because the *first* query + # (on the _critpath context) should be enough to conclude the + # status is failed: it would be wrong to needlessly run the + # second query. note the mock responses are in the order we + # expect the queries to be run, critpath first mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', expected_query) @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) def test_policies_unsatisfied_failed(self): """Assert correct behavior when the policies enforced by Greenwave are unsatisfied: - failed tests always means failed status. + failed tests always means failed status. This also tests that we behave correctly + even if the *first* query shows requirements satisfied, but the *second* query has + failed required tests. """ update = self.db.query(models.Update).all()[0] update.status = models.UpdateStatus.testing @@ -283,40 +356,56 @@ def test_policies_unsatisfied_failed(self): self.db.info['messages'] = [] self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: - greenwave_response = { - 'policies_satisfied': False, - 'summary': '1 of 2 required tests failed, 1 result missing', - 'applicable_policies': [ - 'kojibuild_bodhipush_no_requirements', - 'kojibuild_bodhipush_remoterule', - 'bodhiupdate_bodhipush_no_requirements', - 'bodhiupdate_bodhipush_openqa' - ], - 'satisfied_requirements': [], - 'unsatisfied_requirements': [ - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + # here, we're mocking the scenario from + # https://pagure.io/fedora-ci/general/issue/263 , where + # openQA tests passed, but a package in the update had a + # local gating config that only specified the context + # bodhi_update_push_stable (not _push_stable_critpath), + # and a test specified in that local policy failed + greenwave_responses = [ + { + 'policies_satisfied': True, + 'summary': 'All required tests passed', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [ + { + 'result_id': 39603316, + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-passed' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-failed' - }, - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + ], + 'unsatisfied_requirements': [] + }, + { + 'policies_satisfied': False, + 'summary': '1 of 1 required tests failed', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [ + { + 'item': { + 'item': 'bodhi-2.0-1.fc17', + 'type': 'koji_build' + }, + 'scenario': None, + 'subject_type': 'koji_build', + 'testcase': 'fedora-ci.koji-build.tier0.functional', + 'type': 'test-result-failed' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-missing' - }, - ] - } - mock_greenwave.return_value = greenwave_response + ], + } + ] + mock_greenwave.side_effect = greenwave_responses check_policies_main() update = self.db.query(models.Update).filter(models.Update.id == update.id).one() assert update.test_gating_status == models.TestGatingStatus.failed @@ -324,16 +413,20 @@ def test_policies_unsatisfied_failed(self): expected_comment = "This update's test gating status has been changed to 'failed'." assert update.comments[-1].text == expected_comment - expected_query = { - 'product_version': 'fedora-17', 'decision_context': 'bodhi_update_push_stable_critpath', - 'subject': [ - {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, - {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update'}], - 'verbose': False - } - mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', - expected_query) + expected_queries = [ + { + 'product_version': 'fedora-17', 'decision_context': context, + 'subject': [ + {'item': 'bodhi-2.0-1.fc17', 'type': 'koji_build'}, + {'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), + 'type': 'bodhi_update'}], + 'verbose': False + } for context in ('bodhi_update_push_stable_critpath', 'bodhi_update_push_stable') + ] + expected_calls = [ + call(config['greenwave_api_url'] + '/decision', query) for query in expected_queries + ] + assert mock_greenwave.call_args_list == expected_calls @patch.dict(config, [('greenwave_api_url', 'http://domain.local')]) def test_no_policies_enforced(self): @@ -378,40 +471,54 @@ def test_pushed_update(self): update.pushed = True self.db.commit() with patch('bodhi.server.models.util.greenwave_api_post') as mock_greenwave: - greenwave_response = { - 'policies_satisfied': False, - 'summary': '1 of 2 required tests failed, 1 result missing', - 'applicable_policies': [ - 'kojibuild_bodhipush_no_requirements', - 'kojibuild_bodhipush_remoterule', - 'bodhiupdate_bodhipush_no_requirements', - 'bodhiupdate_bodhipush_openqa' - ], - 'satisfied_requirements': [], - 'unsatisfied_requirements': [ - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + item = 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year) + greenwave_responses = [ + { + 'policies_satisfied': False, + 'summary': '1 of 2 required tests failed, 1 result missing', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements', + 'bodhiupdate_bodhipush_openqa' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [ + { + 'item': { + 'item': item, + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-failed' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.64bit', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-failed' - }, - { - 'item': { - 'item': 'FEDORA-{}-a3bbe1a8f2'.format(datetime.datetime.utcnow().year), - 'type': 'bodhi_update' + { + 'item': { + 'item': item, + 'type': 'bodhi_update' + }, + 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', + 'subject_type': 'bodhi_update', + 'testcase': 'update.install_default_update_netinst', + 'type': 'test-result-missing' }, - 'scenario': 'fedora.updates-everything-boot-iso.x86_64.uefi', - 'subject_type': 'bodhi_update', - 'testcase': 'update.install_default_update_netinst', - 'type': 'test-result-missing' - }, - ] - } - mock_greenwave.return_value = greenwave_response + ] + }, + { + 'policies_satisfied': True, + 'summary': 'no tests are required', + 'applicable_policies': [ + 'kojibuild_bodhipush_no_requirements', + 'kojibuild_bodhipush_remoterule', + 'bodhiupdate_bodhipush_no_requirements' + ], + 'satisfied_requirements': [], + 'unsatisfied_requirements': [], + } + ] + mock_greenwave.side_effect = greenwave_responses check_policies_main() @@ -424,6 +531,8 @@ def test_pushed_update(self): 'type': 'bodhi_update'}], 'verbose': False } + # we only expect *one* call here, as with the earlier + # 'failed' test mock_greenwave.assert_called_once_with(config['greenwave_api_url'] + '/decision', expected_query) # Check for the comment diff --git a/bodhi/tests/server/test_models.py b/bodhi/tests/server/test_models.py index 1cf5b9ca10..095b49dde5 100644 --- a/bodhi/tests/server/test_models.py +++ b/bodhi/tests/server/test_models.py @@ -2992,6 +2992,52 @@ def test_greenwave_request_batches_multiple(self): ] ) + def test_greenwave_request_batches_multiple_critpath(self): + """ + Ensure that the greenwave_request_batches property returns the correct value + for critpath update with multiple batches. + """ + with mock.patch.dict('bodhi.server.models.config', {'greenwave_batch_size': 1}): + self.obj.critpath = True + assert self.obj.greenwave_subject_batch_size == 1 + assert self.obj.greenwave_request_batches(verbose=True) == ( + [ + { + 'product_version': 'fedora-11', + 'decision_context': 'bodhi_update_push_testing_critpath', + 'verbose': True, + 'subject': [ + {'item': 'TurboGears-1.0.8-3.fc11', 'type': 'koji_build'}, + ] + }, + { + 'product_version': 'fedora-11', + 'decision_context': 'bodhi_update_push_testing', + 'verbose': True, + 'subject': [ + {'item': 'TurboGears-1.0.8-3.fc11', 'type': 'koji_build'}, + ] + }, + { + 'product_version': 'fedora-11', + 'decision_context': 'bodhi_update_push_testing_critpath', + 'verbose': True, + 'subject': [ + {'item': self.obj.alias, 'type': 'bodhi_update'}, + ] + }, + { + 'product_version': 'fedora-11', + 'decision_context': 'bodhi_update_push_testing', + 'verbose': True, + 'subject': [ + {'item': self.obj.alias, 'type': 'bodhi_update'}, + ] + }, + + ] + ) + def test_greenwave_request_batches_json(self): """Ensure that the greenwave_request_batches_json property returns the correct value.""" requests = self.obj.greenwave_request_batches_json diff --git a/news/4259.bic b/news/4259.bic new file mode 100644 index 0000000000..2299d12180 --- /dev/null +++ b/news/4259.bic @@ -0,0 +1 @@ +Query on both relevant Greenwave decision contexts for critical-path updates. `Update.get_test_gating_info()` now returns a list of decision dictionaries, not a single decision dictionary. The API endpoint `/updates/{id}/get-test-results` similarly now returns a single-key dictionary whose value is a list of decisions, not a single decision dictionary. From 046bb81c31d7f588311b9964728c93cbae58b9fa Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Mon, 1 Nov 2021 12:54:39 +0100 Subject: [PATCH 06/10] Revert #4267 Signed-off-by: Mattia Verga --- bodhi/server/models.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bodhi/server/models.py b/bodhi/server/models.py index 25b1370ca6..3f7383a95e 100644 --- a/bodhi/server/models.py +++ b/bodhi/server/models.py @@ -2448,8 +2448,6 @@ def edit(cls, request, data): buildinfo = request.buildinfo up = db.query(Update).filter_by(alias=data['edited']).first() del(data['edited']) - data.pop("request", None) - req = None caveats = [] edited_builds = [build.nvr for build in up.builds] @@ -2532,7 +2530,7 @@ def edit(cls, request, data): # Updates with new or removed builds always go back to testing if new_builds or removed_builds: - req = UpdateRequest.testing + data['request'] = UpdateRequest.testing # And, updates with new or removed builds always get their karma reset. # https://github.com/fedora-infra/bodhi/issues/511 data['karma_critipath'] = 0 From 211d80264f6ae948a83b65ae3a9ed8cf9826fe2d Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Mon, 1 Nov 2021 13:12:01 +0100 Subject: [PATCH 07/10] Do not inject request in SaveUpdateSchema Signed-off-by: Mattia Verga --- bodhi/server/schemas.py | 5 -- bodhi/tests/server/services/test_updates.py | 53 ++++++++++++++------- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/bodhi/server/schemas.py b/bodhi/server/schemas.py index 1d411c26ee..d481162a87 100644 --- a/bodhi/server/schemas.py +++ b/bodhi/server/schemas.py @@ -198,11 +198,6 @@ class SaveUpdateSchema(CSRFProtectedSchema, colander.MappingSchema): colander.String(), validator=colander.OneOf(list(UpdateType.values())), ) - request = colander.SchemaNode( - colander.String(), - validator=colander.OneOf(list(UpdateRequest.values())), - missing='testing', - ) severity = colander.SchemaNode( colander.String(), validator=colander.OneOf(list(UpdateSeverity.values())), diff --git a/bodhi/tests/server/services/test_updates.py b/bodhi/tests/server/services/test_updates.py index 56a5a7f6f8..e18948dd27 100644 --- a/bodhi/tests/server/services/test_updates.py +++ b/bodhi/tests/server/services/test_updates.py @@ -3364,6 +3364,42 @@ def test_edit_testing_update_with_new_builds_with_stable_request(self, *args): assert up['builds'][0]['nvr'] == 'bodhi-2.0.0-3.fc17' assert self.db.query(RpmBuild).filter_by(nvr='bodhi-2.0.0-2.fc17').first() is None + @mock.patch('bodhi.server.services.updates.handle_side_and_related_tags_task', mock.Mock()) + @mock.patch('bodhi.server.models.tag_update_builds_task', mock.Mock()) + @mock.patch(**mock_valid_requirements) + def test_edit_testing_update_with_stable_request_no_edit_build(self, *args): + """An update with stable request should not be pushed back to testing if + build list is not changed.""" + nvr = 'bodhi-2.0.0-2.fc17' + args = self.get_update(nvr) + + with fml_testing.mock_sends(update_schemas.UpdateRequestTestingV1): + r = self.app.post_json('/updates/', args) + + # Mark it as testing + upd = Update.get(r.json['alias']) + upd.status = UpdateStatus.testing + upd.request = UpdateRequest.stable + # Clear pending messages + self.db.info['messages'] = [] + self.db.commit() + + args['edited'] = upd.alias + args['notes'] = 'A nifty description.' + + with fml_testing.mock_sends(update_schemas.UpdateEditV1): + r = self.app.post_json('/updates/', args) + + up = r.json_body + assert up['title'] == 'bodhi-2.0.0-2.fc17' + assert up['status'] == 'testing' + assert up['request'] == 'stable' + assert up['notes'] == 'A nifty description.' + assert up['comments'][-1]['text'] == 'guest edited this update.' + assert up['comments'][-3]['text'] == 'This update has been submitted for testing by guest. ' + assert len(up['builds']) == 1 + assert up['builds'][0]['nvr'] == 'bodhi-2.0.0-2.fc17' + @mock.patch('bodhi.server.services.updates.handle_side_and_related_tags_task', mock.Mock()) @mock.patch('bodhi.server.models.tag_update_builds_task', mock.Mock()) @mock.patch(**mock_valid_requirements) @@ -3463,23 +3499,6 @@ def test_edit_locked_update(self, *args): build = self.db.query(RpmBuild).filter_by(nvr=nvr).one() assert up.builds == [build] - # Changing the request should fail - args['notes'] = 'Still new notes' - args['builds'] = nvr - args['request'] = 'stable' - r = self.app.post_json('/updates/', args, status=400).json_body - assert r['status'] == 'error' - assert 'errors' in r - assert {'description': "Can't change the request on a locked update", - 'location': 'body', 'name': 'builds'} in r['errors'] - up = self.db.query(Update).get(up_id) - assert up.notes == 'Some new notes' - # We need to re-retrieve the build since we started a new transaction in the call to - # /updates - build = self.db.query(RpmBuild).filter_by(nvr=nvr).one() - assert up.builds == [build] - assert up.request is None - @mock.patch(**mock_valid_requirements) def test_pending_update_on_stable_karma_reached_autopush_enabled(self, *args): """Ensure that a pending update stays in testing if it hits stable karma while pending.""" From 891564724f08124c3272e2f16717b41fd9a56e78 Mon Sep 17 00:00:00 2001 From: Adam Saleh Date: Tue, 2 Nov 2021 21:22:30 +0100 Subject: [PATCH 08/10] Update the version to reflect the one currently tested in staging --- bodhi/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bodhi/__init__.py b/bodhi/__init__.py index 603a000061..4d6c6bc06f 100644 --- a/bodhi/__init__.py +++ b/bodhi/__init__.py @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. """Fedora's update manager.""" -__version__ = "5.7.0" +__version__ = "5.7.1" # This is a regular expression used to match username mentions in comments. MENTION_RE = r'(? Date: Fri, 5 Nov 2021 10:53:08 +0100 Subject: [PATCH 09/10] Updating news for the 5.7.1 release. Signed-off-by: Adam Saleh --- docs/user/release_notes.rst | 88 +++++++++++++++++++++++++++++++++++++ news/4177.bug | 1 - news/4182.bug | 1 - news/4206.bug | 1 - news/4208.bug | 1 - news/4209.bug | 1 - news/4213.feature | 1 - news/4221.bug | 1 - news/4230.feature | 1 - news/4232.bug | 1 - news/4238.bug | 1 - news/4240.dev | 1 - news/4259.bic | 1 - news/4263.bug | 1 - news/PR4161.bug | 1 - news/PR4222.feature | 1 - news/PR4228.bug | 1 - news/PR4236.bug | 1 - news/PR4255.feature | 1 - 19 files changed, 88 insertions(+), 18 deletions(-) delete mode 100644 news/4177.bug delete mode 100644 news/4182.bug delete mode 100644 news/4206.bug delete mode 100644 news/4208.bug delete mode 100644 news/4209.bug delete mode 100644 news/4213.feature delete mode 100644 news/4221.bug delete mode 100644 news/4230.feature delete mode 100644 news/4232.bug delete mode 100644 news/4238.bug delete mode 100644 news/4240.dev delete mode 100644 news/4259.bic delete mode 100644 news/4263.bug delete mode 100644 news/PR4161.bug delete mode 100644 news/PR4222.feature delete mode 100644 news/PR4228.bug delete mode 100644 news/PR4236.bug delete mode 100644 news/PR4255.feature diff --git a/docs/user/release_notes.rst b/docs/user/release_notes.rst index fa7fc25da8..6fff1dcdb4 100644 --- a/docs/user/release_notes.rst +++ b/docs/user/release_notes.rst @@ -4,6 +4,94 @@ Release notes .. towncrier release notes start +v5.7.1 +====== +This is a bugfix release. + + +Backwards incompatible changes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +* Query on both relevant Greenwave decision contexts for critical-path updates. + `Update.get_test_gating_info()` now returns a list of decision dictionaries, + not a single decision dictionary. The API endpoint + `/updates/{id}/get-test-results` similarly now returns a single-key + dictionary whose value is a list of decisions, not a single decision + dictionary. (:issue:`4259`). + +Features +^^^^^^^^ + +* Added support for release names ending with "N" such as EPEL next + (:pr:`4222`). +* Set a `delta` parameter of 30 days when quering datagrepper for bodhi-related + user activity (:pr:`4255`). +* Added support for setting flags in generated advisories to require logging + out and logging back in for the update to take effect (:issue:`4213`). +* Replace Greenwave decision change message consumer with ResultsDB and + WaiverDB message consumers (:issue:`4230`). + +Bug fixes +^^^^^^^^^ + +* Fix an issue that caused the builds in a side-tag update to not be tagged + correctly when the build list of the update was modified (:pr:`4161`). +* Bodhi will now delete the side-tag in Koji when an update is pushed to + stable. Builds that were tagged in the side-tag but were not pushed as part + of the update will be untagged. This is required to make sure to not leave + stale side-tags in the Koji database (:pr:`4228`). +* Updates for archived releases cannot be edited anymore (:pr:`4236`). +* Correctly mark automatic updates as critpath when appropriate + (:issue:`4177`). +* Fixed an issue with validators that prevents inconsistent refusal of bodhi + override with maximum duration (:issue:`4182`). +* Fixed an issue where the search result box was cutted off out of screen + borders (:issue:`4206`). +* Fixed a javascript bug which prevented the "waive tests" button to be + displayed in UI (:issue:`4208`). +* Fixed an issue with validators that prevented a side-tag update owner to edit + their update after adding a build for which they don't have commit access + (:issue:`4209`). +* Avoid gating status ping-pong on update creation, assume status 'waiting' for + 2 hours or until first failed test (:issue:`4221`). +* For new packages submitted to repositories, the changelog was not generated + and attached to the automatic Update. This prevented the bugs mentioned in + the changelog to be closed by Bodhi (:issue:`4232`). +* Staging Bodhi now uses staging Bugzilla URL for bug links (:issue:`4238`). +* Fixed an issue where editing Updates always caused to set the request to + Testing (:issue:`4263`). + +Development improvements +^^^^^^^^^^^^^^^^^^^^^^^^ + +* Add End of life (eol) field to the releases (:issue:`4240`). + +Contributors +^^^^^^^^^^^^ + +The following developers contributed to this release of Bodhi: + +* Adam Saleh +* Adam Williamson +* Clement Verna +* dalley +* Justin Caratzas +* Jonathan Wakely +* Karma Dolkar +* Kevin Fenzi +* Lenka Segura +* Mattia Verga +* Miro HronĨok +* Michael Scherer +* Andrea Misuraca +* Neal Gompa +* Patrick Uiterwijk +* Pierre-Yves Chibon +* Rayan Das +* Samyak Jain +* Sebastian Wojciechowski +* Tomas Hrcka + v5.7.0 ====== This is a feature release. diff --git a/news/4177.bug b/news/4177.bug deleted file mode 100644 index a3004342a9..0000000000 --- a/news/4177.bug +++ /dev/null @@ -1 +0,0 @@ -Correctly mark automatic updates as critpath when appropriate diff --git a/news/4182.bug b/news/4182.bug deleted file mode 100644 index f10fcfef87..0000000000 --- a/news/4182.bug +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue with validators that prevents inconsistent refusal of bodhi override with maximum duration diff --git a/news/4206.bug b/news/4206.bug deleted file mode 100644 index cc8316d516..0000000000 --- a/news/4206.bug +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue where the search result box was cutted off out of screen borders diff --git a/news/4208.bug b/news/4208.bug deleted file mode 100644 index 5edde9ead2..0000000000 --- a/news/4208.bug +++ /dev/null @@ -1 +0,0 @@ -Fixed a javascript bug which prevented the "waive tests" button to be displayed in UI diff --git a/news/4209.bug b/news/4209.bug deleted file mode 100644 index 98327e7358..0000000000 --- a/news/4209.bug +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue with validators that prevented a side-tag update owner to edit their update after adding a build for which they don't have commit access diff --git a/news/4213.feature b/news/4213.feature deleted file mode 100644 index e5490a9ec6..0000000000 --- a/news/4213.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for setting flags in generated advisories to require logging out and logging back in for the update to take effect diff --git a/news/4221.bug b/news/4221.bug deleted file mode 100644 index a4f133c582..0000000000 --- a/news/4221.bug +++ /dev/null @@ -1 +0,0 @@ -Avoid gating status ping-pong on update creation, assume status 'waiting' for 2 hours or until first failed test diff --git a/news/4230.feature b/news/4230.feature deleted file mode 100644 index e8177e797d..0000000000 --- a/news/4230.feature +++ /dev/null @@ -1 +0,0 @@ -Replace Greenwave decision change message consumer with ResultsDB and WaiverDB message consumers diff --git a/news/4232.bug b/news/4232.bug deleted file mode 100644 index 8566fea357..0000000000 --- a/news/4232.bug +++ /dev/null @@ -1 +0,0 @@ -For new packages submitted to repositories, the changelog was not generated and attached to the automatic Update. This prevented the bugs mentioned in the changelog to be closed by Bodhi diff --git a/news/4238.bug b/news/4238.bug deleted file mode 100644 index 5381209528..0000000000 --- a/news/4238.bug +++ /dev/null @@ -1 +0,0 @@ -Staging Bodhi now uses staging Bugzilla URL for bug links diff --git a/news/4240.dev b/news/4240.dev deleted file mode 100644 index 3979781d4d..0000000000 --- a/news/4240.dev +++ /dev/null @@ -1 +0,0 @@ -Add End of life (eol) field to the releases diff --git a/news/4259.bic b/news/4259.bic deleted file mode 100644 index 2299d12180..0000000000 --- a/news/4259.bic +++ /dev/null @@ -1 +0,0 @@ -Query on both relevant Greenwave decision contexts for critical-path updates. `Update.get_test_gating_info()` now returns a list of decision dictionaries, not a single decision dictionary. The API endpoint `/updates/{id}/get-test-results` similarly now returns a single-key dictionary whose value is a list of decisions, not a single decision dictionary. diff --git a/news/4263.bug b/news/4263.bug deleted file mode 100644 index ce99df26c1..0000000000 --- a/news/4263.bug +++ /dev/null @@ -1 +0,0 @@ -Fixed an issue where editing Updates always caused to set the request to Testing diff --git a/news/PR4161.bug b/news/PR4161.bug deleted file mode 100644 index 376bde56eb..0000000000 --- a/news/PR4161.bug +++ /dev/null @@ -1 +0,0 @@ -Fix an issue that caused the builds in a side-tag update to not be tagged correctly when the build list of the update was modified diff --git a/news/PR4222.feature b/news/PR4222.feature deleted file mode 100644 index 00cc0bc37c..0000000000 --- a/news/PR4222.feature +++ /dev/null @@ -1 +0,0 @@ -Added support for release names ending with "N" such as EPEL next diff --git a/news/PR4228.bug b/news/PR4228.bug deleted file mode 100644 index ccab72153e..0000000000 --- a/news/PR4228.bug +++ /dev/null @@ -1 +0,0 @@ -Bodhi will now delete the side-tag in Koji when an update is pushed to stable. Builds that were tagged in the side-tag but were not pushed as part of the update will be untagged. This is required to make sure to not leave stale side-tags in the Koji database diff --git a/news/PR4236.bug b/news/PR4236.bug deleted file mode 100644 index f88043bb4a..0000000000 --- a/news/PR4236.bug +++ /dev/null @@ -1 +0,0 @@ -Updates for archived releases cannot be edited anymore diff --git a/news/PR4255.feature b/news/PR4255.feature deleted file mode 100644 index 5042277b62..0000000000 --- a/news/PR4255.feature +++ /dev/null @@ -1 +0,0 @@ -Set a `delta` parameter of 30 days when quering datagrepper for bodhi-related user activity From 998cc4dcd43ace4c9428e58a1fbc8bcfc4605e31 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Fri, 5 Nov 2021 18:35:35 +0100 Subject: [PATCH 10/10] Add database migration notice in release notes Signed-off-by: Mattia Verga --- docs/user/release_notes.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/user/release_notes.rst b/docs/user/release_notes.rst index 6fff1dcdb4..f4e83b2555 100644 --- a/docs/user/release_notes.rst +++ b/docs/user/release_notes.rst @@ -9,6 +9,18 @@ v5.7.1 This is a bugfix release. +Server upgrade instructions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +This release contains database migrations. To apply them, run:: + + $ sudo -u apache /usr/bin/alembic -c /etc/bodhi/alembic.ini upgrade head + + +Summary of the migrations: + +* Add End of life (eol) field to the releases (:pr:`4241`). + Backwards incompatible changes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^