commit f099abbdd85cccd766084e04f3f547f0265bb98a
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Fri Dec 21 15:40:00 2018 +0100
Add wip hotness
roles/hotness/files/rpmmacros | 5 ++
roles/hotness/files/yumconfig | 35 ++++++++++++
roles/hotness/tasks/main.yml | 84 ++++++++++++++++++++++++++++
roles/hotness/templates/hotness.py | 108 ++++++++++++++++++++++++++++++++++++
4 files changed, 232 insertions(+), 0 deletions(-)
---
diff --git a/roles/hotness/files/rpmmacros b/roles/hotness/files/rpmmacros
new file mode 100644
index 0000000..218a52a
--- /dev/null
+++ b/roles/hotness/files/rpmmacros
@@ -0,0 +1,5 @@
+# rpmmacros for the-new-hotness to build source rpms in place in /var/tmp/
+
+%_topdir .
+%_sourcedir .
+%_srcrpmdir .
diff --git a/roles/hotness/files/yumconfig b/roles/hotness/files/yumconfig
new file mode 100644
index 0000000..205622c
--- /dev/null
+++ b/roles/hotness/files/yumconfig
@@ -0,0 +1,35 @@
+[main]
+cachedir=/var/cache/yum-hotness/$basearch/$releasever
+keepcache=0
+debuglevel=2
+logfile=/var/log/yum-hotness.log
+exactarch=1
+obsoletes=1
+gpgcheck=1
+plugins=1
+installonly_limit=3
+
+# It is usually 90m. We'll expire often..
+metadata_expire=5m
+
+# We have three repos to query...
+[rawhide-x86_64]
+name=Rawhide x86_64
+failovermethod=priority
+baseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/
+enabled=1
+gpgcheck=0
+
+[rawhide-i386]
+name=Rawhide i386
+failovermethod=priority
+baseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/i386/
+enabled=1
+gpgcheck=0
+
+[rawhide-armhfp]
+name=Rawhide armhfp
+failovermethod=priority
+baseurl=https://kojipkgs.fedoraproject.org/repos/rawhide/latest/armhfp/
+enabled=1
+gpgcheck=0
diff --git a/roles/hotness/tasks/main.yml b/roles/hotness/tasks/main.yml
new file mode 100644
index 0000000..846da3e
--- /dev/null
+++ b/roles/hotness/tasks/main.yml
@@ -0,0 +1,84 @@
+---
+# Configuration for the the-new-hotness consumer
+#
+- name: install rebase helper from epel-testing
+ package: name={{ item }} state=present enablerepo=epel-testing
+ with_items:
+ - rebase-helper
+ tags:
+ - packages
+ - hotness
+
+- name: install needed packages
+ package: name={{ item }} state=present
+ with_items:
+ - the-new-hotness
+ - python-psycopg2
+ - python-sh
+ - koji
+ - fedpkg
+ - git
+ - rpmdevtools # Note that we hotfix rpmdev-bumpspec on top of this
+ tags:
+ - packages
+ - hotness
+
+- name: hotfix rpmdev-bumpspec to a copy from rpmdevtools-8.5-1
+ copy: src=hotfix/rpmdev-bumpspec dest=/usr/bin/rpmdev-bumpspec
+ tags:
+ - hotfix
+ - hotness
+
+- name: copy hotness fedmsg configuration
+ template: >
+ src={{ item }} dest=/etc/fedmsg.d/{{ item }}
+ owner=fedmsg group=fedmsg mode=0600
+ with_items:
+ - hotness.py
+ notify:
+ - restart fedmsg-hub
+ tags:
+ - config
+ - hotness
+
+- name: install hotness.pem koji key and cert
+ copy: >
+ src="{{ private }}/files/hotness_key_and_cert.pem"
+ dest="/etc/pki/fedmsg/hotness.pem"
+ owner=fedmsg
+ group=fedmsg
+ mode=0400
+ tags:
+ - config
+ - hotness
+
+- name: install koji ca cert
+ copy: >
+ src="{{ private }}/files/fedora-ca.cert"
+ dest="/etc/pki/fedmsg/{{ item }}"
+ owner=root
+ group=root
+ mode=0644
+ with_items:
+ - fedora-server-ca.cert
+ - fedora-upload-ca.cert
+ tags:
+ - config
+ - hotness
+
+- name: Copy over a yum config for repoquery
+ copy: src=yumconfig dest=/etc/hotness-yum.conf
+ tags:
+ - config
+ - hotness
+
+- name: Copy over rpmmacros configuration
+ copy: src=rpmmacros dest=/etc/rpm/macros.hotness
+ tags:
+ - config
+ - hotness
+
+- name: Drop old /usr/share/fedmsg (once used for bugzilla cookies...)
+ file: dest=/usr/share/fedmsg state=absent
+ tags:
+ - hotness
diff --git a/roles/hotness/templates/hotness.py b/roles/hotness/templates/hotness.py
new file mode 100644
index 0000000..653a2a2
--- /dev/null
+++ b/roles/hotness/templates/hotness.py
@@ -0,0 +1,108 @@
+import os
+import socket
+hostname = socket.gethostname().split('.', 1)[0]
+
+description_template = """Latest upstream release: %(latest_upstream)s
+Current version/release in %(repo_name)s: %(repo_version)s-%(repo_release)s
+URL: %(url)s
+
+Please consult the package updates policy before you issue an update to a stable branch:
https://fedoraproject.org/wiki/Updates_Policy
+
+More information about the service that created this bug can be found at:
%(explanation_url)s
+
+Please keep in mind that with any upstream change, there may also be packaging changes
that need to be made. Specifically, please remember that it is your responsibility to
review the new version to ensure that the licensing is still correct and that no non-free
or legally problematic items have been added upstream.
+
+Based on the information from anitya:
https://release-monitoring.org/project/%(projectid)s/
+"""
+
+config = {
+ {% if env == 'staging' %}
+ # Establish a loop from prod anitya back into the staging hotness.
+ 'endpoints': {
+ 'anitya-public-relay': [
+ 'tcp://release-monitoring.org:9940',
+ ],
+ },
+ {% endif %}
+
+ 'hotness.bugzilla.enabled': True,
+
+ 'hotness.bugzilla': {
+ 'user': '{{ upstream_release_bugzilla_user }}',
+ 'password': '{{ upstream_release_bugzilla_password }}',
+{% if env == 'staging' %}
+ 'url': 'https://bugzilla.rpmfusion.org',
+ 'explanation_url':
'https://stg.fedoraproject.org/wiki/Upstream_release_monitoring',
+{% else %}
+ 'url': 'https://bugzilla.rpmfusion.org',
+ 'explanation_url':
'https://fedoraproject.org/wiki/Upstream_release_monitoring',
+{% endif %}
+ 'product': 'Fedora',
+ 'version': 'rawhide',
+ 'keywords': 'FutureFeature,Triaged',
+ 'bug_status': 'NEW',
+ 'short_desc_template': "%(name)s-%(latest_upstream)s is
available",
+ 'description_template': description_template,
+ },
+
+ 'hotness.koji': {
+{% if env == 'staging' %}
+ 'server': 'https://koji.stg.rpmfusion.org/kojihub',
+ 'weburl': 'https://koji.stg.rpmfusion.org/koji',
+{% else %}
+ 'server': 'https://koji.rpmfusion.org/kojihub',
+ 'weburl': 'https://koji.rpmfusion.org/koji',
+{% endif %}
+ 'git_url': 'https://pkgs.rpmfusion.org/git/free/{package}.git',
+
+ 'krb_principal':
'hotness/hotness01{{env_suffix}}.phx2.fedoraproject.org@{{ipa_realm}}',
+ 'krb_keytab':
'/etc/krb5.hotness_hotness01{{env_suffix}}.phx2.fedoraproject.org.keytab',
+ 'krb_ccache': None,
+ 'krb_proxyuser': None,
+ 'krb_sessionopts': {'timeout': 3600, 'krb_rdns': False},
+
+ 'user_email': ('RPM Fusion Release Monitoring ',
+ '<release-monitoring(a)rpmfusion.org>'),
+ 'opts': {'scratch': True},
+ 'priority': 30,
+ 'target_tag': 'rawhide',
+ },
+
+ 'hotness.anitya': {
+ 'url': 'https://release-monitoring.org',
+ 'username': '{{ fedoraDummyUser }}',
+ 'password': '{{ fedoraDummyUserPassword }}',
+ },
+
+ 'hotness.repo_url': 'https://pagure.io/releng/fedora-scm-requests',
+{% if env == 'staging' %}
+ "hotness.mdapi_url": "https://apps.stg.fedoraproject.org/mdapi",
+ 'hotness.pdc_url': 'https://pdc.stg.fedoraproject.org',
+ 'hotness.dist_git_url': 'https://src.stg.fedoraproject.org',
+{% else %}
+ "hotness.mdapi_url": "https://apps.fedoraproject.org/mdapi",
+ 'hotness.pdc_url': 'https://pdc.fedoraproject.org',
+ 'hotness.dist_git_url': 'https://src.fedoraproject.org',
+{% endif %}
+
+ 'hotness.yumconfig': '/etc/hotness-yum.conf',
+
+ # The time in seconds the-new-hotness should wait for a socket to connect
+ # before giving up.
+ 'hotness.connect_timeout': 15,
+ # The time in seconds the-new-hotness should wait for a read from a socket
+ # before giving up.
+ 'hotness.read_timeout': 15,
+ # The number of times the-new-hotness should retry a network request that
+ # that failed for any reason (e.g. read timeout, DNS error, etc)
+ 'hotness.requests_retries': 3,
+
+ "hotness.cache": {
+ "backend": "dogpile.cache.dbm",
+ "expiration_time": 290,
+ "arguments": {
+ "filename": "/var/tmp/the-new-hotness-cache.dbm",
+ },
+ },
+}
+