#5478 Release 5.14.1
Merged 2 months ago by wombelix. Opened 2 months ago by wombelix.
wombelix/pagure feat_release_5.14.1  into  5.14.x

Support Redis Unix sockets
Georg Pfuetzenreuter • 2 months ago  
Fix package unretirement URL
Ewoud Kohl van Wijngaarden • 2 months ago  
file modified
+2 -2
@@ -20,7 +20,7 @@ 

  Playground version: https://stg.pagure.io

  

  If you have any questions or just would like to discuss about pagure,

- feel free to drop by on IRC in the channel ``#pagure`` of the freenode server

+ feel free to drop by `our Matrix room <https://matrix.to/#/#pagure:fedora.im>`_.

  

  

  About its name
@@ -59,7 +59,7 @@ 

  

      $ docker-compose -f dev/docker-compose.yml exec web python3 dev-data.py --all

  

- You can then login with any of the created users, by example:

+ You can then log in with any of the created users, by example:

  

  - username: pingou

  - password: testing123

file modified
+8
@@ -42,6 +42,14 @@ 

  

  * LOGGING_GIT_HOOKS

  

+ .. warning:: When upgrading MySQL database you can encounter issue with

+        incompatible columns. In this case try to check the collation of the

+        mentioned column by ``show full columns from <table>;`` in ``mysql``.

+        If the collation is something else then `utf8` you need to convert

+        your database to `utf8` first. See

+        `this guide <https://stackoverflow.com/questions/1294117/how-to-change-collation-of-database-table-column>`_

+        for how to do it or if you have SQL script for db setup,

+        you can change it directly in the script.

  

  From 5.9 to 5.10

  ----------------

@@ -19,6 +19,7 @@ 

      op.alter_column(

          'commit_flags',

          column_name='token_id',

+         existing_type=sa.String(64),

          nullable=False,

          existing_nullable=True

      )
@@ -28,6 +29,7 @@ 

      op.alter_column(

          'commit_flags',

          column_name='token_id',

+         existing_type=sa.String(64),

          nullable=True,

          existing_nullable=False

      )

@@ -6,7 +6,7 @@ 

  

  ### Set the time after which the admin session expires

  # There are two sessions on pagure, login that holds for 31 days and

- # the session defined here after which an user has to re-login.

+ # the session defined here after which an user has to log in again.

  # This session is used when accessing all administrative parts of pagure

  # (ie: changing a project's or a user's settings)

  ADMIN_SESSION_LIFETIME = timedelta(minutes=20000000)
@@ -20,7 +20,7 @@ 

  

  ### url to the database server:

  #DB_URL=mysql://user:pass@host/db_name

- #DB_URL=postgres://user:pass@host/db_name

+ #DB_URL=postgresql://user:pass@host/db_name

  DB_URL = 'sqlite:////srv/git/pagure_dev.sqlite'

  

  ### The FAS group in which the admin of pagure are

@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info -c 1 -Q authorized_keys_queue

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO -c 1 -Q authorized_keys_queue

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  Restart=on-failure

@@ -5,7 +5,7 @@ 

  

  [Service]

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info -Q pagure_ci

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO -Q pagure_ci

  Type=simple

  User=git

  Group=git

@@ -5,7 +5,7 @@ 

  

  [Service]

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info -Q pagure_webhook

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO -Q pagure_webhook

  Type=simple

  User=git

  Group=git

@@ -5,7 +5,7 @@ 

  

  [Service]

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

- ExecStart=celery -A pagure.lib.tasks worker --loglevel=info

+ ExecStart=celery -A pagure.lib.tasks worker --loglevel=INFO

  Type=simple

  User=git

  Group=git

@@ -21,7 +21,7 @@ 

      glibc-langpack-en

  

  RUN cd / \

-     && GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone -b $BRANCH $REPO \

+     && GIT_TRACE=1 git clone -b $BRANCH $REPO \

      && chmod +x /pagure/dev/containers/tox_py3.sh \

      && sed -i -e 's|"alembic-3"|"alembic"|' /pagure/tests/test_alembic.py

  

@@ -24,7 +24,7 @@ 

  RUN pip install pagure-messages

  

  RUN cd / \

-     && GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone -b $BRANCH $REPO \

+     && GIT_TRACE=1 git clone -b $BRANCH $REPO \

      && chmod +x /pagure/dev/containers/runtests_py3.sh

  

  # Install all the requirements from the spec file and replace the macro

file modified
+1 -1
@@ -6,7 +6,7 @@ 

  RUN mkdir /code

  WORKDIR /code

  

- ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks_services", "worker", "--loglevel", "info", "-Q", "pagure_logcom"]

+ ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks_services", "worker", "--loglevel", "INFO", "-Q", "pagure_logcom"]

  

  # Code injection is last to make optimal use of caches

  VOLUME ["/code"]

@@ -11,7 +11,7 @@ 

  git remote rm proposed || true

  git gc --auto

  git remote add proposed "$REPO"

- GIT_TRACE=1 GIT_CURL_VERBOSE=1 git fetch proposed

+ GIT_TRACE=1 git fetch proposed

  git checkout origin/master

  git config --global user.email "you@example.com"

  git config --global user.name "Your Name"
@@ -24,4 +24,4 @@ 

  

  sed -i -e "s|#!/usr/bin/env python|#!/usr/bin/env python3|" pagure/hooks/files/hookrunner

  

- pytest-3 -n auto ${TESTCASE:-tests/}

+ pytest-3 -rf -n auto ${TESTCASE:-tests/}

file modified
+1 -1
@@ -11,7 +11,7 @@ 

  git remote rm proposed || true

  git gc --auto

  git remote add proposed "$REPO"

- GIT_TRACE=1 GIT_CURL_VERBOSE=1 git fetch proposed

+ GIT_TRACE=1 git fetch proposed

  git checkout origin/master

  git config --global user.email "you@example.com"

  git config --global user.name "Your Name"

file modified
+1 -1
@@ -6,7 +6,7 @@ 

  RUN mkdir /code

  WORKDIR /code

  

- ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks", "worker", "--loglevel", "info"]

+ ENTRYPOINT ["/usr/bin/celery-3", "-A", "pagure.lib.tasks", "worker", "--loglevel", "INFO"]

  

  # Code injection is last to make optimal use of caches

  VOLUME ["/code"]

file modified
+75
@@ -3,6 +3,81 @@ 

  

  This document records all notable changes to `Pagure <https://pagure.io>`_.

  

+ 5.14.1 (2024-05-24)

+ -------------------

+ 

+ Feature:

+ 

+ - Support Redis Unix sockets `#5437 <https://pagure.io/pagure/pull-request/5437>`_ (Georg Pfuetzenreuter)

+ - Add a new admin command to clean a spam user `#5392 <https://pagure.io/pagure/pull-request/5392>`_ (Ryan Lerch)

+ - Add config option to restrict creating by OIDC groups `#5399 <https://pagure.io/pagure/pull-request/5399>`_ (Ryan Lerch)

+ - Add api endpoints for adding/removing user to group `#5416 <https://pagure.io/pagure/pull-request/5416>`_ (Michal Konecny)

+ - Add new monitoring options for release monitoring `#5294 <https://pagure.io/pagure/pull-request/5294>`_ (Michal Konečný)

+ - Add API endpoint for reopening pull requests `#5291 <https://pagure.io/pagure/pull-request/5291>`_ (Matej Focko)

+ - Add info about changed files to push notification payload `#5435 <https://pagure.io/pagure/pull-request/5435>`_ (Nikola Forró)

+ - Enable pull_request_update acl for user tokens `#5436 <https://pagure.io/pagure/pull-request/5436>`_ (Maja Massarini)

+ - Enable collaborators to merge pull requests `#5438 <https://pagure.io/pagure/pull-request/5438>`_ (Samyak Jain)

+ - Add pull request ID to push notification payload `#5452 <https://pagure.io/pagure/pull-request/5452>`_ (Nikola Forró)

+ - Owner of a PR can update is own PR `#5457 <https://pagure.io/pagure/pull-request/5457>`_ (Maja Massarini)

+ - Add history button to the tree view `#5184 <https://pagure.io/pagure/pull-request/5184>`_ (Anatoli Babenia)

+ - dist-git: Added a condition that decides whether to use the stg or prod version of the link `#5468 <https://pagure.io/pagure/pull-request/5468>`_ (amedvede)

+ 

+ Fix:

+ 

+ - Reduce noise, remove GIT_CURL_VERBOSE=1 from git commands `#5440 <https://pagure.io/pagure/pull-request/5440>`_ (Frank Dana)

+ - libravatar.org account login url `#5367 <https://pagure.io/pagure/pull-request/5367>`_ (Dominik Wombacher)

+ - wrong reply icon in issues and pull requests `#5361 <https://pagure.io/pagure/pull-request/5361>`_ (Dominik Wombacher)

+ - Reorder celery arguments (and s/info/INFO/) `#5215 <https://pagure.io/pagure/pull-request/5215>`_ (Sergio Durigan Junior)

+ - Please make sure you give each node a unique nodename using the celery worker '-n' option `#5332 <https://pagure.io/pagure/pull-request/5332>`_ (Sérgio M. Basto)

+ - TypeError: BaseEventLoop.create_server() got an unexpected keyword argument 'loop' `#5332 <https://pagure.io/pagure/pull-request/5332>`_ (Sérgio M. Basto)

+ - dialect 'postgres://' deprecated in sqlalchemy `#5357 <https://pagure.io/pagure/pull-request/5357>`_ (Dominik Wombacher)

+ - Ensure the url we redirect to are full URLs `#5355 <https://pagure.io/pagure/pull-request/5355>`_ (Pierre-Yves Chibon)

+ - BROKER_URL default that honors REDIS_PORT and REDIS_DB `#5358 <https://pagure.io/pagure/pull-request/5358>`_ (Dominik Wombacher)

+ - Fix grammar issue `#5241 <https://pagure.io/pagure/pull-request/5241>`_ (AJ Jordan)

+ - Update Translation Status button `#5246 <https://pagure.io/pagure/pull-request/5246>`_ (Sundeep Anand)

+ - Crash when config:[ENABLE_DOCS = False] `#5475 <https://pagure.io/pagure/pull-request/5475>`_ (Dominik Wombacher)

+ - Added data-toggle attribute to missing tooltips `#5474 <https://pagure.io/pagure/pull-request/5474>`_ (Dominik Wombacher)

+ - Drop the ssh key from the information stored in the cookie `#5249 <https://pagure.io/pagure/pull-request/5249>`_ (Pierre-Yves Chibon)

+ - Fix for mysql alembic migration `#5280 <https://pagure.io/pagure/pull-request/5280>`_ (Michal Konečný)

+ - PR close in API for user token `#5206 <https://pagure.io/pagure/pull-request/5206>`_ (Michal Konečný)

+ - Ensuring integer for mqtt port, needed by paho-mqtt `#5290 <https://pagure.io/pagure/pull-request/5290>`_ (Fabian Arrotin)

+ - Change 'Browse All' emoji link `#5295 <https://pagure.io/pagure/pull-request/5295>`_ (Benjamin A. Beasley)

+ - Fix package unretirement URL `#5296 <https://pagure.io/pagure/pull-request/5296>`_ (Ewoud Kohl van Wijngaarden)

+ - error when logging exception on event listener `#5319 <https://pagure.io/pagure/pull-request/5319>`_ (Michal Konečný)

+ - typo on pagure_authorized_keys_worker.service `#5331 <https://pagure.io/pagure/pull-request/5331>`_ (Sérgio M. Basto)

+ - fix object of 'rebased onto' comment `#5341 <https://pagure.io/pagure/pull-request/5341>`_ (Adam Williamson)

+ - mirror_project_in: unused '--check' arg removed, description adjusted `#5356 <https://pagure.io/pagure/pull-request/5356>`_ (Dominik Wombacher)

+ - theme: long words in source nav break layout `#5363 <https://pagure.io/pagure/pull-request/5363>`_ (Dominik Wombacher)

+ - user_settings: unable to change default email `#5364 <https://pagure.io/pagure/pull-request/5364>`_ (Dominik Wombacher)

+ - cannot import name 'escape' from 'jinja2' `#5360 <https://pagure.io/pagure/pull-request/5360>`_ (Dominik Wombacher)

+ - Fix query filter for date ranges `#5385 <https://pagure.io/pagure/pull-request/5385>`_ (Michal Konečný)

+ - cli/admin: Shorten message to fit length rule for the style check `#5398 <https://pagure.io/pagure/pull-request/5398>`_ (Neal Gompa)

+ - grammar of "log in" `#5382 <https://pagure.io/pagure/pull-request/5382>`_ (Zbigniew Jędrzejewski-Szmek)

+ - English improvements `#5454 <https://pagure.io/pagure/pull-request/5454>`_ (Jerry James)

+ - Update pagure/themes/srcfpo/templates/repo_info.html `#5446 <https://pagure.io/pagure/pull-request/5446>`_ (Sundeep Anand)

+ - Changed logic with using PDC for getting inactive branches to use bodhi instead `#5419 <https://pagure.io/pagure/pull-request/5419>`_ (amedvede)

+ - File history page breadcrumb fixes `#5201 <https://pagure.io/pagure/pull-request/5201>`_ (L. Guruprasad)

+ - Extra whitespace in "packages" on src.fpo front page `#5476 <https://pagure.io/pagure/pull-request/5476>`_ (Dominik Wombacher)

+ 

+ Security Fix:

+ 

+ - Argument Injection in PagureRepo.log() rhbz#2277121 `#5481 <https://pagure.io/pagure/pull-request/5481>`_ (Thomas Chauchefoin)

+ - CVE-2024-4982: Path traversal in view_issue_raw_file() rhbz#2279411 `#5484 <https://pagure.io/pagure/pull-request/5484>`_ (Thomas Chauchefoin and Dominik Wombacher)

+ - CVE-2024-4981: _update_file_in_git() follows symbolic links in temporary clones rhbz#2278745 `#5483 <https://pagure.io/pagure/pull-request/5483>`_ (Thomas Chauchefoin and Dominik Wombacher)

+ - generate_archive() follows symbolic links in temporary clones rhbz#2280030 `#5482 <https://pagure.io/pagure/pull-request/5482>`_ (Thomas Chauchefoin and Dominik Wombacher)

+ 

+ Docs:

+ 

+ - Add some basic documentation for boards `#5237 <https://pagure.io/pagure/pull-request/5237>`_ (Ben Cotton)

+ - Document MySQL migration issue `#5282 <https://pagure.io/pagure/pull-request/5282>`_ (Michal Konečný)

+ - Add API key information to Jenkins CI setup `#5347 <https://pagure.io/pagure/pull-request/5347>`_ (Michal Konečný)

+ - Add Global security step to Jenkins CI configuration `#5348 <https://pagure.io/pagure/pull-request/5348>`_ (Michal Konečný)

+ - Update pagure CI guide `#5349 <https://pagure.io/pagure/pull-request/5349>`_ (Michal Konečný)

+ - install: filename apache sample config wrong `#5362 <https://pagure.io/pagure/pull-request/5362>`_ (Dominik Wombacher)

+ - Update chatroom reference to the new official Matrix room `#5409 <https://pagure.io/pagure/pull-request/5409>`_ (Neal Gompa)

+ - Remove deprecated smart_strong xtn `#5430 <https://pagure.io/pagure/pull-request/5430>`_ (Frank Dana)

+ 

+ 

  5.13.3 (2021-11-01)

  -------------------

  - Warn users when a PR contains some characters

file modified
+25 -6
@@ -44,7 +44,7 @@ 

  ::

  

      DB_URL = 'mysql://user:pass@host/db_name'

-     DB_URL = 'postgres://user:pass@host/db_name'

+     DB_URL = 'postgresql://user:pass@host/db_name'

      DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite'

  

  Defaults to ``sqlite:////var/tmp/pagure_dev.sqlite``
@@ -105,10 +105,10 @@ 

  is the broker that is used to communicate between the web application and

  its workers.

  

- Defaults to: ``'redis://%s' % APP.config['REDIS_HOST']``

+ Defaults to: ``"redis://%s:%d/%d" % (pagure_config["REDIS_HOST"], pagure_config["REDIS_PORT"], pagure_config["REDIS_DB"])``

  

- .. note:: See the :ref:`redis-section` for the ``REDIS_HOST`` configuration

-           key

+ .. note:: See the :ref:`redis-section` for the ``REDIS_HOST``, ``REDIS_PORT``

+           and ``REDIS_DB``configuration keys

  

  

  Repo Directories
@@ -1266,6 +1266,25 @@ 

  Defaults to: ``True``

  

  

+ RESTRICT_CREATE_BY_OIDC_GROUP

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ This configuration key, when defined, only allows users that are a member of the group defined

+ the ability to create new projects and groups.

+ 

+ Defaults to: ``None``

+ 

+ 

+ RESTRICT_CREATE_BY_OIDC_GROUP_COUNT

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ 

+ This configuration key, when defined, only allows users that are a member of the group defined

+ by RESTRICT_CREATE_BY_OIDC_GROUP and a member of at least the number of groups defined by this

+ key the ability to create new projects.

+ 

+ Defaults to: 0

+ 

+ 

  ENABLE_DEL_PROJECTS

  ~~~~~~~~~~~~~~~~~~~

  
@@ -1747,9 +1766,9 @@ 

  ~~~~~~~~~~~~~~~~~~~~~~

  

  This configuration key allows specifying the lifetime of the session during

- which the user won't have to re-login for admin actions.

+ which the user won't have to log in again for admin actions.

  In other words, the maximum time between which an user can access a project's

- settings page without re-login.

+ settings page without a re-login.

  

  Defaults to: ``timedelta(minutes=20)``

  

file modified
+2 -2
@@ -29,5 +29,5 @@ 

     idea but don't know how to implement it, you just have something bugging

     you?

  

-    Come to see us on IRC: ``#pagure`` or ``#fedora-apps`` on

-    irc.freenode.net or directly on `the project <http://pagure.io>`_.

+    Come to see us on Matrix: ``#pagure:fedora.im`` or directly on

+    `the project <http://pagure.io>`_.

file modified
+30 -11
@@ -3,13 +3,13 @@ 

  

  Pagure would be nothing without its contributors.

  

- On November 1, 2021 (release 5.13.3) the list looks as follow:

+ On May 24, 2024 (release 5.14.1) the list looks as follow:

  

  =================  ===========

  Number of commits  Contributor

  =================  ===========

-   6901              Pierre-Yves Chibon <pingou@pingoured.fr>

-    328              Ryan Lerch <rlerch@redhat.com>

+   6905              Pierre-Yves Chibon <pingou@pingoured.fr>

+    330              Ryan Lerch <rlerch@redhat.com>

     172              Vivek Anand <vivekanand1101@gmail.com>

     147              Julen Landa Alustiza <jlanda@fedoraproject.org>

     139              farhaanbukhsh <farhaan.bukhsh@gmail.com>
@@ -33,8 +33,10 @@ 

      19              Gaurav Kumar <aavrug@gmail.com>

      19              Lenka Segura <lenka@sepu.cz>

      18              Abhijeet Kasurde <akasurde@redhat.com>

+     18              Adam Williamson <awilliam@redhat.com>

+     18              Dominik Wombacher <dominik@wombacher.cc>

+     18              Michal Konečný <mkonecny@redhat.com>

      18              Sayan Chowdhury <sayan.chowdhury2012@gmail.com>

-     17              Adam Williamson <awilliam@redhat.com>

      17              Brian Stinson <brian@bstinson.com>

      17              Ralph Bean <rbean@redhat.com>

      15              Igor Gnatenko <ignatenkobrain@fedoraproject.org>
@@ -43,6 +45,7 @@ 

      13              Ghost-script <subho.prp@gmail.com>

      13              Martin Basti <mbasti@redhat.com>

      13              Mathieu Bridon <bochecha@fedoraproject.org>

+     11              Anatoli Babenia <anatoli@rainforce.org>

      11              Shengjing Zhu <zsj950618@gmail.com>

       9              Björn Persson <Bjorn@Rombobjörn.se>

       9              Michael Watters <michael.watters@dart.biz>
@@ -50,13 +53,12 @@ 

       8              Lei Yang <yltt1234512@gmail.com>

       8              Michael Scherer <misc@redhat.com>

       8              Paul W. Frields <stickster@gmail.com>

-      7              Anatoli Babenia <anatoli@rainforce.org>

+      8              Sergio Durigan Junior <sergiodj@sergiodj.net>

       7              René Genz <liebundartig@freenet.de>

-      7              Sergio Durigan Junior <sergiodj@sergiodj.net>

       7              zPlus <zplus@peers.community>

-      6              Michal Konečný <mkonecny@redhat.com>

       6              ymdatta <ymdatta@protonmail.com>

       5              Fabio Valentini <decathorpe@gmail.com>

+      5              FeRD (Frank Dana) <ferdnyc@gmail.com>

       5              Lukas Holecek <hluk@email.cz>

       5              Mike McLean <mikem@redhat.com>

       5              Oliver Gutierrez <ogutierrez@redhat.com>
@@ -70,6 +72,7 @@ 

       4              Eric Barbour <ebarbour@redhat.com>

       4              Maciej Lasyk <maciek@lasyk.info>

       4              Miro Hrončok <miro@hroncok.cz>

+      4              Nikola Forró <nforro@redhat.com>

       4              clime <clime@redhat.com>

       3              Akanksha <akanksha_mishra01@yahoo.com>

       3              Ankush Behl <cloudbehl@gmail.com>
@@ -77,15 +80,18 @@ 

       3              Chenxiong Qi <cqi@redhat.com>

       3              Dhriti Shikhar <dhriti.shikhar.rokz@gmail.com>

       3              Eric Barbour <emb4gu@virginia.edu>

-      3              FeRD (Frank Dana) <ferdnyc@gmail.com>

       3              Jan Pokorný <jpokorny@redhat.com>

       3              Jason Tibbitts <tibbs@math.uh.edu>

       3              Kushal Khandelwal <kushal124@gmail.com>

+      3              L. Guruprasad <lgp171188@gmail.com>

+      3              Maja Massarini <mmassari@redhat.com>

       3              Pedro Lima <pedro.lima@gmail.com>

       3              Pierre-YvesChibon <pingou@fedoraproject.org>

       3              Ricky Elrod <ricky@elrod.me>

       3              Ryan Lerch <rlerch@localhost.localdomain>

       3              Stefan Bühler <stbuehler@web.de>

+      3              Sérgio M. Basto <sergio@serjux.com>

+      3              amedvede <amedvede@redhat.com>

       3              bill auger <mr.j.spam.me@gmail.com>

       3              cep <breathingcode@gmail.com>

       3              shivani <smshivani579@gmail.com>
@@ -98,10 +104,12 @@ 

       2              Fabian Arrotin <fabian.arrotin@arrfab.net>

       2              František Zatloukal <fzatlouk@redhat.com>

       2              Hervé Beraud <hberaud@redhat.com>

+      2              Jerry James <loganjerry@gmail.com>

       2              Kamil Páral <kparal@redhat.com>

       2              Luis Guzman <ark@switnet.org>

       2              MR <mrx@mailinator.com>

       2              Mohan Boddu <mboddu@bhujji.com>

+      2              Neal Gompa <neal@gompa.dev>

       2              Neha Kandpal <iec2015048@iiita.ac.in>

       2              Nuno Maltez <nuno@cognitiva.com>

       2              Ompragash <om.apsara@gmail.com>
@@ -110,17 +118,20 @@ 

       2              Richard Marko <rmarko@fedoraproject.org>

       2              Simo Sorce <simo@redhat.com>

       2              Stasiek Michalski <hellcp@opensuse.org>

+      2              Sundeep Anand <suanand@redhat.com>

       2              Tim Flink <tflink@fedoraproject.org>

       2              Tim Landscheidt <tim@tim-landscheidt.de>

       2              Todd Zullinger <tmz@pobox.com>

       2              William Moreno Reyes <williamjmorenor@gmail.com>

       2              Your Name <jlanda@fedoraproject.org>

+      2              Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>

       2              bruno <bruno@wolff.to>

       2              dhrish20 <dhrish20@gmail.com>

       2              hellcp <hellcp@opensuse.org>

       2              siddharthvipul <siddharthvipul1@gmail.com>

       2              yadneshk <yadnesh45@gmail.com>

       2              “AnjaliPardeshi” <“anjalipardeshi92@gmail.com”>

+      1              AJ Jordan <alex@strugee.net>

       1              Akanksha Mishra <akanksha_mishra01@yahoo.com>

       1              Aleksandra Fedorova (bookwar) <afedorova@mirantis.com>

       1              Alexander Scheel <ascheel@redhat.com>
@@ -130,6 +141,8 @@ 

       1              Anthony Lackey <alackey@localhost.localdomain>

       1              Antoni Segura Puimedon <celebdor@gmail.com>

       1              Arti Laddha <artiladdha53@gmail.com>

+      1              Ben Cotton <bcotton@fedoraproject.org>

+      1              Benjamin A. Beasley <code@musicinmybrain.net>

       1              Brendan Early <mymindstorm@evermiss.net>

       1              Brian (bex) Exelbierd <bex@pobox.com>

       1              Carl George <carl@george.computer>
@@ -138,14 +151,16 @@ 

       1              David Caro <dcaroest@redhat.com>

       1              Devesh Kumar Singh <deveshkusingh@gmail.com>

       1              Eashan <eashankadam@gmail.com>

+      1              Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>

+      1              Fabian Arrotin <arrfab@centos.org>

       1              Felix Yan <felixonmars@users.sf.net>

       1              Filip Valder <fvalder@redhat.com>

       1              Frank Dana (FeRD) <ferdnyc@gmail.com>

+      1              Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>

       1              Haikel Guemar <hguemar@fedoraproject.org>

       1              Hazel Smith <hazel@hazelesque.uk>

       1              Jan Kuparinen <copper_fin@hotmail.com>

       1              Jeremy Cline <jcline@redhat.com>

-      1              Jerry James <loganjerry@gmail.com>

       1              Jingjing Shao <sanri.ok@163.com>

       1              John Florian <jflorian@doubledog.org>

       1              Jun Aruga <jaruga@redhat.com>
@@ -157,7 +172,9 @@ 

       1              Lukas Brabec <lbrabec@redhat.com>

       1              Mark O Brien <markobri@redhat.com>

       1              Mary Kate Fain <mk@marykatefain.com>

+      1              Matej Focko <mfocko@redhat.com>

       1              Mathew Robinson <mathew.robinson3114@gmail.com>

+      1              Michal Konecny <mkonecny@redhat.com>

       1              Michal Srb <michal@redhat.com>

       1              Michel Alexandre Salim <michel@michel-slm.name>

       1              Mohan Boddu <mboddu@redhat.com>
@@ -171,17 +188,18 @@ 

       1              Romain DEP. <rom1dep@gmail.com>

       1              Ryan Lerch <ryanlerch@gmail.com>

       1              Sachin Kamath <sskamath96@gmail.com>

+      1              Samyak Jain <samyak.jn11@gmail.com>

       1              Snehal Karale <skarale@redhat.com>

       1              Stanislav Laznicka <slaznick@redhat.com>

       1              Stanislav Ochotnicky <sochotnicky@redhat.com>

       1              Stephen Gallagher <sgallagh@redhat.com>

-      1              Sundeep Anand <suanand@redhat.com>

+      1              Sundeep Anand <suanand@fedoraproject.org>

+      1              Thomas Chauchefoin <thomas@chauchefoin.fr>

       1              Tiago M. Vieira <tiago@tvieira.com>

       1              Till Hofmann <hofmann@kbsg.rwth-aachen.de>

       1              Vadim Rutkovsky <vrutkovs@redhat.com>

       1              Vyacheslav Anzhiganov <vanzhiganov@ya.ru>

       1              Yves Martin <ymartin1040@gmail.com>

-      1              Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>

       1              abhishek <abhishekarora12@gmail.com>

       1              abhishek goswami <abhishekg785@gmail.com>

       1              alunux <fadlun.net@gmail.com>
@@ -191,6 +209,7 @@ 

       1              anshukira <aks.anshu03@gmail.com>

       1              chocos10 <iec2015048@iiita.ac.in>

       1              d3prof3t <saurabhpysharma@gmail.com>

+      1              four_4 <fruitloopsgo@gmail.com>

       1              ishcherb <ishcherb@redhat.com>

       1              jcvicelli <jcvicelli@gmail.com>

       1              josef radinger <cheese@nosuchhost.net>

file modified
+14 -14
@@ -101,19 +101,19 @@ 

  

  # Install the additional files as follow:

  

- +------------------------------+------------------------------------------+

- |         Source               |             Destination                  |

- +=============================+===========================================+

- | ``files/pagure.cfg.sample``  | ``/etc/pagure/pagure.cfg``               |

- +------------------------------+------------------------------------------+

- | ``files/alembic.ini``        | ``/etc/pagure/alembic.ini``              |

- +------------------------------+------------------------------------------+

- | ``files/pagure.conf``        | ``/etc/httpd/conf.d/pagure.conf``        |

- +------------------------------+------------------------------------------+

- | ``files/pagure.wsgi``        | ``/usr/share/pagure/pagure.wsgi``        |

- +------------------------------+------------------------------------------+

- | ``createdb.py``              | ``/usr/share/pagure/pagure_createdb.py`` |

- +------------------------------+------------------------------------------+

+ +------------------------------------+------------------------------------------+

+ |         Source                     |             Destination                  |

+ +====================================+==========================================+

+ | ``files/pagure.cfg.sample``        | ``/etc/pagure/pagure.cfg``               |

+ +------------------------------------+------------------------------------------+

+ | ``files/alembic.ini``              | ``/etc/pagure/alembic.ini``              |

+ +------------------------------------+------------------------------------------+

+ | ``files/pagure-apache-httpd.conf`` | ``/etc/httpd/conf.d/pagure.conf``        |

+ +------------------------------------+------------------------------------------+

+ | ``files/pagure.wsgi``              | ``/usr/share/pagure/pagure.wsgi``        |

+ +------------------------------------+------------------------------------------+

+ | ``createdb.py``                    | ``/usr/share/pagure/pagure_createdb.py`` |

+ +------------------------------------+------------------------------------------+

  

  

  
@@ -160,7 +160,7 @@ 

  at: ``/etc/httpd/conf.d/pagure.conf``.

  

  If not installed by RPM, the example file is present in the sources at:

- ``files/pagure.conf``.

+ ``files/pagure-apache-httpd.conf``.

  

  Adjust it for your needs.

  

file added
+44
@@ -0,0 +1,44 @@ 

+ Using Boards

+ ============

+ 

+ Pagure provides basic `kanban board <https://en.wikipedia.org/wiki/Kanban_(development)>`_ functionality.

+ This allows the state of issues to be represented visually.

+ The feature requires a specific, admin-defined tag to appear on a board.

+ A repository may contain multiple boards, each with a different tag.

+ 

+ 

+ Creating a Board

+ ----------------

+ 

+ #. From the ``Settings`` tab, select ``Boards``

+ #. Click the ``Add a new board`` button

+ #. Enter a descriptive name in the ``Board name`` text box

+ #. Select the tag to use in the ``Tag`` drop down

+ #. Ensure the ``Active`` checkbox is checked

+ #. Click the ``Update`` button to create the board

+ 

+ After the board is created, add the status columns.

+ 

+ #. While still on the ``Boards`` settings, click the wrench icon button

+ #. If you want to use the default statuses (``Backlog``, ``Triaged``, ``In Progress``, ``In Review``, ``Done``, ``Blocked``), click the ``Populate with defaults`` button.

+ #. If you wish to add non-default statuses, click the ``Add new status`` button

+     #. Enter a name for the status in the ``Status name`` text box

+     #. If you want this status to be the default for issues added to the board, select the ``Default`` radio button.

+     #. If you want this status to close the issue, check the ``Close`` check box

+     #. Select the ``Color`` for the status on the board. This is for visual distinctness; you do not have to change it.

+     #. Repeat until all of the desired statuses are added

+ #. Click and drag the arrows to reorder the statuses, if desired.

+ #. Click the ``Update`` button when finished.

+ 

+ Using Boards

+ ------------

+ 

+ To add an issue to a board, add the board's label to the issue.

+ Alternatively, you can add an existing issue to the board by clicking the plus sign on the desired status column and adding the issue number.

+ 

+ To change the status of an issue. go to the ``Boards`` tab and drag the card on the board into the desired status column.

+ The status appears on the issue under the ``Boards`` information, but it cannot be changed from the issue.

+ 

+ If you drag an issue to a column that has the ``Close`` boolean set, Pagure will automatically close the issue.

+ 

+ .. note:: If you close an issue directly, Pagure will remove the board's label.

file modified
+4 -4
@@ -6,8 +6,8 @@ 

  When coming to pagure for the first time there are a few things one should

  do or check to ensure all works as desired.

  

- Login to pagure or create your account

- --------------------------------------

+ Log in to pagure or create your account

+ ---------------------------------------

  

  Pagure has its own user account system.

  
@@ -16,7 +16,7 @@ 

  pagure.io, the Fedora Account System) via OpenID, the local user account

  is created upon login.

  

- This means, you cannot be added to a group or a project before you login for

+ This means, you cannot be added to a group or a project before you log in for

  the first time as the system will simply not know you.

  

  If you run your own pagure instance which uses the local authentication
@@ -54,7 +54,7 @@ 

  

  To upload your public key onto pagure:

  

- 1. Login into pagure and click on the user icon on

+ 1. Log in to pagure and click on the user icon on

  the top right corner, there, select ``My settings``.

  

  .. image:: _static/pagure_my_settings.png

file modified
+1
@@ -59,6 +59,7 @@ 

     upgrade_db

     pagure_ci

     quick_replies

+    board

     troubleshooting

     tips_tricks

  

file modified
-1
@@ -16,7 +16,6 @@ 

  - `Definition Lists <https://python-markdown.github.io/extensions/definition_lists/>`_

  - `Fenced Code Blocks <https://python-markdown.github.io/extensions/fenced_code_blocks/>`_

  - `Tables <https://python-markdown.github.io/extensions/tables/>`_

- - `Smart Strong <https://python-markdown.github.io/extensions/smart_strong/>`_

  - `Admonition <https://python-markdown.github.io/extensions/admonition/>`_

  - `CodeHilite <https://python-markdown.github.io/extensions/code_hilite/>`_

  - `Sane lists <https://python-markdown.github.io/extensions/sane_lists/>`_

@@ -121,3 +121,32 @@ 

      fi

  

      # Part of the script specific to how you run the tests on your project

+ 

+ * To use the URL to POST results you need to add CI token to Jenkins instance.

+   This token could be found in Pagure project `Settings` -> `Hooks` -> `Pagure CI`.

+   In Jenkins add it in `Manage Jenkins` -> `Manage Credentials` -> `Stores scoped to Jenkins`

+   -> `Jenkins` -> `Global credentials (unrestricted)` -> `Add Credentials` as kind

+   `Secret text` (ID will be used in script).

+ 

+ Example function used in Jenkins pipeline script

+ 

+ ::

+ 

+    # 'pagure-auth' is the ID of the credentials

+ 

+    def notifyPagurePR(repo, msg, status, phase, credentials = 'pagure-auth'){

+        def json = JsonOutput.toJson([name: 'pagure', url: env.JOB_NAME, build: [full_url: currentBuild.absoluteUrl, status: status, number: currentBuild.number, phase: phase]])

+        println json

+ 

+        withCredentials([string(credentialsId: credentials, variable: "PAGURE_PUSH_SECRET")]) {

+            /* We need to notify pagure that jenkins finished but then pagure will

+              wait for jenkins to be done, so if we wait for pagure's answer we're

+              basically stuck in a loop where both jenkins and pagure are waiting

+              for each other */

+            sh "timeout 1 curl -X POST -d \'$json\' https://pagure.io/api/0/ci/jenkins/$repo/\${PAGURE_PUSH_SECRET}/build-finished -H \"Content-Type: application/json\" | true"

+        }

+    }

+ 

+ * To be able to trigger builds from Pagure CI you need to change the Global Security. Go

+   to `Manage Jenkins` -> `Configure Global Security` and find `Authorization` section.

+   In `Matrix-based security` add Read permission to `Anonymous Users` for Overall/Job/View.

@@ -30,6 +30,13 @@ 

  above is disabled in favor of the `merge` option.

  

  

+ `Boards`

+ --------------------------

+ 

+ The boards feature provides simple kanban board functionality by showing issues in columns that represent state.

+ The settings page lists existing boards and allows adminisrators to add new boards.

+ 

+ 

  `Comment editing`

  --------------------------

  

file modified
+4 -14
@@ -3,9 +3,6 @@ 

  from __future__ import print_function, absolute_import

  import os

  import argparse

- from datetime import datetime, timedelta

- 

- from sqlalchemy.exc import SQLAlchemyError

  

  import pagure.config

  import pagure.lib.model as model
@@ -22,13 +19,13 @@ 

  _config = pagure.config.reload_config()

  

  

- def main(check=False, debug=False):

-     """ The function pulls in all the changes from upstream"""

+ def main(debug=False):

+     """The function pulls in all the changes from upstream"""

  

      session = pagure.lib.model_base.create_session(_config["DB_URL"])

      projects = (

          session.query(model.Project)

-         .filter(model.Project.mirrored_from != None)

+         .filter(model.Project.mirrored_from is not None)

          .all()

      )

  
@@ -47,14 +44,7 @@ 

  

  if __name__ == "__main__":

      parser = argparse.ArgumentParser(

-         description="Script to send email before the api token expires"

-     )

-     parser.add_argument(

-         "--check",

-         dest="check",

-         action="store_true",

-         default=False,

-         help="Print the some output but does not send any email",

+         description="Script to PULL external repos into local (mirroring)"

      )

      parser.add_argument(

          "--debug",

file modified
+2 -2
@@ -3,7 +3,7 @@ 

  

  ### Set the time after which the admin session expires

  # There are two sessions on pagure, login that holds for 31 days and

- # the session defined here after which an user has to re-login.

+ # the session defined here after which an user has to log in again.

  # This session is used when accessing all administrative parts of pagure

  # (ie: changing a project's or a user's settings)

  ADMIN_SESSION_LIFETIME = timedelta(minutes=20)
@@ -20,7 +20,7 @@ 

  

  ### url to the database server:

  #DB_URL = 'mysql://user:pass@host/db_name'

- #DB_URL = 'postgres://user:pass@host/db_name'

+ #DB_URL = 'postgresql://user:pass@host/db_name'

  DB_URL = 'sqlite:////var/tmp/pagure_dev.sqlite'

  

  ### Send FedMsg notifications of events in pagure

file modified
+4 -1
@@ -16,7 +16,7 @@ 

  

  

  Name:               pagure

- Version:            5.13.3

+ Version:            5.14.1

  Release:            1%{?dist}

  Summary:            A git-centered forge

  
@@ -568,6 +568,9 @@ 

  

  

  %changelog

+ * Fri May 24 2024 Dominik Wombacher <dominik@wombacher.cc> - 5.14.1-1

+ - Update to 5.14.1

+ 

  * Mon Nov 01 2021 Pierre-Yves Chibon <pingou@pingoured.fr> - 5.13.3-1

  - Update to 5.13.3

  

@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info -c 1 -Q authorized_keys_queue

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=INFO -c 1 -Q authorized_keys_queue -n authorized_keys

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_ci

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_ci

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info -c 1 -Q gitolite_queue

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=INFO -c 1 -Q gitolite_queue -n gitolite

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_loadjson

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_loadjson -n load_json

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_logcom

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_logcom -n logcom

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -13,7 +13,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_mirror --loglevel=info -Q pagure_mirror

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_mirror worker --loglevel=INFO -Q pagure_mirror

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=mirror

file modified
+1 -1
@@ -8,7 +8,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks_services --loglevel=info -Q pagure_webhook

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks_services worker --loglevel=INFO -Q pagure_webhook -n webhook

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

file modified
+1 -1
@@ -4,7 +4,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=INFO -n worker

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

@@ -10,7 +10,7 @@ 

  Documentation=https://pagure.io/pagure

  

  [Service]

- ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info -Q <queue_name>

+ ExecStart=/usr/bin/celery -A pagure.lib.tasks worker --loglevel=INFO -Q <queue_name>

  Environment="PAGURE_CONFIG=/etc/pagure/pagure.cfg"

  Type=simple

  User=git

@@ -170,7 +170,7 @@ 

      try:

          obj = get_obj_from_path(url.path)

      except PagureException as err:

-         log.warning(err.message)

+         log.warning(str(err))

          return

  

      origin = pagure.config.config.get("APP_URL")
@@ -253,7 +253,6 @@ 

              handle_client,

              host=None,

              port=pagure.config.config["EVENTSOURCE_PORT"],

-             loop=loop,

          )

          SERVER = loop.run_until_complete(coro)

          log.info(
@@ -264,7 +263,6 @@ 

                  stats,

                  host=None,

                  port=pagure.config.config.get("EV_STATS_PORT"),

-                 loop=loop,

              )

              stats_server = loop.run_until_complete(stats_coro)

              log.info(

file modified
+1 -1
@@ -12,4 +12,4 @@ 

  

  

  __api_version__ = "0.31"

- __version__ = "5.13.3"

+ __version__ = "5.14.1"

file modified
+14 -1
@@ -20,6 +20,7 @@ 

  import functools

  import logging

  import os

+ import sys

  

  import docutils

  import enum
@@ -44,6 +45,9 @@ 

  

  _log = logging.getLogger(__name__)

  

+ # Mitigate bug in flask-wtf 0.14.2 on EL8 for 5.14.1 release

+ sys.modules["werkzeug.url_encode"] = "werkzeug.urls.url_encode"

+ 

  

  def preload_docs(endpoint):

      """ Utility to load an RST file and turn it into fancy HTML. """
@@ -113,6 +117,9 @@ 

      ENEWPROJECTDISABLED = (

          "Creating project have been disabled for this instance"

      )

+     ENEWPROJECTFORBIDDEN = (

+         "You are not allowed to create new projects on this instance"

+     )

      ETIMESTAMP = "Invalid timestamp format"

      EDATETIME = "Invalid datetime format"

      EINVALIDISSUEFIELD = "Invalid custom field submitted"
@@ -589,6 +596,7 @@ 

          fork.api_pull_request_merge,

          fork.api_pull_request_rebase,

          fork.api_pull_request_close,

+         fork.api_pull_request_reopen,

          fork.api_pull_request_add_comment,

          fork.api_pull_request_add_flag,

          fork.api_pull_request_get_flag,
@@ -609,7 +617,12 @@ 

      ]

      sections.append(build_docs_section("users", users_methods))

  

-     groups_methods = [group.api_groups, group.api_view_group]

+     groups_methods = [

+         group.api_groups,

+         group.api_view_group,

+         group.api_group_add_member,

+         group.api_group_remove_member,

+     ]

      sections.append(build_docs_section("groups", groups_methods))

  

      plugins_methods = [

file modified
+74 -3
@@ -503,7 +503,7 @@ 

      _check_token(repo, project_token=False)

  

      request = _get_request(repo, requestid)

-     _check_pull_request_access(request, assignee=True)

+     _check_pull_request_access(request, assignee=True, allow_author=True)

  

      form = pagure.forms.RequestPullForm(csrf_enabled=False)

      if not form.validate_on_submit():
@@ -770,10 +770,13 @@ 

  

      repo = _get_repo(repo, username, namespace)

      _check_pull_request(repo)

-     _check_token(repo)

+     _check_token(repo, project_token=False)

      request = _get_request(repo, requestid)

  

-     if not is_repo_committer(repo):

+     if (

+         not is_repo_committer(repo)

+         and not flask.g.fas_user.username == request.user.username

+     ):

          raise pagure.exceptions.APIError(403, error_code=APIERROR.ENOPRCLOSE)

  

      try:
@@ -791,6 +794,74 @@ 

      return jsonout

  

  

+ @API.route("/<repo>/pull-request/<int:requestid>/reopen", methods=["POST"])

+ @API.route(

+     "/<namespace>/<repo>/pull-request/<int:requestid>/reopen", methods=["POST"]

+ )

+ @API.route(

+     "/fork/<username>/<repo>/pull-request/<int:requestid>/reopen",

+     methods=["POST"],

+ )

+ @API.route(

+     "/fork/<username>/<namespace>/<repo>/pull-request/<int:requestid>/reopen",

+     methods=["POST"],

+ )

+ @api_login_required(acls=["pull_request_close", "pull_request_update"])

+ @api_method

+ def api_pull_request_reopen(repo, requestid, username=None, namespace=None):

+     """

+     Reopen a pull-request

+     --------------------

+     Instruct Pagure to reopen a pull request.

+ 

+     ::

+ 

+         POST /api/0/<repo>/pull-request/<request id>/reopen

+         POST /api/0/<namespace>/<repo>/pull-request/<request id>/reopen

+ 

+     ::

+ 

+         POST /api/0/fork/<username>/<repo>/pull-request/<request id>/reopen

+         POST /api/0/fork/<username>/<namespace>/<repo>/pull-request/<request id>/reopen

+ 

+     Sample response

+     ^^^^^^^^^^^^^^^

+ 

+     ::

+ 

+         {

+           "message": "Pull-request reopened!"

+         }

+ 

+     """  # noqa

+     output = {}

+ 

+     repo = _get_repo(repo, username, namespace)

+     _check_pull_request(repo)

+     _check_token(repo, project_token=False)

+     request = _get_request(repo, requestid)

+ 

+     if (

+         not is_repo_committer(repo)

+         and not flask.g.fas_user.username == request.user.username

+     ):

+         raise pagure.exceptions.APIError(403, error_code=APIERROR.ENOPRCLOSE)

+ 

+     try:

+         pagure.lib.query.reopen_pull_request(

+             flask.g.session, request, flask.g.fas_user.username

+         )

+         flask.g.session.commit()

+         output["message"] = "Pull-request reopened!"

+     except SQLAlchemyError as err:  # pragma: no cover

+         flask.g.session.rollback()

+         _log.exception(err)

+         raise pagure.exceptions.APIError(400, error_code=APIERROR.EDBERROR)

+ 

+     jsonout = flask.jsonify(output)

+     return jsonout

+ 

+ 

  @API.route("/<repo>/pull-request/<int:requestid>/comment", methods=["POST"])

  @API.route(

      "/<namespace>/<repo>/pull-request/<int:requestid>/comment",

file modified
+179
@@ -12,6 +12,7 @@ 

  from __future__ import unicode_literals, absolute_import

  

  import flask

+ from sqlalchemy.exc import SQLAlchemyError

  

  import pagure

  import pagure.exceptions
@@ -19,6 +20,8 @@ 

  from pagure.api import (

      API,

      APIERROR,

+     api_login_optional,

+     api_login_required,

      api_method,

      api_login_optional,

      get_page,
@@ -289,3 +292,179 @@ 

      jsonout = flask.jsonify(output)

      jsonout.status_code = 200

      return jsonout

+ 

+ 

+ @API.route("/group/<group>/add", methods=["POST"])

+ @api_login_required(acls=["group_modify"])

+ @api_method

+ def api_group_add_member(group):

+     """

+     Add member to group

+     -------------------

+     Add new member to group. To be able to add users to group the requester

+     needs to have permissions to do that.

+ 

+     ::

+ 

+         POST /api/0/group/<group>/add

+ 

+     Input

+     ^^^^^

+ 

+     +---------------------+--------+-------------+-----------------------------+

+     | Key                 | Type   | Optionality | Description                 |

+     +=====================+========+=============+=============================+

+     | ``user``            | string | Mandatory   | | User to add as member     |

+     |                     |        |             |   of group                  |

+     +---------------------+--------+-------------+-----------------------------+

+ 

+     Sample response

+     ^^^^^^^^^^^^^^^

+ 

+     ::

+ 

+         {

+           "creator": {

+             "default_email": "user1@example.com",

+             "emails": [

+               "user1@example.com"

+             ],

+             "fullname": "User1",

+             "name": "user1"

+           },

+           "date_created": "1492011511",

+           "description": "Some Group",

+           "display_name": "Some Group",

+           "group_type": "user",

+           "members": [

+             "user1",

+             "user2"

+           ],

+           "name": "some_group_name"

+         }

+ 

+     """  # noqa

+ 

+     group = pagure.lib.query.search_groups(flask.g.session, group_name=group)

+     if not group:

+         raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOGROUP)

+ 

+     # Validate inputs

+     form = pagure.forms.AddUserToGroupForm(meta={"csrf": False})

+     if not form.validate_on_submit():

+         raise pagure.exceptions.APIError(

+             400, error_code=APIERROR.EINVALIDREQ, errors=form.errors

+         )

+     else:

+         # Add user to group

+         try:

+             pagure.lib.query.add_user_to_group(

+                 flask.g.session,

+                 username=form.user.data,

+                 group=group,

+                 user=flask.g.fas_user.username,

+                 is_admin=pagure.utils.is_admin(),

+             )

+             flask.g.session.commit()

+             pagure.lib.git.generate_gitolite_acls(

+                 project=None, group=group.group_name

+             )

+         except (pagure.exceptions.PagureException, SQLAlchemyError) as err:

+             flask.g.session.rollback()

+             raise pagure.exceptions.APIError(

+                 400, error_code=APIERROR.EDBERROR, errors=[str(err)]

+             )

+ 

+     # Return the updated group

+     output = group.to_json(public=(not pagure.utils.api_authenticated()))

+     jsonout = flask.jsonify(output)

+     jsonout.status_code = 200

+     return jsonout

+ 

+ 

+ @API.route("/group/<group>/remove", methods=["POST"])

+ @api_login_required(acls=["group_modify"])

+ @api_method

+ def api_group_remove_member(group):

+     """

+     Remove member from group

+     ------------------------

+     Remove member from group. To be able to remove users from group the requester

+     needs to have permissions to do that.

+ 

+     ::

+ 

+         POST /api/0/group/<group>/remove

+ 

+     Input

+     ^^^^^

+ 

+     +---------------------+--------+-------------+-----------------------------+

+     | Key                 | Type   | Optionality | Description                 |

+     +=====================+========+=============+=============================+

+     | ``user``            | string | Mandatory   | | User to add as member     |

+     |                     |        |             |   of group                  |

+     +---------------------+--------+-------------+-----------------------------+

+ 

+     Sample response

+     ^^^^^^^^^^^^^^^

+ 

+     ::

+ 

+         {

+           "creator": {

+             "default_email": "user1@example.com",

+             "emails": [

+               "user1@example.com"

+             ],

+             "fullname": "User1",

+             "name": "user1"

+           },

+           "date_created": "1492011511",

+           "description": "Some Group",

+           "display_name": "Some Group",

+           "group_type": "user",

+           "members": [

+             "user1",

+             "user2"

+           ],

+           "name": "some_group_name"

+         }

+ 

+     """  # noqa

+ 

+     group = pagure.lib.query.search_groups(flask.g.session, group_name=group)

+     if not group:

+         raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOGROUP)

+ 

+     # Validate inputs

+     form = pagure.forms.AddUserToGroupForm(meta={"csrf": False})

+     if not form.validate_on_submit():

+         raise pagure.exceptions.APIError(

+             400, error_code=APIERROR.EINVALIDREQ, errors=form.errors

+         )

+     else:

+         # Remove user to group

+         try:

+             pagure.lib.query.delete_user_of_group(

+                 flask.g.session,

+                 username=form.user.data,

+                 groupname=group.group_name,

+                 user=flask.g.fas_user.username,

+                 is_admin=pagure.utils.is_admin(),

+             )

+             flask.g.session.commit()

+             pagure.lib.git.generate_gitolite_acls(

+                 project=None, group=group.group_name

+             )

+         except (pagure.exceptions.PagureException, SQLAlchemyError) as err:

+             flask.g.session.rollback()

+             raise pagure.exceptions.APIError(

+                 400, error_code=APIERROR.EDBERROR, errors=[str(err)]

+             )

+ 

+     # Return the updated group

+     output = group.to_json(public=(not pagure.utils.api_authenticated()))

+     jsonout = flask.jsonify(output)

+     jsonout.status_code = 200

+     return jsonout

file modified
+5
@@ -1453,6 +1453,11 @@ 

              404, error_code=APIERROR.ENEWPROJECTDISABLED

          )

  

+     if pagure_config["PAGURE_AUTH"] == 'oidc' and flask.g.fas_user.can_create is False:

+         raise pagure.exceptions.APIError(

+             403, error_code=APIERROR.ENEWPROJECTFORBIDDEN

+         )

+ 

      namespaces = pagure_config["ALLOWED_PREFIX"][:]

      if user:

          namespaces.extend([grp for grp in user.groups])

file modified
+7 -3
@@ -194,12 +194,14 @@ 

          )

  

  

- def _check_pull_request_access(request, assignee=False):

+ def _check_pull_request_access(request, assignee=False, allow_author=False):

      """Check if user can access Pull-Request. Must be repo committer

-     or author to see private pull-requests.

+     or author (if flag is true) to see private pull-requests.

      :param request: PullRequest object

      :param assignee: a boolean specifying whether to allow the assignee or not

          defaults to False

+     :param allow_author: a boolean specifying whether the PR author should be

+         allowed, defaults to False

      :raises pagure.exceptions.APIError: when access denied

      """

      # Private PRs require commit access
@@ -207,7 +209,9 @@ 

  

      error = False

      # Public tickets require ticket access

-     error = not is_repo_user(request.project)

+     error = not is_repo_user(request.project) and not (

+         allow_author and request.user.user == flask.g.fas_user.username

+     )

  

      if assignee:

          if (

file modified
+175
@@ -440,6 +440,30 @@ 

      local_parser.set_defaults(func=do_delete_project)

  

  

+ def _parser_sanitize_spam_user(subparser):

+     """Set up the CLI argument parser for the delete-user-activity action.

+ 

+     :arg subparser: an argparse subparser allowing to have action's specific

+         arguments

+ 

+     """

+     local_parser = subparser.add_parser(

+         "sanitize-spam-user",

+         help="Delete repos and tickets by the user specified",

+     )

+ 

+     local_parser.add_argument(

+         "user",

+         help="Username of the spam user to sanitize",

+     )

+     local_parser.add_argument(

+         "action_user",

+         help="Username of the admin user doing the action (ie: deleting the "

+         "users activity)",

+     )

+     local_parser.set_defaults(func=do_sanitize_spam_user)

+ 

+ 

  def _parser_create_branch(subparser):

      """Set up the CLI argument parser for the create-branch action.

  
@@ -579,6 +603,9 @@ 

      # delete-project

      _parser_delete_project(subparser)

  

+     # delete-all-user-acitvity

+     _parser_sanitize_spam_user(subparser)

+ 

      # create-branch

      _parser_create_branch(subparser)

  
@@ -925,6 +952,154 @@ 

      print("Project deleted")

  

  

+ def do_sanitize_spam_user(args):

+     """Block and remove activity by a spam user

+ 

+     :arg args: the argparse object returned by ``parse_arguments()``.

+ 

+     """

+     _log.debug("user:          %s", args.user)

+     _log.debug("user deleting: %s", args.action_user)

+ 

+     # Validate users

+     user = pagure.lib.query.get_user(session, args.user)

+     action_user = pagure.lib.query.get_user(session, args.action_user)

+ 

+     projects = (

+         session.query(pagure.lib.model.Project).filter(

+             pagure.lib.model.Project.user_id == user.id

+         )

+     ).all()

+ 

+     issues = (

+         session.query(pagure.lib.model.Issue).filter(

+             pagure.lib.model.Issue.user_id == user.id

+         )

+     ).all()

+ 

+     comments = (

+         session.query(pagure.lib.model.IssueComment).filter(

+             pagure.lib.model.IssueComment.user_id == user.id

+         )

+     ).all()

+ 

+     prs = (

+         session.query(pagure.lib.model.PullRequest).filter(

+             pagure.lib.model.PullRequest.user_id == user.id

+         )

+     ).all()

+ 

+     prcomments = (

+         session.query(pagure.lib.model.PullRequestComment).filter(

+             pagure.lib.model.PullRequestComment.user_id == user.id

+         )

+     ).all()

+ 

+     groups = (