#4245 Allow turning on issue tracking for only some namespaces
Merged 5 years ago by pingou. Opened 5 years ago by pingou.

file modified
+14
@@ -999,6 +999,20 @@ 

  Defaults to: ``True``

  

  

+ ENABLE_TICKETS_NAMESPACE

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

+ 

+ This configuration key allows to restrict the namespace in which the ticketing

+ system is enabled.

+ So if your pagure instance has ``ENABLE_TICKETS`` as ``True`` and sets

+ ``ENABLE_TICKETS_NAMESPACE`` to ``['tests', 'infra']`` only the projects opened

+ in these two namespaces will have the ticketing system enabled. All the other

+ namespaces will not.

+ 

+ 

+ Defaults to: ``[]``

+ 

+ 

  ENABLE_DOCS

  ~~~~~~~~~~~

  

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

      :param repo: repository

      :raises pagure.exceptions.APIError: when issue tracker is disabled

      """

-     if not repo.settings.get("issue_tracker", True):

+     ticket_namespaces = pagure_config.get("ENABLE_TICKETS_NAMESPACE")

+     if (

+         ticket_namespaces

+         and repo.namespace

+         and repo.namespace not in ticket_namespaces

+     ) or not repo.settings.get("issue_tracker", True):

          raise pagure.exceptions.APIError(

              404, error_code=APIERROR.ETRACKERDISABLED

          )

file modified
+5 -2
@@ -1,10 +1,11 @@ 

  # -*- coding: utf-8 -*-

  

  """

-  (c) 2018 - Copyright Red Hat Inc

+  (c) 2018-2019 - Copyright Red Hat Inc

  

   Authors:

     Clement Verna <cverna@tutanota.com>

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

  

  """

  
@@ -25,7 +26,9 @@ 

      @wraps(function)

      def check_issue_tracker(*args, **kwargs):

          repo = flask.g.repo

-         if not repo.settings.get("issue_tracker", True):

+         if not flask.g.issues_enabled or not repo.settings.get(

+             "issue_tracker", True

+         ):

              flask.abort(404, "No issue tracker found for this project")

          # forbid all POST requests if the issue tracker is made read-only

          if flask.request.method == "POST" and repo.settings.get(

file modified
+24
@@ -244,6 +244,8 @@ 

      flask.g.version = pagure.__version__

      flask.g.confirmationform = pagure.forms.ConfirmationForm()

  

+     flask.g.issues_enabled = pagure_config.get("ENABLE_TICKETS", True)

+ 

      # The API namespace has its own way of getting repo and username and

      # of handling errors

      if flask.request.blueprint == "api_ns":
@@ -322,6 +324,28 @@ 

          if flask.g.repo is None:

              flask.abort(404, "Project not found")

  

+         # If issues are not globally enabled, there is no point in continuing

+         if flask.g.issues_enabled:

+ 

+             ticket_namespaces = pagure_config.get("ENABLE_TICKETS_NAMESPACE")

+ 

+             if ticket_namespaces and flask.g.repo.namespace:

+                 if flask.g.repo.namespace in (ticket_namespaces or []):

+                     # If the namespace is in the allowed list

+                     # issues are enabled

+                     flask.g.issues_enabled = True

+                 else:

+                     # If the namespace isn't in the list of namespaces

+                     # issues are disabled

+                     flask.g.issues_enabled = False

+ 

+             flask.g.issues_project_disabled = False

+             if not flask.g.repo.settings.get("issue_tracker", True):

+                 # If the project specifically disabled its issue tracker,

+                 # disable issues

+                 flask.g.issues_project_disabled = True

+                 flask.g.issues_enabled = False

+ 

          flask.g.reponame = get_repo_path(flask.g.repo)

          flask.g.repo_obj = pygit2.Repository(flask.g.reponame)

          flask.g.repo_admin = pagure.utils.is_repo_admin(flask.g.repo)

@@ -89,7 +89,7 @@ 

      $("#update_comment").atwho(userConfig);

    });

    $.when(

-     {% if config.get('ENABLE_TICKETS', True) %}

+     {% if g.issues_enabled %}

        $.get("{{ url_for('api_ns.api_view_issues', namespace=repo.namespace, repo=repo.name, username=username, status='all') }}"),

      {% endif %}

      $.get("{{ url_for('api_ns.api_pull_request_views', namespace=repo.namespace, repo=repo.name, username=username, status='all') }}")

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

        <div class="col-6 text-right">

          <div class="btn-group">

          {% if g.authenticated %}

-           {% if repo.settings.get('issue_tracker', True)

-                 and config.get('ENABLE_TICKETS', True)

+           {% if g.issues_enabled

                  and not repo.settings.get('issue_tracker_read_only', False) %}

              <a href="{{ url_for('ui_ns.new_issue',

                  repo=g.repo.name,
@@ -221,8 +220,7 @@ 

                  {% endif %}

  

                  {% if g.authenticated and g.repo_committer %}

-                   {% if config.get('ENABLE_TICKETS', True)

-                     and repo.settings.get('issue_tracker', True) %}

+                   {% if g.issues_enabled %}

                      <h5><strong>Issues</strong></h5>

                      {{ print_ssh_url(repo, "tickets/", g.fas_user.username) }}

                    {% endif %}
@@ -282,8 +280,7 @@ 

          </li>

          {% endif %}

  

-         {% if config.get('ENABLE_TICKETS', True) and repo

-               and repo.settings.get('issue_tracker', True) %}

+         {% if g.issues_enabled %}

          <li class="nav-item mr-2 text-dark">

              <a {%

                if select == 'issues' %}class="active nav-link" {%
@@ -321,8 +318,7 @@ 

          </li>

          {% endif %}

  

-         {% if config.get('ENABLE_TICKETS', True) and repo.milestones

-             and repo.settings.get('issue_tracker', True)%}

+         {% if g.issues_enabled and repo.milestones %}

          <li class="nav-item mr-2 text-dark">

          <a {%

              if select == 'roadmap' %}class="active nav-link" {%

@@ -1419,7 +1419,7 @@ 

    });

  

    $.when(

-     {%- if config.get('ENABLE_TICKETS', True) and repo.settings.get('issue_tracker', True) %}

+     {%- if g.issues_enabled %}

      $.get("{{ url_for('api_ns.api_view_issues',

                  repo=repo.name,

                  username=username,

@@ -55,7 +55,7 @@ 

                      username=username,

                      namespace=repo.namespace,

                      author='---') }}";

- {% if config.get('ENABLE_TICKETS', True) %}

+ {% if g.issues_enabled %}

  issues_history_stats_plot_call = function() {

    var _stats_url = "{{ url_for(

      'api_ns.api_view_issues_history_stats',
@@ -138,7 +138,7 @@ 

      _b.hide();

      $('.stats_btn').removeClass('active');

      if ($(this).attr('name') == 'issues') {

-       {% if config.get('ENABLE_TICKETS', True) %}

+       {% if g.issues_enabled %}

        issues_history_stats_plot_call();

        $(this).addClass('active');

        window.location.hash = 'issues'
@@ -155,7 +155,7 @@ 

    });

    window.onhashchange = function () {

        if (window.location.hash == 'issues') {

-         {% if config.get('ENABLE_TICKETS', True) %}

+         {% if g.issues_enabled %}

          issues_history_stats_plot_call();

          {% endif %}

        } else if (window.location.hash == 'authors') {

file modified
+11 -17
@@ -49,8 +49,7 @@ 

                  href="#hooks-tab" role="tab" aria-controls="hooks">Hooks</a>

            {% endif %}

  

-           {% if config.get('ENABLE_TICKETS', True)

-             and repo.settings.get('issue_tracker', True) %}

+           {% if g.issues_enabled %}

            <a class="nav-item nav-link" id="priorities" data-toggle="tab"

                  href="#priorities-tab" role="tab" aria-controls="priorities">Priorities</a>

            <a class="nav-item nav-link" id="roadmap" data-toggle="tab"
@@ -63,9 +62,7 @@ 

                  href="#reports-tab" role="tab" aria-controls="reports">Reports</a>

            {% endif %}

  

-          {% if (config.get('ENABLE_TICKETS', True)

-             and repo.settings.get('issue_tracker', True))

-             or repo.settings.get('pull_requests', True) %}

+          {% if g.issues_enabled or repo.settings.get('pull_requests', True) %}

            <a class="nav-item nav-link" id="projecttags" data-toggle="tab"

              href="#projecttags-tab" role="tab" aria-controls="projecttags">Tags</a>

            <a class="nav-item nav-link" id="quickreplies" data-toggle="tab"
@@ -242,9 +239,9 @@ 

                  <div class="col">

                      <p>

                          The email addresses entered below will receive all the notifications

-                         related to {% if config.get('ENABLE_TICKETS', True) %}

+                         related to {% if g.issues_enabled %}

                          (public) issues and {% endif %}pull-requests, this includes

-                         notifications about {% if config.get('ENABLE_TICKETS', True) %}

+                         notifications about {% if g.issues_enabled %}

                          new issue or {% endif %} new pull-request, new comment

                          and status change.

                        </p>
@@ -260,7 +257,7 @@ 

                        {{ tag_form.csrf_token }}

                        <div class="card-body">

  

-                         {% if config.get('ENABLE_TICKETS', True) %}

+                         {% if g.issues_enabled %}

                          <div class="row">

                            <div class="col-sm-12">

                              <strong>Issues notifications</strong>
@@ -480,7 +477,7 @@ 

                  <div class="col">

                    <div id="accordions" role="tablist" aria-multiselectable="true">

                        {% for plugin in plugins %}

-                       {% if not config.get('ENABLE_TICKETS', True) and plugin in ['Pagure tickets'] %}

+                       {% if not g.issues_enabled and plugin in ['Pagure tickets'] %}

                        {% else %}

                        <div class="panel panel-default" >

                          <div class="panel-heading" role="tab" id="pluginheading{{ loop.index }}">
@@ -508,8 +505,7 @@ 

            </div>

            {% endif %}

  

-           {% if config.get('ENABLE_TICKETS', True)

-           and repo.settings.get('issue_tracker', True) %}

+           {% if g.issues_enabled %}

            <div class="tab-pane fade" id="priorities-tab" role="tabpanel" aria-labelledby="priorities-tab">

                <h3 class="font-weight-bold mb-3">

                  Priorities
@@ -854,9 +850,7 @@ 

  

            {% endif %}

  

-           {% if (config.get('ENABLE_TICKETS', True)

-           and repo.settings.get('issue_tracker', True))

-           or repo.settings.get('pull_requests', True) %}

+           {% if g.issues_enabled or repo.settings.get('pull_requests', True) %}

            <div class="tab-pane fade" id="projecttags-tab" role="tabpanel" aria-labelledby="projecttags-tab">

                <h3 class="font-weight-bold mb-3">

                  Tags
@@ -869,7 +863,7 @@ 

                    <ul class="list-group">

                        {% for tag in tags %}

                          <li class="list-group-item clearfix">

-                           {% if config.get('ENABLE_TICKETS', True) %}

+                           {% if g.issues_enabled %}

                            <a href="{{ url_for(

                                'ui_ns.view_issues',

                                repo=repo.name,
@@ -877,7 +871,7 @@ 

                                namespace=repo.namespace,

                                tags=tag.tag) }}">{% endif %}

                              <span class="fa fa-tag"></span>&nbsp; {{ tag.tag }}

-                           {% if config.get('ENABLE_TICKETS', True) %}</a>{% endif %}

+                           {% if g.issues_enabled %}</a>{% endif %}

                            &nbsp;<span class="badge badge-info" style="background-color:{{tag.tag_color}}">{{tag.tag}}</span>

                            &nbsp;<span class="text-muted">{{ tag.tag_description or '' }}</span>

                            <div class="float-right">
@@ -1009,7 +1003,7 @@ 

                </h3>

                <div class="row">

                  <div class="col">

-                     {% if config.get('ENABLE_TICKETS', True) %}

+                     {% if g.issues_enabled %}

                      <form action="{{ url_for(

                          'ui_ns.regenerate_git',

                          repo=repo.name,

@@ -9,7 +9,7 @@ 

      username=username,

      namespace=repo.namespace) }}" method="post">

      {% for key in repo.settings | sort %}

-     {% if not config.get('ENABLE_TICKETS', True) and key in ['issue_tracker', 'issues_default_to_private'] %}

+     {% if not g.issues_enabled and not g.issues_project_disabled and key in ['issue_tracker', 'issues_default_to_private'] %}

      {% elif not config.get('DOC_APP_URL') and key in ['project_documentation'] %}

      {% elif not config.get('WEBHOOK') and key in ['Web-hooks'] %}

      {% else %}

@@ -327,6 +327,28 @@ 

          self.assertEqual(

              pagure.api.APIERROR.EINVALIDTOK.name, data['error_code'])

  

+     @patch.dict('pagure.config.config', {'ENABLE_TICKETS_NAMESPACE': ['foobar']})

+     def test_api_new_issue_wrong_namespace(self):

+         """ Test the api_new_issue method of the flask api. """

+         tests.create_projects(self.session)

+         tests.create_projects_git(

+             os.path.join(self.path, 'tickets'), bare=True)

+         tests.create_tokens(self.session)

+         tests.create_tokens_acl(self.session)

+ 

+         headers = {'Authorization': 'token aaabbbcccddd'}

+ 

+         # Valid token, wrong project

+         output = self.app.post(

+             '/api/0/somenamespace/test3/new_issue', headers=headers)

+         self.assertEqual(output.status_code, 404)

+         data = json.loads(output.get_data(as_text=True))

+         self.assertEqual(sorted(data.keys()), ['error', 'error_code'])

+         self.assertEqual(

+             pagure.api.APIERROR.ETRACKERDISABLED.value, data['error'])

+         self.assertEqual(

+             pagure.api.APIERROR.ETRACKERDISABLED.name, data['error_code'])

+ 

      def test_api_new_issue_no_input(self):

          """ Test the api_new_issue method of the flask api. """

          tests.create_projects(self.session)
@@ -2596,6 +2618,47 @@ 

              }

          )

  

+     @patch.dict('pagure.config.config', {'ENABLE_TICKETS_NAMESPACE': ['foobar']})

+     def test_api_change_milestone_issue_wrong_namespace(self):

+         """ Test the api_new_issue method of the flask api. """

+         tests.create_projects(self.session)

+         tests.create_projects_git(os.path.join(self.path, 'tickets'))

+         tests.create_tokens(self.session)

+         tests.create_tokens_acl(self.session)

+ 

+         # Set some milestones to the project

+         repo = pagure.lib.query.get_authorized_project(

+             self.session, 'test3', namespace='somenamespace')

+         repo.milestones = {'v1.0': None, 'v2.0': 'Soon'}

+         self.session.add(repo)

+         self.session.commit()

+ 

+         # Create normal issue

+         repo = pagure.lib.query.get_authorized_project(self.session, 'test')

+         msg = pagure.lib.query.new_issue(

+             session=self.session,

+             repo=repo,

+             title='Test issue #1',

+             content='We should work on this',

+             user='pingou',

+             private=False,

+         )

+         self.session.commit()

+         self.assertEqual(msg.title, 'Test issue #1')

+ 

+         headers = {'Authorization': 'token aaabbbcccddd'}

+ 

+         # Valid token, wrong project

+         output = self.app.post(

+             '/api/0/somenamespace/test3/issue/1/milestone', headers=headers)

+         self.assertEqual(output.status_code, 404)

+         data = json.loads(output.get_data(as_text=True))

+         self.assertEqual(sorted(data.keys()), ['error', 'error_code'])

+         self.assertEqual(

+             pagure.api.APIERROR.ETRACKERDISABLED.value, data['error'])

+         self.assertEqual(

+             pagure.api.APIERROR.ETRACKERDISABLED.name, data['error_code'])

+ 

      def test_api_change_milestone_issue_wrong_token(self):

          """ Test the api_change_milestone_issue method of the flask api. """

          tests.create_projects(self.session)
@@ -3245,6 +3308,48 @@ 

              }

          )

  

+     @patch.dict('pagure.config.config', {'ENABLE_TICKETS_NAMESPACE': ['foobar']})

+     def test_api_assign_issue_wrong_namespace(self):

+         """ Test the api_new_issue method of the flask api. """

+         tests.create_projects(self.session)

+         tests.create_projects_git(os.path.join(self.path, 'tickets'))

+         tests.create_tokens(self.session)

+         tests.create_tokens_acl(self.session)

+ 

+         # Set some milestones to the project

+         repo = pagure.lib.query.get_authorized_project(

+             self.session, 'test3', namespace='somenamespace')

+         repo.milestones = {'v1.0': None, 'v2.0': 'Soon'}

+         self.session.add(repo)

+         self.session.commit()

+ 

+         # Create normal issue

+         repo = pagure.lib.query.get_authorized_project(

+             self.session, 'test3', namespace='somenamespace')

+         msg = pagure.lib.query.new_issue(

+             session=self.session,

+             repo=repo,

+             title='Test issue #1',

+             content='We should work on this',

+             user='pingou',

+             private=False,

+         )

+         self.session.commit()

+         self.assertEqual(msg.title, 'Test issue #1')

+ 

+         headers = {'Authorization': 'token aaabbbcccddd'}

+ 

+         # Valid token, wrong project

+         output = self.app.post(

+             '/api/0/somenamespace/test3/issue/1/assign', headers=headers)

+         self.assertEqual(output.status_code, 404)

+         data = json.loads(output.get_data(as_text=True))

+         self.assertEqual(sorted(data.keys()), ['error', 'error_code'])

+         self.assertEqual(

+             pagure.api.APIERROR.ETRACKERDISABLED.value, data['error'])

+         self.assertEqual(

+             pagure.api.APIERROR.ETRACKERDISABLED.name, data['error_code'])

+ 

      @patch('pagure.lib.git.update_git')

      @patch('pagure.lib.notify.send_email')

      def test_api_assign_issue(self, p_send_email, p_ugt):

@@ -40,6 +40,52 @@ 

  class PagureFlaskIssuestests(tests.Modeltests):

      """ Tests for flask issues controller of pagure """

  

+     @patch.dict('pagure.config.config', {'ENABLE_TICKETS_NAMESPACE': ['foobar']})

+     @patch('pagure.lib.git.update_git', MagicMock(return_value=True))

+     @patch('pagure.lib.notify.send_email', MagicMock(return_value=True))

+     def test_new_issue_wrong_namespace(self):

+         """ Test the new_issue endpoint. """

+ 

+         tests.create_projects(self.session)

+         tests.create_projects_git(

+             os.path.join(self.path, 'repos'), bare=True)

+ 

+         user = tests.FakeUser(username='pingou')

+         with tests.user_set(self.app.application, user):

+             csrf_token = self.get_csrf()

+             data = {

+                 'title': 'Test issue',

+                 'issue_content': 'We really should improve on this issue',

+                 'status': 'Open',

+                 'csrf_token': csrf_token,

+             }

+ 

+             # Things work fine when the project has no namespace

+ 

+             output = self.app.post(

+                 '/test/new_issue', data=data, follow_redirects=True)

+             self.assertEqual(output.status_code, 200)

+             output_text = output.get_data(as_text=True)

+             self.assertIn(

+                 '<title>Issue #1: Test issue - test - Pagure</title>',

+                 output_text)

+             self.assertIn(

+                 '<a class="btn btn-outline-secondary btn-sm border-0"'

+                  ' href="/test/issue/1/edit" title="Edit this issue">',

+                 output_text)

+ 

+             # Things do not work when the project has a namespace not allowed

+ 

+             output = self.app.post(

+                 '/somenamespace/test3/new_issue', data=data,

+                 follow_redirects=True)

+             self.assertEqual(output.status_code, 404)

+             output_text = output.get_data(as_text=True)

+             self.assertIn(

+                 '<title>Page not found :\'( - Pagure</title>', output_text)

+             self.assertIn(

+                 ' <p>No issue tracker found for this project</p>', output_text)

+ 

      @patch('pagure.lib.git.update_git')

      @patch('pagure.lib.notify.send_email')

      def test_new_issue(self, p_send_email, p_ugt):
@@ -619,6 +665,36 @@ 

                  '\n                <a href="/test/roadmap/v2.0/">'

                  '\n                  v2.0\n', output_text)

  

+     @patch.dict('pagure.config.config', {'ENABLE_TICKETS_NAMESPACE': ['foobar']})

+     @patch('pagure.lib.git.update_git', MagicMock(return_value=True))

+     @patch('pagure.lib.notify.send_email', MagicMock(return_value=True))

+     def test_view_issues_wrong_namespace(self):

+         """ Test the view_issues endpoint. """

+ 

+         tests.create_projects(self.session)

+         tests.create_projects_git(

+             os.path.join(self.path, 'repos'), bare=True)

+ 

+         user = tests.FakeUser(username='pingou')

+         with tests.user_set(self.app.application, user):

+             # Things work fine when the project has no namespace

+ 

+             output = self.app.get('/test/issues')

+             self.assertEqual(output.status_code, 200)

+             output_text = output.get_data(as_text=True)

+             self.assertIn(

+                 '<title>Issues - test - Pagure</title>', output_text)

+ 

+             # Things do not work when the project has a namespace not allowed

+ 

+             output = self.app.get('/somenamespace/test3/issues')

+             self.assertEqual(output.status_code, 404)

+             output_text = output.get_data(as_text=True)

+             self.assertIn(

+                 '<title>Page not found :\'( - Pagure</title>', output_text)

+             self.assertIn(

+                 ' <p>No issue tracker found for this project</p>', output_text)

+ 

      @patch('pagure.lib.git.update_git')

      @patch('pagure.lib.notify.send_email')

      def test_view_issues(self, p_send_email, p_ugt):
@@ -1670,6 +1746,74 @@ 

              output = self.app.get('/test/issue/1')

              self.assertEqual(output.status_code, 200)

  

+     @patch.dict('pagure.config.config', {'ENABLE_TICKETS_NAMESPACE': ['foobar']})

+     @patch('pagure.lib.git.update_git', MagicMock(return_value=True))

+     @patch('pagure.lib.notify.send_email', MagicMock(return_value=True))

+     def test_update_issue_wrong_namespace(self):

+         """ Test the update_issue endpoint. """

+ 

+         tests.create_projects(self.session)

+         tests.create_projects_git(

+             os.path.join(self.path, 'repos'), bare=True)

+ 

+         # Create normal issue on test

+         repo = pagure.lib.query.get_authorized_project(self.session, 'test')

+         msg = pagure.lib.query.new_issue(

+             session=self.session,

+             repo=repo,

+             title='Test issue #1',

+             content='We should work on this',

+             user='pingou',

+             private=False,

+         )

+         self.session.commit()

+         self.assertEqual(msg.title, 'Test issue #1')

+ 

+         # Create normal issue on test3

+         repo = pagure.lib.query.get_authorized_project(

+             self.session, 'test3', namespace='somenamespace')

+         msg = pagure.lib.query.new_issue(

+             session=self.session,

+             repo=repo,

+             title='Test issue #1',

+             content='We should work on this',

+             user='pingou',

+             private=False,

+         )

+         self.session.commit()

+         self.assertEqual(msg.title, 'Test issue #1')

+ 

+         user = tests.FakeUser(username='pingou')

+         with tests.user_set(self.app.application, user):

+             # Add new comment

+             data = {

+                 'csrf_token': self.get_csrf(),

+                 'status': 'Closed',

+                 'close_status': 'Fixed',

+                 'comment': 'Woohoo a second comment!',

+             }

+ 

+             # Things work fine when the project has no namespace

+             output = self.app.post(

+                 '/test/issue/1/update', data=data, follow_redirects=True)

+             self.assertEqual(output.status_code, 200)

+             output_text = output.get_data(as_text=True)

+             self.assertIn(

+                 '<title>Issue #1: Test issue #1 - test - Pagure</title>',

+                 output_text)

+ 

+             # Things do not work when the project has a namespace not allowed

+ 

+             output = self.app.post(

+                 '/somenamespace/test3/issue/1/update', data=data,

+                 follow_redirects=True)

+             self.assertEqual(output.status_code, 404)

+             output_text = output.get_data(as_text=True)

+             self.assertIn(

+                 '<title>Page not found :\'( - Pagure</title>', output_text)

+             self.assertIn(

+                 ' <p>No issue tracker found for this project</p>', output_text)

+ 

      @patch('pagure.lib.git.update_git')

      @patch('pagure.lib.notify.send_email')

      def test_update_issue(self, p_send_email, p_ugt):

This commit allows turning on issue tracking for only some namespaces
specified in the configuration file.
This way, on src.fp.o we can enable issue tracking in pagure for the
tests namespace without enabling it for the rpms namespace (for example)
since the issues for the rpms namespace are meant to be tracked in
bugzilla.redhat.com

Fixes https://pagure.io/pagure/issue/4244

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

rebased onto 7fba973a44235fc68bc3bd9d78cc424b807f3c6b

5 years ago

rebased onto 6c95cb39120c0430b18a7d96e0820e2ee6b2b052

5 years ago

rebased onto 7aa79f7988d534430d3c74e804f4711ffeae8747

5 years ago

pretty please pagure-ci rebuild

5 years ago

rebased onto 445d66f0b4310eb9273ec7abfac7ea6319edce78

5 years ago

pretty please pagure-ci rebuild

5 years ago

LGTM, but I think we need to add some doc for the new config key ENABLE_TICKETS_NAMESPACE

Good catch, I'll add this :)

rebased onto cd4df4e

5 years ago

Here is the blob added to the documentation:

--- a/doc/configuration.rst    
+++ b/doc/configuration.rst    
@@ -999,6 +999,20 @@ for all the projects hosted on this pagure instance.
 Defaults to: ``True``


+ENABLE_TICKETS_NAMESPACE
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+This configuration key allows to restrict the namespace in which the ticketing
+system is enabled.
+So if your pagure instance has ``ENABLE_TICKETS`` as ``True`` and sets
+``ENABLE_TICKETS_NAMESPACE`` to ``['tests', 'infra']`` only the projects opened
+in these two namespaces will have the ticketing system enabled. All the other
+namespaces will not.
+
+
+Defaults to: ``[]``
+
+

Pull-Request has been merged by pingou

5 years ago