diff --git a/0001-Allow-using-Pagure-with-python-redis-3.0.0.patch b/0001-Allow-using-Pagure-with-python-redis-3.0.0.patch new file mode 100644 index 0000000..c23645d --- /dev/null +++ b/0001-Allow-using-Pagure-with-python-redis-3.0.0.patch @@ -0,0 +1,32 @@ +From 2b1a46a3b97af49938d4d4f0d08354e5950aaf86 Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 9 Jan 2019 09:37:04 -0500 +Subject: [PATCH 1/2] Allow using Pagure with python-redis >= 3.0.0 + +There doesn't seem to be any issues when running the test suite locally +with python-redis >= 3.0.0, so let's allow it again. + +Fixes: https://pagure.io/pagure/issue/4183 + +Signed-off-by: Neal Gompa +--- + requirements.txt | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/requirements.txt b/requirements.txt +index 15475f68..996fb063 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -23,8 +23,7 @@ python-openid;python_version<="2.7" + python3-openid;python_version>="3.0" + python-openid-cla + python-openid-teams +-# The 3.0.0 release of redis fails to run the tests in jenkins for us :( +-redis<3.0.0 ++redis + requests + six + sqlalchemy >= 0.8 +-- +2.20.1 + diff --git a/0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch b/0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch deleted file mode 100644 index 99a5c9d..0000000 --- a/0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 8ed43b1f9581fd81a29cb2902baf92a80d19bfb8 Mon Sep 17 00:00:00 2001 -From: Pierre-Yves Chibon -Date: Wed, 12 Dec 2018 14:50:48 +0100 -Subject: [PATCH] Port pagure to markdown 3.0+ while remaining backward - compatible - -Lift the restriction in the requirements.txt - -Fixes https://pagure.io/pagure/issue/3668 - -Signed-off-by: Pierre-Yves Chibon ---- - pagure/pfmarkdown.py | 26 ++++++++++++++++++++++---- - requirements.txt | 2 +- - 2 files changed, 23 insertions(+), 5 deletions(-) - -diff --git a/pagure/pfmarkdown.py b/pagure/pfmarkdown.py -index 39820ab2..6e5355d9 100644 ---- a/pagure/pfmarkdown.py -+++ b/pagure/pfmarkdown.py -@@ -34,6 +34,16 @@ import pagure.lib.query - from pagure.config import config as pagure_config - - -+try: -+ from markdown.inlinepatterns import ImagePattern as ImagePattern -+ -+ MK_VERSION = 2 -+except ImportError: -+ from markdown.inlinepatterns import ImageInlineProcessor as ImagePattern -+ -+ MK_VERSION = 3 -+ -+ - # the (? -Date: Mon, 26 Nov 2018 12:02:10 +0100 -Subject: [PATCH] Bypass old hooks rather than using non-existing symlinks - -When we moved to the runner architecture, we changed the way hooks are -called. During this move, we changed all of our existing hooks into -non-existing symlinks pointing to '/does/not/exists' and we were checking -if the files on disk were matching this target or not. -This created a few issue when releasing pagure: -- python setup.py sdist resolve symlinks as part of the archive creation - process - Reported in https://pagure.io/pagure/issue/3782 -- Building pagure failed on some system because these symlinks does not - exist - Reported in https://pagure.io/pagure/issue/3706 - -So in this commit we are dropping the use of symlink and just making -pagure ignore all the hook it could have created. - -Fixes https://pagure.io/pagure/issue/3782 -Fixes https://pagure.io/pagure/issue/3706 - -Signed-off-by: Pierre-Yves Chibon ---- - pagure/hooks/__init__.py | 7 +++---- - pagure/lib/__init__.py | 20 +++++++++++++++++--- - pagure/lib/tasks.py | 4 +--- - 3 files changed, 21 insertions(+), 10 deletions(-) - -diff --git a/pagure/hooks/__init__.py b/pagure/hooks/__init__.py -index 027f5822..d7409460 100644 ---- a/pagure/hooks/__init__.py -+++ b/pagure/hooks/__init__.py -@@ -411,10 +411,9 @@ def run_project_hooks( - if hook.startswith(hooktype + "."): - hookfile = os.path.join(hookdir, hook) - -- # Determine if this is an actual hook, or if it's a remnant -- # from a hook that was installed before it was moved to the -- # runner system. -- if os.path.realpath(hookfile) == pagure.lib.HOOK_DNE_TARGET: -+ # By-pass all the old hooks that pagure may have created before -+ # moving to the runner architecture -+ if hook in pagure.lib.ORIGINAL_PAGURE_HOOK: - continue - - # Execute -diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py -index 0284201b..aebd07d4 100644 ---- a/pagure/lib/__init__.py -+++ b/pagure/lib/__init__.py -@@ -70,9 +70,23 @@ REDIS = None - PAGURE_CI = None - REPOTYPES = ("main", "docs", "tickets", "requests") - _log = logging.getLogger(__name__) --# The target for hooks migrated to the Runner system, to be able to detect --# whether a hook was migrated without having to open and read the file --HOOK_DNE_TARGET = "/does/not/exist" -+# List of all the possible hooks pagure could generate before it was moved -+# to the runner architecture we now use. -+# This list is kept so we can ignore all of these hooks. -+ORIGINAL_PAGURE_HOOK = [ -+ "post-receive.default", -+ "post-receive.fedmsg", -+ "post-receive.irc", -+ "post-receive.mail", -+ "post-receive.mirror", -+ "post-receive.pagure", -+ "post-receive.pagure-requests", -+ "post-receive.pagure-ticket", -+ "post-receive.rtd", -+ "pre-receive.pagure_no_new_branches", -+ "pre-receive.pagureforcecommit", -+ "pre-receive.pagureunsignedcommit", -+] - - - class Unspecified(object): -diff --git a/pagure/lib/tasks.py b/pagure/lib/tasks.py -index 74c03291..2e73121f 100644 ---- a/pagure/lib/tasks.py -+++ b/pagure/lib/tasks.py -@@ -651,7 +651,6 @@ def move_to_repospanner(self, session, name, namespace, user, region): - raise Exception("Project is already on repoSpanner") - - # Make sure that no non-runner hooks are enabled for this project -- compatible_targets = [pagure.lib.HOOK_DNE_TARGET] - incompatible_hooks = [] - for repotype in pagure.lib.REPOTYPES: - path = project.repopath(repotype) -@@ -666,8 +665,7 @@ def move_to_repospanner(self, session, name, namespace, user, region): - if hook.endswith(".sample"): - # Ignore the samples that Git inserts - continue -- hookfile = os.path.join(hookpath, hook) -- if os.path.realpath(hookfile) not in compatible_targets: -+ if hook not in pagure.lib.ORIGINAL_PAGURE_HOOK: - incompatible_hooks.append((repotype, hook)) - - if incompatible_hooks: --- -2.17.2 - diff --git a/0002-Fix-Markdown-usage-to-work-with-Markdown-3.0.patch b/0002-Fix-Markdown-usage-to-work-with-Markdown-3.0.patch new file mode 100644 index 0000000..8394d10 --- /dev/null +++ b/0002-Fix-Markdown-usage-to-work-with-Markdown-3.0.patch @@ -0,0 +1,67 @@ +From f5f4b297b2cee938e7e13064c7e55ef7c6426bfd Mon Sep 17 00:00:00 2001 +From: Neal Gompa +Date: Wed, 9 Jan 2019 08:39:41 -0500 +Subject: [PATCH 2/2] Fix Markdown usage to work with Markdown 3.0+ + +Markdown 3.0 and later no longer considers the emphasis modifiers +to be an extension, and has them always enabled. We still enable +the 'smart_strong' extension when we detect older versions of +Markdown to retain backward compatibility. + +Signed-off-by: Neal Gompa +--- + pagure/lib/query.py | 11 ++++++++++- + tests/test_pagure_lib.py | 7 +++++-- + 2 files changed, 15 insertions(+), 3 deletions(-) + +diff --git a/pagure/lib/query.py b/pagure/lib/query.py +index 86bda508..ae561196 100644 +--- a/pagure/lib/query.py ++++ b/pagure/lib/query.py +@@ -4237,7 +4237,6 @@ def text2markdown(text, extended=True, readme=False): + "markdown.extensions.def_list", + "markdown.extensions.fenced_code", + "markdown.extensions.tables", +- "markdown.extensions.smart_strong", + # All of the above are the .extra extensions + # w/o the "attribute lists" one + "markdown.extensions.admonition", +@@ -4245,6 +4244,16 @@ def text2markdown(text, extended=True, readme=False): + "markdown.extensions.sane_lists", + "markdown.extensions.toc", + ] ++ ++ # smart_strong is not an extension anymore in markdown 3.0+ ++ try: ++ md_version = markdown.__version__.version_info ++ except AttributeError: # pragma: no cover ++ md_version = markdown.__version_info__ ++ ++ if md_version < (3, 0, 0): ++ extensions.append("markdown.extensions.smart_strong") ++ + # Some extensions are enabled for READMEs and disabled otherwise + if readme: + extensions.extend( +diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py +index 50ddab1a..cbb81adc 100644 +--- a/tests/test_pagure_lib.py ++++ b/tests/test_pagure_lib.py +@@ -5018,9 +5018,12 @@ class PagureLibtests(tests.Modeltests): + + def test_text2markdown_table(self): + """ Test the text2markdown function with a markdown table. """ +- v = tuple([int(c) for c in markdown.version.split('.')]) ++ try: ++ md_version = markdown.__version__.version_info ++ except AttributeError: ++ md_version = markdown.__version_info__ + +- if v < (2, 6, 7): ++ if md_version < (2, 6, 7): + raise unittest.case.SkipTest( + 'Skipping on old markdown that do not strip the orientation row' + ) +-- +2.20.1 + diff --git a/pagure-5.1.4.tar.gz b/pagure-5.1.4.tar.gz deleted file mode 100644 index 413e36a..0000000 --- a/pagure-5.1.4.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:52ab207d59fc294e4957bba9561bdb78180db3a9f9032d06d3e252fe3ac55a17 -size 21754558 diff --git a/pagure-5.2.tar.gz b/pagure-5.2.tar.gz new file mode 100644 index 0000000..8313bd4 --- /dev/null +++ b/pagure-5.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f0bafe2e69573feb1b2513972e0701bde400ff82bb7bbeda3100de8e3373fed +size 21818250 diff --git a/pagure.changes b/pagure.changes index 596617a..c0ff025 100644 --- a/pagure.changes +++ b/pagure.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Thu Jan 10 13:01:50 UTC 2019 - Neal Gompa + +- Update to 5.2 + + Add support for the MQTT protocol + + Add support for mirroring in git repositories from outside sources + + Add support to merge a PR when the fork was deleted + + Add the ability to generate archive from a commit or tag + + Allow searching the content of the comments on an issue tracker + + Allow filtering the issue list by the close status + + Show related PRs on the issue list if there are any + + Add build status to pull requests page + + Add new API endpoints for get and set project options + + Add WIP/experimental/unstable support for third-party extensions to pagure + + Add support for rebasing pull-requests + + Implement a button to rerun CI tests on a pull request + + Support disallowing remote pull requests + + Add an about page in the themes + + Update the chameleon theme +- Backport fix from master to allow using python-redis >= 3.0.0 + + Patch: 0001-Allow-using-Pagure-with-python-redis-3.0.0.patch +- Backport fix from master to fix compatibility with Markdown 3.0+ + + Patch: 0002-Fix-Markdown-usage-to-work-with-Markdown-3.0.patch +- Drop patches that are part of this release + + 0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch + + 0002-Bypass-old-hooks-rather-than-using-non-existing-syml.patch + ------------------------------------------------------------------- Thu Dec 13 14:43:19 UTC 2018 - Neal Gompa diff --git a/pagure.spec b/pagure.spec index 3c5a77c..0a9ae46 100644 --- a/pagure.spec +++ b/pagure.spec @@ -1,7 +1,7 @@ # # spec file for package pagure # -# Copyright (c) 2018 Neal Gompa . +# Copyright (c) 2019 Neal Gompa . # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -23,7 +23,7 @@ Name: pagure -Version: 5.1.4 +Version: 5.2 Release: 0 Summary: A git-centered forge Group: Development/Tools/Version Control @@ -41,12 +41,12 @@ Source1: https://raw.githubusercontent.com/fedora-infra/python-fedora Source10: pagure-README.SUSE # Backports from upstream -# Port pfmarkdown to Markdown v3 while remaining v2 compatible -# From: https://pagure.io/pagure/c/8ed43b1f9581fd81a29cb2902baf92a80d19bfb8 -Patch0001: 0001-Port-pagure-to-markdown-3.0-while-remaining-backward.patch -# Avoid the need for non-existent symlinks to trigger migration to new hooks -# From: https://pagure.io/pagure/c/4937c4e266b2d1a2583b793128f87c66c96a7d5e -Patch0002: 0002-Bypass-old-hooks-rather-than-using-non-existing-syml.patch +# Allow Pagure to work with python-redis >= 3.0.0 +# From: https://pagure.io/pagure/c/2b1a46a3b97af49938d4d4f0d08354e5950aaf86 +Patch0001: 0001-Allow-using-Pagure-with-python-redis-3.0.0.patch +# Fix Pagure to work with Markdown >= 3.0 +# From: https://pagure.io/pagure/c/f5f4b297b2cee938e7e13064c7e55ef7c6426bfd +Patch0002: 0002-Fix-Markdown-usage-to-work-with-Markdown-3.0.patch # SUSE-specific fixes # Change the defaults in the example config to match packaging @@ -76,13 +76,12 @@ BuildRequires: python3-Markdown BuildRequires: python3-nose BuildRequires: python3-Pillow BuildRequires: python3-psutil -BuildRequires: python3-pygit2 >= 0.24.0 -BuildRequires: python3-Pygments +BuildRequires: python3-pygit2 >= 0.26.0 #BuildRequires: python3-fedora-flask BuildRequires: python3-python3-openid BuildRequires: python3-python-openid-cla BuildRequires: python3-python-openid-teams -BuildRequires: python3-SQLAlchemy > 0.8 +BuildRequires: python3-SQLAlchemy >= 0.8 BuildRequires: python3-straight-plugin BuildRequires: python3-WTForms BuildRequires: python3-munch @@ -106,8 +105,7 @@ Requires: python3-Flask-WTF Requires: python3-Markdown Requires: python3-Pillow Requires: python3-psutil -Requires: python3-pygit2 >= 0.24.0 -Requires: python3-Pygments +Requires: python3-pygit2 >= 0.26.0 #Requires: python3-fedora-flask Requires: python3-python3-openid Requires: python3-python-openid-cla @@ -327,6 +325,9 @@ install -p -m 644 createdb.py %{buildroot}/%{_datadir}/pagure/pagure_createdb.py # Install the api_key_expire_mail.py script install -p -m 644 files/api_key_expire_mail.py %{buildroot}/%{_datadir}/pagure/api_key_expire_mail.py +# Install the mirror_project_in.py script +install -p -m 644 files/mirror_project_in.py $RPM_BUILD_ROOT/%{_datadir}/pagure/mirror_project_in.py + # Install the keyhelper and aclcheck scripts mkdir -p %{buildroot}/%{_libexecdir}/pagure install -p -m 755 files/aclchecker.py %{buildroot}/%{_libexecdir}/pagure/aclchecker.py @@ -374,6 +375,12 @@ install -p -m 644 files/pagure_api_key_expire_mail.service \ install -p -m 644 files/pagure_api_key_expire_mail.timer \ %{buildroot}/%{_unitdir}/pagure_api_key_expire_mail.timer +# Install the systemd file for the script updating mirrored project +install -p -m 644 files/pagure_mirror_project_in.service \ + $RPM_BUILD_ROOT/%{_unitdir}/pagure_mirror_project_in.service +install -p -m 644 files/pagure_mirror_project_in.timer \ + $RPM_BUILD_ROOT/%{_unitdir}/pagure_mirror_project_in.timer + # Install the milter files mkdir -p %{buildroot}/%{_tmpfilesdir} install -p -m 0644 pagure-milters/milter_tempfile.conf \ @@ -398,12 +405,9 @@ sed -e "s|/usr/libexec|%{_libexecdir}|g" -i %{buildroot}/%{python3_sitelib}/pagu # Fix the shebang for various scripts sed -e "s|#!/usr/bin/env python|#!%{__python3}|" -i \ - %{buildroot}/%{_libexecdir}/pagure-ev/pagure_stream_server.py \ - %{buildroot}/%{_libexecdir}/pagure/aclchecker.py \ - %{buildroot}/%{_libexecdir}/pagure/keyhelper.py \ - %{buildroot}/%{_datadir}/pagure/comment_email_milter.py \ - %{buildroot}/%{_datadir}/pagure/pagure_createdb.py \ - %{buildroot}/%{_datadir}/pagure/api_key_expire_mail.py \ + %{buildroot}/%{_libexecdir}/pagure-ev/*.py \ + %{buildroot}/%{_libexecdir}/pagure/*.py \ + %{buildroot}/%{_datadir}/pagure/*.py \ %{buildroot}/%{python3_sitelib}/pagure/hooks/files/*.py \ %{buildroot}/%{python3_sitelib}/pagure/hooks/files/hookrunner \ %{buildroot}/%{python3_sitelib}/pagure/hooks/files/post-receive \ @@ -435,7 +439,7 @@ done # Make the rcFOO symlinks for systemd services mkdir -p %{buildroot}/%{_sbindir} -paguresvcs="api_key_expire_mail ci ev gitolite_worker loadjson logcom milter mirror webhook worker" +paguresvcs="api_key_expire_mail ci ev gitolite_worker loadjson logcom milter mirror webhook worker mirror_project_in" for paguresvc in $paguresvcs; do ln -sf %{_sbindir}/service %{buildroot}/%{_sbindir}/rcpagure_$paguresvc done @@ -469,6 +473,7 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %systemd_post pagure_worker.service %systemd_post pagure_gitolite_worker.service %systemd_post pagure_api_key_expire_mail.timer +%systemd_post pagure_mirror_project_in.timer %post milters %tmpfiles_create %{_tmpfilesdir}/%{name}-milter.conf %systemd_post pagure_milter.service @@ -487,7 +492,9 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %preun %systemd_preun pagure_worker.service +%systemd_preun pagure_gitolite_worker.service %systemd_preun pagure_api_key_expire_mail.timer +%systemd_preun pagure_mirror_project_in.timer %preun milters %systemd_preun pagure_milter.service %preun ev @@ -507,6 +514,7 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %systemd_postun_with_restart pagure_worker.service %systemd_postun_with_restart pagure_gitolite_worker.service %systemd_postun pagure_api_key_expire_mail.timer +%systemd_postun pagure_mirror_project_in.timer %postun milters %systemd_postun_with_restart pagure_milter.service %postun ev @@ -549,9 +557,12 @@ echo "See %{_docdir}/%{name}/README.SUSE to continue" %{_unitdir}/pagure_gitolite_worker.service %{_unitdir}/pagure_api_key_expire_mail.service %{_unitdir}/pagure_api_key_expire_mail.timer +%{_unitdir}/pagure_mirror_project_in.service +%{_unitdir}/pagure_mirror_project_in.timer %{_sbindir}/rcpagure_api_key_expire_mail %{_sbindir}/rcpagure_worker %{_sbindir}/rcpagure_gitolite_worker +%{_sbindir}/rcpagure_mirror_project_in # Pagure data content %attr(-,git,git) %dir /srv/gitolite/pseudo %attr(-,git,git) %dir /srv/gitolite/remotes