Administration

This guide will take you through installation and configuration process of The New Hotness, so you are able to run The New Hotness in your own infrastructure.

Installation

The New Hotness is available through PyPi.

Prior to the installation itself there are few dependencies that need to be on the system. Because The New Hotness is running in Fedora infrastructure so this guide assumes you are running Fedora as your main system and thus need to install following packages. These tools are used by The New Hotness to work with the packages:

$ sudo dnf install -y fedpkg rpmdevtools

You can install the latest version by running:

$ pip install the-new-hotness

External systems

The New Hotness communicates with multiple external systems to provide all the functionality. To be able to use maximum potential of The New Hotness, you need to connect it to following external systems:

  • mdapi

    Metadata API hosted by Fedora. The New Hotness uses it to look for the newest build in koji.

  • bugzilla

    The New Hotness is looking for existing issue for the package in bugzilla and if none is found creates one.

  • anitya

    The New Hotness is consuming fedora messages from Anitya and looking for updates of the packages that we want to process.

  • Redis

    Redis is used as a cache for saving data that we would need later by the-new-hotness. For example koji build id mapping to bugzilla ticket.

  • koji

    Koji is a build system used to start scratch builds. First we need to upload sources to lookaside cache and than we can start the build.

  • pagure

    Dist-git system used by Fedora containing notification settings for The New Hotness and is checked if the package even exists and also if it is retired.

Configuration

The New Hotness configuration is read from the consumer_config section of the fedora messaging configuration.

The configuration is using the TOML format and the sample could be found below.

# A sample configuration for fedora-messaging. This file is in the TOML format.
# For complete details on all configuration options, see the documentation
# https://fedora-messaging.readthedocs.io/en/latest/configuration.html.

amqp_url = "amqp://guest:guest@localhost:5672"

publish_exchange = "amq.topic"

callback = "hotness.hotness_consumer:HotnessConsumer"

# Note the double brackets below.
# To add another binding, add another [[bindings]] section.
[[bindings]]
queue = "the-new-hotness"
exchange = "amq.topic"
routing_keys = [
    "org.release-monitoring.prod.anitya.project.version.update.v2",
    "org.release-monitoring.prod.anitya.project.version.update",
    "org.fedoraproject.prod.buildsys.task.state.change",
]

[tls]
ca_cert = "/etc/pki/tls/certs/ca-bundle.crt"
keyfile = "/my/client/key.pem"
certfile = "/my/client/cert.pem"

[client_properties]
app = "the-new-hotness"

[queues.the-new-hotness]
durable = true
auto_delete = false
exclusive = false
arguments = {}

[qos]
prefetch_size = 0
prefetch_count = 25

[log_config]
version = 1
disable_existing_loggers = true

[log_config.formatters.simple]
format = "[%(name)s %(levelname)s] %(message)s"

[log_config.handlers.console]
class = "logging.StreamHandler"
formatter = "simple"
stream = "ext://sys.stdout"

[log_config.loggers.fedora_messaging]
level = "INFO"
propagate = false
handlers = ["console"]

[log_config.root]
level = "WARNING"
handlers = ["console"]

# the-new-hotness consumer configuration
[consumer_config]
mdapi_url = "https://apps.fedoraproject.org/mdapi"
# URL to hotness issue tracker that will be shown together with error in bugzilla
hotness_issue_tracker = "https://github.com/fedora-infra/the-new-hotness/issues"
# The time in seconds the-new-hotness should wait for a socket to connect
# before giving up.
connect_timeout = 15
# The time in seconds the-new-hotness should wait for a read from a socket
# before giving up.
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)
requests_retries = 3

# Redis configuration for the-new-hotness
[consumer_config.redis]
# Hostname of the redis server
hostname = "localhost"
# Port of the redis server
port = 6379
# Password for redis server
password = ""
# Expiration time in seconds for entries put in redis database
# Default: 1 day
expiration = 86400

# Bugzilla configuration for the-new-hotness
[consumer_config.bugzilla]
# If the bugzilla wrapper is enabled, currently ignored
enabled = true
# User that is used to report the issue in bugzilla
reporter = "Upstream Release Monitoring"
# E-mail of the reporter bugzilla account
reporter_email = "upstream-release-monitoring@fedoraproject.org"
# Use bugzilla API key for communication with bugzilla
api_key = ""
# URL of the bugzilla instance
url = "https://partner-bugzilla.redhat.com"
# Product in bugzilla under which to file the new issue
product = "Fedora"
# Version of product to file issue against
version = "rawhide"
# Keywords for new issue
keywords = "FutureFeature,Triaged"
# Bug status to set on creation
bug_status = "NEW"
# URL with explanation about what release-monitoring is
# Used in template
explanation_url = "https://fedoraproject.org/wiki/upstream_release_monitoring"
# Title for new issue in bugzilla
short_desc_template="%(name)s-%(retrieved_version)s is available"
short_desc_template_more_versions="New versions of %(name)s available"
# Description of the issue (first comment on the issue)
description_template = """
Releases retrieved: %(retrieved_versions)s
Upstream release that is considered latest: %(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://docs.fedoraproject.org/en-US/fesco/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/

To change the monitoring settings for the project, please visit:
%(dist_git_url)s
"""

# Configuration of Koji for the-new-hotness
[consumer_config.koji]
# Server URL for koji
server = "https://koji.fedoraproject.org/kojihub"
# Frontend URL of koji
weburl = "https://koji.fedoraproject.org/koji"
# Kerberos configuration to authenticate with Koji. In development
# environments, use `kinit <fas-name>@FEDORAPROJECT.ORG` to get a
# Kerberos ticket and use the default settings below.
krb_principal = ""
krb_keytab = ""
krb_ccache = ""
krb_proxyuser = ""
krb_sessionopts = {timeout = 3600, krb_rdns = false}
# Git URL where to find the package
git_url = "https://src.fedoraproject.org/cgit/rpms/{package}.git",
# User name and e-mail for starting the scratch build
user_email = [
    "Upstream Monitor",
    "<upstream-release-monitoring@fedoraproject.org>",
]
# Options for koji build
opts = {scratch = true}
# Priority of the build
priority = 30
# Tag to build against
target_tag = "rawhide"