From eb693c8a0d87392b44c0a45a1a2fac5a29ded083 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 17 2018 13:08:56 +0000 Subject: Fix triggering CI checks on new comments added to a PR Fixes https://pagure.io/pagure/issue/3213 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 0dfd6dc..7872dd0 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -1283,20 +1283,20 @@ def add_pull_request_comment(session, request, commit, tree_id, filename, 'notification': notification, })) - # Send notification to the CI server, if the comment added was a - # notification and the PR is still open and project is not private - if notification \ - and request.status == 'Open' \ - and pagure_config.get('PAGURE_CI_SERVICES') \ - and request.project.ci_hook \ - and request.project.ci_hook.active_pr \ - and not request.project.private: - pagure.lib.tasks_services.trigger_ci_build.delay( - project_name=request.project_from.fullname, - cause=request.id, - branch=request.branch_from, - ci_type=request.project.ci_hook.ci_type - ) + # Send notification to the CI server, if the comment added was a + # notification and the PR is still open and project is not private + if notification \ + and request.status == 'Open' \ + and pagure_config.get('PAGURE_CI_SERVICES') \ + and request.project.ci_hook \ + and request.project.ci_hook.active_pr \ + and not request.project.private: + pagure.lib.tasks_services.trigger_ci_build.delay( + project_name=request.project_from.fullname, + cause=request.id, + branch=request.branch_from, + ci_type=request.project.ci_hook.ci_type + ) pagure.lib.notify.log( request.project,