From 67b4c586f970c056832d3dd8a981332509ce06d5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 15 2018 07:41:02 +0000 Subject: [PATCH 1/5] Fix linking issues and PRs when the PR content changed Fixes https://pagure.io/pagure/issue/3227 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 12b7d93..bfc4485 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1581,6 +1581,7 @@ def diff_pull_request( notify=False, notification=True ) session.commit() + tasks.link_pr_to_ticket.delay(request.uid) pagure.lib.git.update_git( request, repo=request.project, repofolder=requestfolder) From c022054e1b4759da57a5d59b53f1dc19280f516d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 15 2018 07:42:43 +0000 Subject: [PATCH 2/5] Fix alembic history so it remains linear Signed-off-by: Pierre-Yves Chibon --- diff --git a/alembic/versions/131ad2dc5bbd_table_for_no_new_branches_hook.py b/alembic/versions/131ad2dc5bbd_table_for_no_new_branches_hook.py index 4ca7659..fd835c5 100644 --- a/alembic/versions/131ad2dc5bbd_table_for_no_new_branches_hook.py +++ b/alembic/versions/131ad2dc5bbd_table_for_no_new_branches_hook.py @@ -1,14 +1,14 @@ """Table for no new branches hook Revision ID: 131ad2dc5bbd -Revises: 7f31a9fad89f +Revises: 5bb80aeb238d Create Date: 2018-05-11 10:52:05.088806 """ # revision identifiers, used by Alembic. revision = '131ad2dc5bbd' -down_revision = '7f31a9fad89f' +down_revision = '5bb80aeb238d' from alembic import op import sqlalchemy as sa From cbc48a4c8d34a4a8dd5f8334dc27e94bbee6889a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 15 2018 08:06:48 +0000 Subject: [PATCH 3/5] Fix undefined variable Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/pagure_no_new_branches.py b/pagure/hooks/pagure_no_new_branches.py index a8a929d..66f3508 100644 --- a/pagure/hooks/pagure_no_new_branches.py +++ b/pagure/hooks/pagure_no_new_branches.py @@ -94,4 +94,6 @@ class PagureNoNewBranchesHook(BaseHook): should be installed ''' + repopaths = [get_repo_path(project)] + cls.base_remove(repopaths, 'pagure_no_new_branches') From c918cd2008160a70451aae256a9de6f314de0a30 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 15 2018 08:08:56 +0000 Subject: [PATCH 4/5] Fix newly added git hook Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/test_pagure_flask_ui_plugins.py b/tests/test_pagure_flask_ui_plugins.py index 9cf5e79..7adcf69 100644 --- a/tests/test_pagure_flask_ui_plugins.py +++ b/tests/test_pagure_flask_ui_plugins.py @@ -45,9 +45,17 @@ class PagureFlaskPluginstests(tests.SimplePagureTest): self.assertEqual( sorted(names), [ - 'Block Un-Signed commits', 'Block non fast-forward pushes', - 'Fedmsg', 'IRC', 'Mail', 'Pagure', 'Pagure CI', - 'Pagure requests', 'Pagure tickets', 'Read the Doc', + 'Block Un-Signed commits', + 'Block non fast-forward pushes', + 'Fedmsg', + 'IRC', + 'Mail', + 'Pagure', + 'Pagure CI', + 'Pagure requests', + 'Pagure tickets', + 'Prevent creating new branches by git push', + 'Read the Doc', ] ) From 44f6d1a55c2ac85fd7ffdd3bdd406ed053e6dd47 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 15 2018 08:31:47 +0000 Subject: [PATCH 5/5] Drop unused import Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/pagure_no_new_branches.py b/pagure/hooks/pagure_no_new_branches.py index 66f3508..22bde1e 100644 --- a/pagure/hooks/pagure_no_new_branches.py +++ b/pagure/hooks/pagure_no_new_branches.py @@ -10,8 +10,6 @@ from __future__ import unicode_literals -import os - import sqlalchemy as sa import wtforms try: