From 7b32c134f075a77861a497630ebf704fc25453fa Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Dec 04 2019 15:39:00 +0000 Subject: Merge branch 'f30' --- diff --git a/5da6aaaf240d6cf7b9f39104254701daa1b0ac65.patch b/5da6aaaf240d6cf7b9f39104254701daa1b0ac65.patch new file mode 100644 index 0000000..8b5fa10 --- /dev/null +++ b/5da6aaaf240d6cf7b9f39104254701daa1b0ac65.patch @@ -0,0 +1,70 @@ +From 5da6aaaf240d6cf7b9f39104254701daa1b0ac65 Mon Sep 17 00:00:00 2001 +From: Pierre-Yves Chibon +Date: Wed, 13 Nov 2019 20:39:22 +0100 +Subject: [PATCH] Fix builds being signed without being part of an update + +@nirik reported to us that bodhi sends an error message when it +encounters a build that is signed but is not part of an update. +This commit should help preventing the traceback. + +Signed-off-by: Pierre-Yves Chibon +--- + bodhi/server/consumers/signed.py | 6 ++++-- + bodhi/tests/server/consumers/test_signed.py | 11 +++++++++++ + news/3720.bug | 1 + + 3 files changed, 16 insertions(+), 2 deletions(-) + create mode 100644 news/3720.bug + +diff --git a/bodhi/server/consumers/signed.py b/bodhi/server/consumers/signed.py +index ecb6891e6..abbbedefe 100644 +--- a/bodhi/server/consumers/signed.py ++++ b/bodhi/server/consumers/signed.py +@@ -89,7 +89,7 @@ def __call__(self, message: fedora_messaging.api.Message): + log.info('Build is not assigned to release, skipping') + return + +- if build.update.from_tag: ++ if build.update and build.update.from_tag: + koji_testing_tag = build.release.get_testing_side_tag(build.update.from_tag) + if tag != koji_testing_tag: + log.info("Tag is not testing side tag, skipping") +@@ -112,7 +112,9 @@ def __call__(self, message: fedora_messaging.api.Message): + log.info("Build %s has been marked as signed" % build_nvr) + + # If every build in update is signed change status to testing +- if not build.update.release.composed_by_bodhi and build.update.signed: ++ if build.update \ ++ and not build.update.release.composed_by_bodhi \ ++ and build.update.signed: + log.info("Every build in update is signed, set status to testing") + + build.update.status = UpdateStatus.testing +diff --git a/bodhi/tests/server/consumers/test_signed.py b/bodhi/tests/server/consumers/test_signed.py +index 261b34c78..3bbc71fe8 100644 +--- a/bodhi/tests/server/consumers/test_signed.py ++++ b/bodhi/tests/server/consumers/test_signed.py +@@ -77,6 +77,17 @@ def test_consume(self, mock_build_model): + self.handler(self.sample_message) + assert build.signed is True + ++ @mock.patch('bodhi.server.consumers.signed.Build') ++ def test_consume_build_with_no_update(self, mock_build_model): ++ """Assert that messages marking the build as signed updates the database""" ++ build = mock_build_model.get.return_value ++ build.signed = False ++ build.update = None ++ build.release.pending_testing_tag = self.sample_message.body["tag"] ++ ++ self.handler(self.sample_message) ++ assert build.signed is True ++ + @mock.patch('bodhi.server.consumers.signed.Build') + def test_consume_not_pending_testing_tag(self, mock_build_model): + """ +diff --git a/news/3720.bug b/news/3720.bug +new file mode 100644 +index 000000000..02de5a8c8 +--- /dev/null ++++ b/news/3720.bug +@@ -0,0 +1 @@ ++Fix the traceback when builds are being signed without being included in an update diff --git a/7fa94f0deca96641028de8f19330391ff761415a.patch b/7fa94f0deca96641028de8f19330391ff761415a.patch new file mode 100644 index 0000000..d2654ec --- /dev/null +++ b/7fa94f0deca96641028de8f19330391ff761415a.patch @@ -0,0 +1,26 @@ +diff --git a/bodhi/server/util.py b/bodhi/server/util.py +index aa611a8c5..1e2232aef 100644 +--- a/bodhi/server/util.py ++++ b/bodhi/server/util.py +@@ -121,14 +121,13 @@ def generate_changelog(build: 'models.Build') -> typing.Optional[str]: + return None + + # Grab the RPM header of the previous update, and generate a ChangeLog +- oldh = get_rpm_header(lastpkg) +- oldtime = oldh['changelogtime'] +- text = oldh['changelogtext'] +- +- if not text: +- oldtime = 0 +- elif isinstance(oldtime, list): +- oldtime = oldtime[0] ++ oldtime = 0 ++ if lastpkg is not None: ++ oldh = get_rpm_header(lastpkg) ++ if oldh['changelogtext']: ++ oldtime = oldh['changelogtime'] ++ if isinstance(oldtime, list): ++ oldtime = oldtime[0] + + return build.get_changelog(oldtime) + diff --git a/bodhi.spec b/bodhi.spec index 22c3411..bf95906 100644 --- a/bodhi.spec +++ b/bodhi.spec @@ -2,15 +2,25 @@ %global bashcomproot %(dirname %{bashcompdir} 2>/dev/null) %{?python_enable_dependency_generator} +#%%global commit 17779cf31a712c4142e8e95a408db73ca17cb778 +#%%global commit_short %(c=%{commit}; echo ${c:0:7}) + Name: bodhi -Version: 4.1.0 -Release: 6%{?dist} +Version: 5.0.0 +Release: 3%{?dist} +#Release: 0.beta.1.%{commit_short}%{?dist} BuildArch: noarch License: GPLv2+ Summary: A modular framework that facilitates publishing software updates URL: https://github.com/fedora-infra/bodhi Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz +#Source0: %{url}/archive/%{commit}/%{name}-%{commit}.tar.gz + +# Hotfix for messages crashing the consumer. +Patch0: https://github.com/fedora-infra/bodhi/commit/5da6aaaf240d6cf7b9f39104254701daa1b0ac65.patch +# Hotfix for crashes in the push script +Patch1: https://github.com/fedora-infra/bodhi/pull/3712/commits/7fa94f0deca96641028de8f19330391ff761415a.patch # https://github.com/fedora-infra/bodhi/pull/3423 Patch0: bodhi-tests-rawhide.patch @@ -21,6 +31,7 @@ BuildRequires: %{py3_dist alembic} BuildRequires: %{py3_dist arrow} BuildRequires: %{py3_dist backoff} BuildRequires: %{py3_dist bleach} +BuildRequires: %{py3_dist celery} BuildRequires: %{py3_dist click} BuildRequires: %{py3_dist colander} BuildRequires: %{py3_dist cornice_sphinx} >= 0.3 @@ -183,6 +194,7 @@ updates for a software distribution. %prep %autosetup -p1 -n bodhi-%{version} +#%%autosetup -p1 -n bodhi-%{commit} # Kill some dev deps sed -i '/pyramid_debugtoolbar/d' setup.py @@ -195,6 +207,7 @@ mv devel/development.ini.example development.ini %build %py3_build +export PYTHONPATH=`pwd` make %{?_smp_mflags} -C docs html make %{?_smp_mflags} -C docs man @@ -211,6 +224,7 @@ make %{?_smp_mflags} -C docs man install -Dpm 0755 bodhi-complete.sh %{buildroot}%{bashcompdir}/%{name} install -m 644 apache/%{name}.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf +sed -i -s 's/BODHI_VERSION/%{version}/g' %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf install -m 640 production.ini %{buildroot}%{_sysconfdir}/%{name}/production.ini install -m 640 alembic.ini %{buildroot}%{_sysconfdir}/%{name}/alembic.ini install apache/%{name}.wsgi %{buildroot}%{_datadir}/%{name}/%{name}.wsgi @@ -245,9 +259,9 @@ install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/ %files composer %license COPYING %doc README.rst -%{python3_sitelib}/%{name}/server/consumers/composer.py +%{python3_sitelib}/%{name}/server/tasks/composer.py # The __pycache__ folder itself is owned by bodhi-server. -%{python3_sitelib}/%{name}/server/consumers/__pycache__/composer.* +%{python3_sitelib}/%{name}/server/tasks/__pycache__/composer.* %{python3_sitelib}/%{name}/server/metadata.py %{python3_sitelib}/%{name}/server/__pycache__/metadata.* @@ -304,19 +318,31 @@ install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/ %attr(-,bodhi,bodhi) %config(noreplace) %{_sysconfdir}/bodhi/* %attr(0775,bodhi,bodhi) %{_localstatedir}/cache/bodhi # These excluded files are in the bodhi-consumers package so don't include them here. -%exclude %{python3_sitelib}/%{name}/server/consumers/composer.py -%exclude %{python3_sitelib}/%{name}/server/consumers/__pycache__/composer.* +%exclude %{python3_sitelib}/%{name}/server/tasks/composer.py +%exclude %{python3_sitelib}/%{name}/server/tasks/__pycache__/composer.* %exclude %{python3_sitelib}/%{name}/server/metadata.py %exclude %{python3_sitelib}/%{name}/server/__pycache__/metadata.* %changelog +* Thu Nov 28 2019 Aurelien Bompard - 5.0.0-3 +- Hotfix for a crash in the push script. + +* Thu Nov 28 2019 Aurelien Bompard - 5.0.0-2 +- Hotfix with commit 5da6aaaf. + +* Thu Nov 07 2019 Aurelien Bompard - 5.0.0-1 +- Update to 5.0.0. https://github.com/fedora-infra/bodhi/releases/tag/5.0.0 + * Thu Oct 03 2019 Miro Hrončok - 4.1.0-6 - Rebuilt for Python 3.8.0rc1 (#1748018) * Sun Aug 25 2019 Miro Hrončok - 4.1.0-5 - Enable the documentation +* Tue Aug 20 2019 Aurelien Bompard - 4.1.1-1 +- Update to 4.1.1. https://github.com/fedora-infra/bodhi/releases/tag/4.1.1 + * Mon Aug 19 2019 Miro Hrončok - 4.1.0-4 - Rebuilt for Python 3.8 @@ -332,6 +358,10 @@ install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/ * Mon Jun 17 2019 Adam Williamson - 4.0.2-2 - Backport fix for 'updates download' with multiple packages (#3324) +* Mon Jun 03 2019 Randy Barlow - 4.0.2-1 +- Update to 4.0.2 (#1715576). +- https://github.com/fedora-infra/bodhi/releases/tag/4.0.2 + * Thu May 30 2019 Randy Barlow - 4.0.2-1 - Update to 4.0.2 (#1715576). - https://github.com/fedora-infra/bodhi/releases/tag/4.0.2 diff --git a/local-rpmbuild.sh b/local-rpmbuild.sh new file mode 100644 index 0000000..95b4aa9 --- /dev/null +++ b/local-rpmbuild.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +FEDORA=`git symbolic-ref --short HEAD | awk '/^f[0-9]+/ { print gensub("^f", "", 1)}'` + +old_fedora=$[${FEDORA} - 1] +here="`pwd`" + +set -x + +rpmbuild \ + --define "_sourcedir ${here}" --define "_specdir ${here}" --define "_builddir ${here}" --define "_srcrpmdir ${here}" --define "_rpmdir ${here}" \ + --define "dist .fc${FEDORA}.infra" \ + --define "fedora ${FEDORA}" \ + --eval "%undefine rhel" \ + --define "fc${FEDORA} 1" \ + --eval "%undefine fc${old_fedora}" \ + --nodeps -bs bodhi.spec + +set +x +latest_srpm=`ls -rt1 bodhi-*.infra.src.rpm | tail -n 1` +echo "Now build in Koji with:" +echo "koji build f${FEDORA}-infra $latest_srpm" diff --git a/sources b/sources index 40633c0..73c6e83 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (bodhi-4.1.0.tar.gz) = c7127b68e6ac5788e224fa2a17d546b2203c5e3376a09d0cbb7dd458674282429c9a331b67444b32f59ff392f586e8ce333ffd9a776a857b85dd6a2721ba80dc +SHA512 (bodhi-5.0.0.tar.gz) = 43a9afbeced3c1e8f21b2c705103d7e7674e1ec0a2068f5ecc04aa2bbba5918ae9922d6d529832329fb123133db57d2661ed05b312e24a179801003b19d7ac7d