Lukas Holecek 2b71893
%if 0%{?fedora} || 0%{?rhel} > 8
b35c08c
%bcond_without server
Lukas Holecek 2b71893
%bcond_without docs
b35c08c
%else
Lukas Holecek 2b71893
# For EPEL8 we build only the CLI, not the server bits,
b35c08c
# because Flask and other dependencies are too old.
b35c08c
%bcond_with server
Lukas Holecek 2b71893
%bcond_with docs
b35c08c
%endif
635f8cf
635f8cf
Name:           waiverdb
Lukas Holecek 71a68b2
Version:        1.4.0
Lukas Holecek 71a68b2
Release:        1%{?dist}
635f8cf
Summary:        Service for waiving results in ResultsDB
635f8cf
License:        GPLv2+
635f8cf
URL:            https://pagure.io/waiverdb
Lukas Holecek 40ade65
Source0:        https://files.pythonhosted.org/packages/source/w/%{name}/%{name}-%{version}.tar.gz
635f8cf
b35c08c
BuildArch:      noarch
Lukas Holecek 40ade65
BuildRequires:  make
89e3843
BuildRequires:  python3-devel
89e3843
BuildRequires:  python3-setuptools
b35c08c
b35c08c
%if %{with server}
89e3843
BuildRequires:  python3-sphinx
89e3843
BuildRequires:  python3-sphinxcontrib-httpdomain
89e3843
BuildRequires:  python3-flask
89e3843
BuildRequires:  python3-sqlalchemy
Lukas Holecek 2dad426
BuildRequires:  python3-flask-cors
89e3843
BuildRequires:  python3-flask-restful
89e3843
BuildRequires:  python3-flask-sqlalchemy
89e3843
BuildRequires:  python3-psycopg2
b35c08c
BuildRequires:  python3-gssapi
9bc0e7c
BuildRequires:  python3-requests-gssapi
89e3843
BuildRequires:  python3-pytest
89e3843
BuildRequires:  python3-mock
89e3843
BuildRequires:  python3-flask-oidc
89e3843
BuildRequires:  python3-click
89e3843
BuildRequires:  python3-flask-migrate
89e3843
BuildRequires:  python3-stomppy
Lukas Holecek 937c383
BuildRequires:  python3-fedora-messaging
bcae7c5
BuildRequires:  python3-prometheus_client
bcae7c5
BuildRequires:  python3-six
89e3843
Requires:       python3-flask
89e3843
Requires:       python3-sqlalchemy
Lukas Holecek 2dad426
Requires:       python3-flask-cors
89e3843
Requires:       python3-flask-restful
89e3843
Requires:       python3-flask-sqlalchemy
89e3843
Requires:       python3-psycopg2
b35c08c
Requires:       python3-gssapi
9bc0e7c
Requires:       python3-requests-gssapi
89e3843
Requires:       python3-mock
89e3843
Requires:       python3-flask-oidc
89e3843
Requires:       python3-click
89e3843
Requires:       python3-flask-migrate
89e3843
Requires:       python3-stomppy
Lukas Holecek 937c383
Requires:       python3-fedora-messaging
bcae7c5
Requires:       python3-prometheus_client
362128a
Requires:       waiverdb-common = %{version}-%{release}
b35c08c
%endif
362128a
635f8cf
%description
635f8cf
WaiverDB is a companion service to ResultsDB, for recording waivers
635f8cf
against test results.
635f8cf
362128a
%package common
Lukas Holecek 71a68b2
Summary: Common resources for WaiverDB sub-packages
362128a
362128a
%description common
362128a
This package is not useful on its own.  It contains common filesystem resources
Lukas Holecek 71a68b2
for other WaiverDB sub-packages.
362128a
362128a
%package cli
362128a
Summary: A CLI tool for interacting with waiverdb
89e3843
BuildRequires:  python3-click
9bc0e7c
BuildRequires:  python3-requests-gssapi
89e3843
Requires:       python3-click
c0a2a78
Requires:       python3-requests-gssapi
362128a
362128a
Requires:       waiverdb-common = %{version}-%{release}
362128a
362128a
%description cli
362128a
This package contains a CLI tool for interacting with waiverdb.
362128a
Lukas Holecek 71a68b2
Primarily, submitting new waivers.
362128a
635f8cf
%prep
Lukas Holecek 40ade65
%setup -q -n %{name}-%{version}
635f8cf
9bc0e7c
# We guard against version flask-restful=0.3.6 in requirements.txt,
9bc0e7c
# but the version in Fedora is patched to work.
9bc0e7c
sed -i '/Flask-RESTful/d' requirements.txt
9bc0e7c
362128a
# Replace any staging urls with prod ones
362128a
sed -i 's/\.stg\.fedoraproject\.org/.fedoraproject.org/g' conf/client.conf.example
362128a
635f8cf
%build
89e3843
%py3_build
Lukas Holecek 2b71893
%if %{with docs}
e6ce0e5
make -C docs html man text
Lukas Holecek 71a68b2
rm -rf docs/_build/html/.buildinfo
cbb1898
%endif
635f8cf
635f8cf
%install
89e3843
%py3_install
b35c08c
b35c08c
%if ! %{with server}
b35c08c
# Need to properly split out the client one day...
b35c08c
rm %{buildroot}%{_bindir}/waiverdb
Lukas Holecek 2b71893
ls -d %{buildroot}%{python3_sitelib}/waiverdb/* | grep -E -v '(__init__.py|cli.py)$' | xargs rm -r
89e3843
%endif
635f8cf
362128a
install -d %{buildroot}%{_sysconfdir}/waiverdb/
362128a
install -m0644 \
362128a
    conf/client.conf.example \
362128a
    %{buildroot}%{_sysconfdir}/waiverdb/client.conf
362128a
Lukas Holecek 2b71893
%if %{with docs}
b35c08c
install -D -m0644 \
b35c08c
    docs/_build/man/waiverdb-cli.1 \
b35c08c
    %{buildroot}%{_mandir}/man1/waiverdb-cli.1
b35c08c
b35c08c
install -D -m0644 \
Lukas Holecek 71a68b2
    docs/_build/man/waiverdb.1 \
Lukas Holecek 71a68b2
    %{buildroot}%{_mandir}/man1/waiverdb.1
Lukas Holecek 71a68b2
Lukas Holecek 71a68b2
install -D -m0644 \
b8b93ee
    docs/_build/man/client.conf.5 \
b8b93ee
    %{buildroot}%{_mandir}/man5/waiverdb-client.conf.5
b8b93ee
b8b93ee
install -D -m0644 \
b35c08c
    docs/_build/man/waiverdb.7 \
b35c08c
    %{buildroot}%{_mandir}/man7/waiverdb.7
b35c08c
%endif
b35c08c
4b61de6
# Tests don't make sense here now that we require postgres to run them.
4b61de6
#%%check
89e3843
#export PYTHONPATH=%%{buildroot}/%%{python3_sitelib}
89e3843
#py.test-3 tests/
635f8cf
b35c08c
%if %{with server}
635f8cf
%files
89e3843
%{python3_sitelib}/%{name}
7155fe8
%exclude %{python3_sitelib}/%{name}/__init__.py
7155fe8
%exclude %{python3_sitelib}/%{name}/__pycache__/__init__.*pyc
7155fe8
%exclude %{python3_sitelib}/%{name}/cli.py
7155fe8
%exclude %{python3_sitelib}/%{name}/__pycache__/cli.*.pyc
b0e995f
%attr(755,root,root) %{_bindir}/waiverdb
Lukas Holecek 71a68b2
Lukas Holecek 71a68b2
%if %{with docs}
Lukas Holecek 71a68b2
%{_mandir}/man1/waiverdb.1*
Lukas Holecek 71a68b2
%endif
b35c08c
%endif
990636a
362128a
%files common
362128a
%license COPYING
362128a
%doc README.md conf
Lukas Holecek 2b71893
%if %{with docs}
cbb1898
%doc docs/_build/html docs/_build/text
Lukas Holecek 2b71893
%endif
7155fe8
%dir %{python3_sitelib}/%{name}
7155fe8
%dir %{python3_sitelib}/%{name}/__pycache__
7155fe8
%{python3_sitelib}/%{name}/__init__.py
7155fe8
%{python3_sitelib}/%{name}/__pycache__/__init__.*pyc
89e3843
%{python3_sitelib}/%{name}*.egg-info
362128a
362128a
%files cli
362128a
%license COPYING
7155fe8
%{python3_sitelib}/%{name}/cli.py
7155fe8
%{python3_sitelib}/%{name}/__pycache__/cli.*.pyc
cbb1898
%attr(755,root,root) %{_bindir}/waiverdb-cli
362128a
%config(noreplace) %{_sysconfdir}/waiverdb/client.conf
362128a
Lukas Holecek 2b71893
%if %{with docs}
b35c08c
%{_mandir}/man1/waiverdb-cli.1*
b8b93ee
%{_mandir}/man5/waiverdb-client.conf.5*
b35c08c
%{_mandir}/man7/waiverdb.7*
b35c08c
%endif
635f8cf
635f8cf
%changelog
Lukas Holecek 71a68b2
* Wed Nov 10 2021 Lukas Holecek <hluk@email.cz> - 1.4.0-1
Lukas Holecek 71a68b2
- On an authentication error, waiverdb-cli will now print the actual error
Lukas Holecek 71a68b2
  message instead of a JSONDecodeError exception.
Lukas Holecek 71a68b2
- Documentation has been updated and moved to: https://waiverdb.readthedocs.io
Lukas Holecek 71a68b2
887ecc0
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-3
887ecc0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
887ecc0
31ed303
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.3.0-2
31ed303
- Rebuilt for Python 3.10
31ed303
Lukas Holecek 5b0e87a
* Mon Apr 26 2021 Lukas Holecek <hluk@email.cz> - 1.3.0-1
Lukas Holecek 5b0e87a
- A simpler permission configuration can be now used. New option
Lukas Holecek 5b0e87a
  ``PERMISSIONS`` uses glob expressions instead of a regular expression to
Lukas Holecek 5b0e87a
  verify the user is allowed to waive a test case. The configuration can be
Lukas Holecek 5b0e87a
  listed with :http:get:`/api/v1.0/permissions`. Additional GET parameter
Lukas Holecek 5b0e87a
  ``testcase`` can be used to filter the list by matching test case.
Lukas Holecek 5b0e87a
  ``PERMISSION_MAPPING`` is deprecated but still works if the new option is not
Lukas Holecek 5b0e87a
  defined.
Lukas Holecek 5b0e87a
- Fixes possible disconnecting issue with older stomp.py library
Lukas Holecek 5b0e87a
  (https://github.com/jasonrbriggs/stomp.py/issues/323).
Lukas Holecek 2b71893
eb91f68
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-2
eb91f68
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
eb91f68
Lukas Holecek 40ade65
* Tue Jan 12 2021 Valerij Maljulin <vmaljuli@redhat.com> - 1.2.0-1
d3e9ac8
- ``scenario`` field is now supported for the REST API and the CLI
d3e9ac8
e4af877
* Wed Nov 18 2020 Valerij Maljulin <vmaljuli@redhat.com> - 1.1.7-1
e4af877
- Support for multiple LDAP queries was added
e4af877
- Calling ``start`` for the ``stomp.py`` connection was removed as it was deprecated
e4af877
- ``scenario`` field was added to the database
e4af877
6ebc65b
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.6-3
6ebc65b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
6ebc65b
773eb97
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 1.1.6-2
773eb97
- Rebuilt for Python 3.9
773eb97
76388af
* Tue Mar 10 2020 Valerij Maljulin <vmaljuli@redhat.com> - 1.1.6-1
76388af
- Version 1.1.5 was bumped due to error during the release
76388af
76388af
* Mon Mar 9 2020 Valerij Maljulin <vmaljuli@redhat.com> - 1.1.5-1
76388af
- STOMP connection will always disconnect regardless of errors
76388af
- Added ``docker-compose`` support
76388af
9ced759
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.4-2
9ced759
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
9ced759
21590cb
* Mon Nov 11 2019 Luiz Carvalho <lui@redhat.com> - 1.1.4-1
21590cb
- New ``/config`` API endpoint to expose the application configuration
21590cb
- Retry sending STOMP message after a delay
21590cb
- Revert allow overriding krb_principal option for waiverdb-cli
21590cb
1783da5
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.3-4
1783da5
- Rebuilt for Python 3.8.0rc1 (#1748018)
1783da5
85127b7
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.3-3
85127b7
- Rebuilt for Python 3.8
85127b7
d77dad0
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 1.1.3-2
d77dad0
- Rebuilt for Python 3.8
d77dad0
Lukas Holecek b0b9a5b
* Wed Aug 14 2019 Lukas Holecek <lholecek@redhat.com> - 1.1.3-1
Lukas Holecek b0b9a5b
- Allow overriding krb_principal option for waiverdb-cli
Lukas Holecek b0b9a5b
- Code optimizations and improvements
Lukas Holecek b0b9a5b
d83737b
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.2-2
d83737b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
d83737b
Lukas Holecek 2dad426
* Tue May 21 2019 Lukas Holecek <lholecek@redhat.com> - 1.1.1-1
Lukas Holecek 2dad426
-  Move CORS header support to flask-cors library
Lukas Holecek 2dad426
Lukas Holecek 937c383
* Wed May 15 2019 Lukas Holecek <lholecek@redhat.com> - 1.1.0-1
Lukas Holecek 937c383
- Allow optional trailing slash for about endpoint
Lukas Holecek 937c383
- Add ``proxied_by`` in the CLI
Lukas Holecek 937c383
- Update dependencies for Jenkins slave
Lukas Holecek 937c383
- Test proxied_by with access control
Lukas Holecek 937c383
- Restrict waiver creation based on users/groups and testcase
Lukas Holecek 937c383
bcae7c5
* Mon Feb 11 2019 Giulia Naponiello <gnaponie@redhat.com> - 0.14.0-1
bcae7c5
- Fix incorrect splitting of Python files into subpackages.
bcae7c5
- Improve authentication error response.
bcae7c5
- Introduce a /metrics endpoint to the API for monitoring reasons.
bcae7c5
6fc72e5
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-3
6fc72e5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
6fc72e5
7155fe8
* Sun Jan 27 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13.0-2
7155fe8
- Fix incorrect splitting of Python files into subpackages
7155fe8
9bc0e7c
* Mon Jan 14 2019 Matt Prahl <mprahl@redhat.com> - 0.13.0-1
9bc0e7c
- Stop validating subject types against a hard-coded list. Since Greenwave
9bc0e7c
  now supports arbitrary subject types, this list of valid subject types
9bc0e7c
  no longer needs to be maintained.
9bc0e7c
7cc1d15
* Mon Dec 03 2018 Miro Hrončok <mhroncok@redhat.com> - 0.11.0-4
7cc1d15
- Remove ambiguous python buildrequires and stop dragging in Python 2
7cc1d15
c0a2a78
* Wed Aug 15 2018 Ralph Bean - 0.11.0-3
c0a2a78
- Fixed requires lines for epel7.
c0a2a78
40f8cd4
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-2
40f8cd4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
40f8cd4
b8b93ee
* Thu Jul 05 2018 Dan Callaghan <dcallagh@redhat.com> - 0.11.0-1
b8b93ee
- new upstream release 0.11.0:
b8b93ee
  https://docs.pagure.org/waiverdb/release-notes.html#waiverdb-0-11
b8b93ee
77cc877
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.10.0-2
77cc877
- Rebuilt for Python 3.7
77cc877
b35c08c
* Thu May 10 2018 Lukas Holecek <lholecek@redhat.com> - 0.10.0-1
b35c08c
- Comment is now explicitly required when creating waivers (both in API and
b35c08c
  CLI).
b35c08c
- Multiple waivers can now be created with single POST request (#98). To create
b35c08c
  multiple waivers, POST list to "waivers/" instead of single waiver.
b35c08c
- When creating a waiver by referring to a result ID, WaiverDB now accepts
b35c08c
  results with ``'type': 'brew-build'`` as an alias for ``'koji_build'``.
b35c08c
- Messaging can be disabled is settings with ``MESSAGE_PUBLISHER = None``.
b35c08c
- The ``KERBEROS_HTTP_HOST`` setting in the server configuration is now
b35c08c
  ignored. This setting is no longer needed because GSSAPI will automatically
b35c08c
  find a key in the Kerberos keytab matching the service principal in the
b35c08c
  client request.
b35c08c
- New man pages are available for ``waiverdb-cli(1)`` and ``waiverdb(7)`` (REST
b35c08c
  API).
b35c08c
- Changed error message for bad ``since`` value. E.g.
b35c08c
  ``api/v1.0/waivers/?since=123`` results in HTTP 400 with message
b35c08c
  ``{"message": {"since": "time data '123' does not match format
9b0cfd8
  '%%Y-%%m-%%dT%%H:%%M:%%S.%%f'"}}``.
b35c08c
- CORS headers are now supported for every request (#160).
b35c08c
- Wrong ``subject`` filter produces more user-friendly error (#162).
b35c08c
- Setting a keytab file is no longer required: if one is not explicitly set,
b35c08c
  ``/etc/krb5.keytab`` will be used (#55).
b35c08c
- Unused option ``resultsdb_api_url`` was removed from client.conf.
b35c08c
- Containers on Quay (`<https://quay.io/repository/factory2/waiverdb>`__).
b35c08c
89e3843
* Mon Mar 12 2018 Ralph Bean 
89e3843
- Include new resultsdb_api_url config for the client.
89e3843
- Port to python3.
89e3843
455c468
* Thu Mar 01 2018 Dan Callaghan <dcallagh@redhat.com> - 0.9.0-1
455c468
- new upstream release 0.9.0:
455c468
  https://docs.pagure.org/waiverdb/release-notes.html#waiverdb-0-9
455c468
4b61de6
* Fri Feb 23 2018 Giulia Naponiello <gnaponie@redhat.com> - 0.8.0-1
4b61de6
- Removed support to SQLite in favor of PostgreSQL.
4b61de6
- Fixed and improved interaction with PostgreSQL.
4b61de6
- Added information on the README file on how to configure the db.
4b61de6
5cc34cb
* Fri Feb 16 2018 Giulia Naponiello <gnaponie@redhat.com> - 0.7.0-2
5cc34cb
- Bump the version to fix a minor issue.
5cc34cb
173737c
* Fri Feb 16 2018 Giulia Naponiello <gnaponie@redhat.com> - 0.7.0-1
173737c
- Backward compatibility for submitting a waiver using the result_id.
173737c
  This feature will be removed in the near future.
173737c
- You can now waive the absence of a result. Now it is possible to
173737c
  submit waivers using a subject/testcase.
173737c
- Added logo in the README page.
173737c
- Dummy authentication for CLI for developing and debugging reasons.
173737c
4912d87
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.0-3
4912d87
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
4912d87
6e2017e
* Thu Jan 25 2018 Dan Callaghan <dcallagh@redhat.com> - 0.5.0-2
6e2017e
- waiverdb-cli requires python-configparser (RHBZ#1538463)
6e2017e
b0e995f
* Thu Jan 11 2018 Giulia Naponiello <gnaponie@redhat.com> - 0.5.0-1
b0e995f
- Return error messages in JSON
b0e995f
- Support SSL cert auth
b0e995f
- Allow proxyuser
b0e995f
  https://docs.pagure.org/waiverdb/release-notes.html#waiverdb-0-5
b0e995f
cbb1898
* Thu Dec 07 2017 Ralph Bean <rbean@redhat.com> - 0.4.0-2
cbb1898
- Synchronize specfile with upstream.
cbb1898
- Docs are back.
cbb1898
362128a
* Tue Nov 07 2017 Ralph Bean <rbean@redhat.com> - 0.4.0-1
362128a
- Latest upstream.
362128a
- Include new waiverdb-cli subpackage.
362128a
- Temporarilly disable building the docs,
362128a
  https://pagure.io/waiverdb/issue/90
362128a
e24c9a9
* Thu Oct 05 2017 Ralph Bean <rbean@redhat.com> - 0.3.1-2
e24c9a9
- Require only python-fedmsg-core.
e24c9a9
8157bf8
* Wed Sep 27 2017 Matt Jia <mjia@redhat.com> - 0.3.1-1
8157bf8
- Bump the version to fix some minor issues.
8157bf8
d16b104
* Tue Sep 26 2017 Matt Jia <mjia@redhat.com> - 0.3.1
d16b104
- new upstream release 0.3.1:
d16b104
  https://docs.pagure.org/waiverdb/release-notes.html#waiverdb-0-3
d16b104
2b9f25a
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-2
2b9f25a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
2b9f25a
990636a
* Mon Jun 19 2017 Dan Callaghan <dcallagh@redhat.com> - 0.2.1-1
990636a
- new upstream release 0.2.1:
990636a
  https://docs.pagure.org/waiverdb/release-notes.html#waiverdb-0-2
990636a
635f8cf
* Wed May 03 2017 Matt Jia <mjia@redhat.com> - 0.1.1-2
635f8cf
- Fix the long line error in the spec file reported by rpmlint
635f8cf
635f8cf
* Wed Apr 26 2017 Matt Jia <mjia@redhat.com> - 0.1.1-1
635f8cf
- Updated to release 0.1.1
d16b104