From 4f66142f9c120e905ad4e27120921ed4ecf01a82 Mon Sep 17 00:00:00 2001
From: Lukas Holecek <hluk@email.cz>
Date: Oct 05 2018 05:41:22 +0000
Subject: [PATCH 1/3] Drop EPEL7 support


Signed-off-by: Lukas Holecek <hluk@email.cz>

---

diff --git a/.copr/Makefile b/.copr/Makefile
index d4fbe3b..70515e4 100644
--- a/.copr/Makefile
+++ b/.copr/Makefile
@@ -3,7 +3,7 @@ srpm:
 	python setup.py sdist
 	cp ./dist/*.tar.gz ./.copr
 	touch ./.copr/sources
-	fedpkg --path ./.copr --release el7 srpm
+	fedpkg --path ./.copr --release f28 srpm
 	cp ./.copr/*.src.rpm $(outdir)
 clean:
 	rm -f .copr/*.tar.gz .copr/sources .copr/*.spec .copr/*.src.rpm
diff --git a/.copr/freshmaker-enum34-requirement.patch b/.copr/freshmaker-enum34-requirement.patch
deleted file mode 100644
index 5039fe8..0000000
--- a/.copr/freshmaker-enum34-requirement.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/requirements.txt b/requirements.txt
-index 3f71e88..9145207 100644
---- a/requirements.txt
-+++ b/requirements.txt
-@@ -20,7 +20,7 @@ Flask-SQLAlchemy
- Flask-Script
- Flask-Login
- requests
--enum34 ; python_version <= '2.7'
-+enum34
- odcs[client]
- krbcontext
- dogpile.cache
diff --git a/.copr/freshmaker.spec.in b/.copr/freshmaker.spec.in
index e47d2f2..17820d0 100644
--- a/.copr/freshmaker.spec.in
+++ b/.copr/freshmaker.spec.in
@@ -7,15 +7,8 @@ Group:      Development/Tools
 License:    MIT
 URL:        https://pagure.io/freshmaker
 Source0:    https://files.pythonhosted.org/packages/source/o/%{name}/%{name}-%{version}.tar.gz
-Patch0:     freshmaker-enum34-requirement.patch
 
-%if 0%{?rhel} && 0%{?rhel} <= 7
-# In EL7 we need flask which needs python-itsdangerous which comes from
-# rhel7-extras which is only available on x86_64 for now.
-ExclusiveArch: %{ix86} x86_64
-%else
 BuildArch:    noarch
-%endif
 
 BuildRequires:    fedmsg-hub
 BuildRequires:    help2man
@@ -41,22 +34,6 @@ BuildRequires:    git
 BuildRequires:    python-qpid-proton
 BuildRequires:    python2-tabulate
 
-%if 0%{?rhel} && 0%{?rhel} <= 7
-BuildRequires:    python-setuptools
-BuildRequires:    python-fedora
-BuildRequires:    python-flask
-BuildRequires:    python-flask-sqlalchemy
-BuildRequires:    python-mock
-BuildRequires:    python-nose
-BuildRequires:    python-psutil
-BuildRequires:    pytest
-BuildRequires:    pyOpenSSL
-BuildRequires:    python-six
-BuildRequires:    python-sqlalchemy
-BuildRequires:    koji
-BuildRequires:    python-psycopg2
-BuildRequires:    python-lxml
-%else
 BuildRequires:    python2-setuptools
 BuildRequires:    python2-fedora
 BuildRequires:    python2-flask
@@ -71,7 +48,6 @@ BuildRequires:    python2-sqlalchemy
 BuildRequires:    python2-koji
 BuildRequires:    python2-psycopg2
 BuildRequires:    python2-lxml
-%endif
 
 BuildRequires:    systemd
 %{?systemd_requires}
@@ -99,21 +75,6 @@ Requires:    git
 Requires:    python-qpid-proton
 Requires:    python2-tabulate
 
-%if 0%{?rhel} && 0%{?rhel} <= 7
-Requires:    python-fedora
-Requires:    python-flask
-Requires:    python-flask-migrate
-Requires:    python-flask-sqlalchemy
-Requires:    python-mock
-Requires:    python-psutil
-Requires:    pyOpenSSL
-Requires:    python-six
-Requires:    python-sqlalchemy
-Requires:    koji
-Requires:    systemd-python
-Requires:    python-psycopg2
-Requires:    python-lxml
-%else
 Requires:    python2-koji
 Requires:    python2-fedora
 Requires:    python2-flask
@@ -127,7 +88,6 @@ Requires:    python2-sqlalchemy
 Requires:    python2-systemd
 Requires:    python2-psycopg2
 Requires:    python2-lxml
-%endif
 
 
 %description
@@ -137,10 +97,6 @@ Freshmaker is a service scheduling rebuilds of artifacts as new content becomes 
 %prep
 %setup -q
 
-%if 0%{?rhel} && 0%{?rhel} <= 7
-%patch0 -p1 -b .enum34
-%endif
-
 sed -i '/ldap/d' requirements.txt
 sed -i '/koji/d' requirements.txt
 
diff --git a/Jenkinsfile b/Jenkinsfile
index c81335f..9a97f8e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -48,8 +48,6 @@ node('fedora') {
         sh 'sudo rm -f rpmbuild-output/*.src.rpm'
         sh 'mkdir -p rpmbuild-output'
         sh 'make -f .copr/Makefile srpm outdir=./rpmbuild-output/'
-        /* Needed for mock EPEL7 builds: https://bugzilla.redhat.com/show_bug.cgi?id=1528272 */
-        sh 'sudo dnf -y install dnf-utils'
         sh 'sudo dnf -y builddep ./rpmbuild-output/freshmaker-*.src.rpm'
         sh 'sudo dnf -y install python2-tox python3-tox'
         /* Needed to get the latest /etc/mock/fedora-28-x86_64.cfg */
@@ -63,14 +61,6 @@ node('fedora') {
      * time, which will error out. */
     stage('Build RPM') {
         parallel (
-            'EPEL7': {
-                sh """
-                mkdir -p mock-result/el7
-                flock /etc/mock/epel-7-x86_64.cfg \
-                /usr/bin/mock -v --enable-network --resultdir=mock-result/el7 -r epel-7-x86_64 --clean --rebuild rpmbuild-output/*.src.rpm
-                """
-                archiveArtifacts artifacts: 'mock-result/el7/**'
-            },
             'F28': {
                 sh """
                 mkdir -p mock-result/f28
@@ -208,4 +198,4 @@ node('docker') {
                         ]
         }
     }
-}
\ No newline at end of file
+}

From ec476bce57b20eeb84a80db3420544702e211211 Mon Sep 17 00:00:00 2001
From: Lukas Holecek <hluk@email.cz>
Date: Oct 05 2018 05:41:22 +0000
Subject: [PATCH 2/3] Add python2-prometheus_client dependecy to spec file


Signed-off-by: Lukas Holecek <hluk@email.cz>

---

diff --git a/.copr/freshmaker.spec.in b/.copr/freshmaker.spec.in
index 17820d0..e185637 100644
--- a/.copr/freshmaker.spec.in
+++ b/.copr/freshmaker.spec.in
@@ -48,6 +48,7 @@ BuildRequires:    python2-sqlalchemy
 BuildRequires:    python2-koji
 BuildRequires:    python2-psycopg2
 BuildRequires:    python2-lxml
+BuildRequires:    python2-prometheus_client
 
 BuildRequires:    systemd
 %{?systemd_requires}
@@ -88,6 +89,7 @@ Requires:    python2-sqlalchemy
 Requires:    python2-systemd
 Requires:    python2-psycopg2
 Requires:    python2-lxml
+Requires:    python2-prometheus_client
 
 
 %description

From 431b73fe9ff4d614f04ce6f6a8d12115b9c7620e Mon Sep 17 00:00:00 2001
From: Lukas Holecek <hluk@email.cz>
Date: Oct 05 2018 06:25:09 +0000
Subject: [PATCH 3/3] Use f28 to run tests on Jenkins instead of the default f27


Signed-off-by: Lukas Holecek <hluk@email.cz>

---

diff --git a/Jenkinsfile b/Jenkinsfile
index 9a97f8e..e5ab93a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -42,7 +42,7 @@ node('master'){
 
     timestamps {
 
-node('fedora') {
+node('fedora-28') {
     checkout scm
     stage('Prepare') {
         sh 'sudo rm -f rpmbuild-output/*.src.rpm'

