tune the webhook a bit more
@@ -24,14 +24,21 @@ from flask import Flask, request
import logging
from io import StringIO
+from packit.utils import set_logging
+
from packit.config import Config
from packit.bot_api import PackitBotAPI
-app = Flask(__name__)
-logger = logging.getLogger()
-logger.setLevel(logging.DEBUG)
+
+class PackitWebhookReceiver(Flask):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ set_logging(level=logging.DEBUG)
+app = PackitWebhookReceiver(__name__)
+logger = logging.getLogger("packit")
+
@app.route("/github_release", methods=["POST"])
def github_release():
msg = request.get_json()
@@ -47,9 +54,9 @@ def github_release():
logger.debug(
f"Received release event: "
- f"{msg['repository']['owner']}/{msg['repository']['name']} - {msg['release']['tag_name']}"
+ f"{msg['repository']['owner']['login']}/{msg['repository']['name']}"
+ f" - {msg['release']['tag_name']}"
)
-
config = Config()
api = PackitBotAPI(config)
# Using fedmsg since the fields are the same
