--- /dev/null
+# -*- coding: utf-8 -*-
+# Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
+#
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0 which accompanies this distribution,
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+"""
+
+Embeds a simple table with issues.
+
+"""
+
+from docutils import nodes
+from docutils.parsers.rst import directives, Directive
+from jira import JIRA
+import re
+import sphinx
+
+__copyright__ = "Copyright(c) 2021 PANTHEON.tech, s.r.o."
+__license__ = "Eclipse Public License v1.0"
+
+class JiraFixedIssuesDirective(Directive):
+ """
+ JIRA Fixed Issues directive
+ """
+ has_content = True
+ required_arguments = 0
+ optional_arguments = 0
+
+ option_spec = {
+ "project": directives.unchanged_required,
+ "versions": directives.unchanged_required,
+ }
+
+ def run(self):
+ jira = JIRA(server="https://jira.opendaylight.org")
+ prj = jira.project(self.options.get('project'))
+ (from_ver, to_ver) = self.options.get('versions').split('-', 1)
+
+ versions = set()
+ for ver in jira.project_versions(prj):
+ if ver.name >= from_ver and ver.name <= to_ver:
+ versions.add(ver.name)
+ versions = ", ".join(versions)
+
+ # FIXME: this is not quite nice: can we emit the table markup directly
+ table = [
+ '.. list-table:: Issues resolved in versions %s through %s' % (from_ver, to_ver),
+ # FIXME: bind to https://datatables.net/
+ ' :class: datatable',
+ ' :header-rows: 1',
+ ' :widths: auto',
+ '',
+ ' * - Type',
+ ' - Key',
+ ' - Summary',
+ ' - Resolution',
+ ' - Fix Version(s)',
+ ]
+
+ issues = jira.search_issues('project = %s AND resolution is not EMPTY AND fixVersion in (%s) ORDER BY type ASC' % (prj, versions))
+ for issue in issues:
+ # Groom fixVersions
+ fixVersions = set()
+ for version in issue.fields.fixVersions:
+ fixVersions.add(version.name)
+ fixVersions = list(fixVersions)
+ fixVersions.sort()
+
+ table.append(' * - .. image:: %s' % issue.fields.issuetype.iconUrl)
+ table.append(' :align: center')
+ table.append(' :alt: %s' % issue.fields.issuetype.name)
+ table.append(' - `%s <https://jira.opendaylight.org/browse/%s>`_' % (issue.key, issue.key))
+ table.append(' - %s' % issue.fields.summary)
+ table.append(' - %s' % issue.fields.resolution)
+ table.append(' - %s' % ", ".join(fixVersions))
+
+ table.append('')
+
+ for idx, line in enumerate(table):
+ self.content.data.insert(idx, line)
+ self.content.items.insert(idx, (None, idx))
+
+ node = nodes.container()
+ self.state.nested_parse(self.content, self.content_offset, node)
+ return node.children
+
+class JiraKnownIssuesDirective(Directive):
+ """
+ JIRA Known Issues directive
+ """
+ has_content = True
+ required_arguments = 0
+ optional_arguments = 0
+
+ option_spec = {
+ "project": directives.unchanged_required,
+ "versions": directives.unchanged_required,
+ }
+
+ def run(self):
+ jira = JIRA(server="https://jira.opendaylight.org")
+ prj = jira.project(self.options.get('project'))
+ (from_ver, to_ver) = self.options.get('versions').split('-', 1)
+
+ versions = set()
+ for ver in jira.project_versions(prj):
+ if ver.name >= from_ver and ver.name <= to_ver:
+ versions.add(ver.name)
+ versions = ", ".join(versions)
+
+ # FIXME: this is not quite nice: can we emit the table markup directly
+ table = [
+ '.. list-table:: Issues affecting versions %s through %s' % (from_ver, to_ver),
+ # FIXME: bind to https://datatables.net/
+ ' :class: datatable',
+ ' :header-rows: 1',
+ ' :widths: auto',
+ '',
+ ' * - Type',
+ ' - Key',
+ ' - Summary',
+ ' - Status',
+ ' - Affected Version(s)',
+ ' - Fix Version(s)',
+ ]
+
+ issues = jira.search_issues('project = %s AND affectedVersion in (%s) AND fixVersion NOT in (%s) ORDER BY type ASC' % (prj, versions, versions))
+ for issue in issues:
+ # Groom fixVersions
+ fixVersions = set()
+ for version in issue.fields.fixVersions:
+ fixVersions.add(version.name)
+ fixVersions = list(fixVersions)
+ fixVersions.sort()
+
+ # Groom affectedVersions
+ affectedVersions = set()
+ for version in issue.fields.versions:
+ affectedVersions.add(version.name)
+ affectedVersions = list(affectedVersions)
+ affectedVersions.sort()
+
+ table.append(' * - .. image:: %s' % issue.fields.issuetype.iconUrl)
+ table.append(' :align: center')
+ table.append(' :alt: %s' % issue.fields.issuetype.name)
+ table.append(' - `%s <https://jira.opendaylight.org/browse/%s>`_' % (issue.key, issue.key))
+ table.append(' - %s' % issue.fields.summary)
+ table.append(' - %s' % issue.fields.status)
+ table.append(' - %s' % ", ".join(affectedVersions))
+ table.append(' - %s' % ", ".join(fixVersions))
+
+ table.append('')
+
+ for idx, line in enumerate(table):
+ self.content.data.insert(idx, line)
+ self.content.items.insert(idx, (None, idx))
+
+ node = nodes.container()
+ self.state.nested_parse(self.content, self.content_offset, node)
+ return node.children
+
+def setup(app):
+ """
+ :type app: sphinx.application.Sphinx
+ """
+ app.add_directive('jira_fixed_issues', JiraFixedIssuesDirective)
+ app.add_directive('jira_known_issues', JiraKnownIssuesDirective)
+
+ return {
+ 'version': '0.1',
+ 'parallel_read_safe': True,
+ 'parallel_write_safe': True,
+ }
+
* Active Stateful PCE LSP Operations
-Changes in Phosphorus release stream
-====================================
-
-There is a comprehensive list of JIRA issues
-`resolved in this release <https://jira.opendaylight.org/issues/?jql=project%20%3D%20BGPCEP%20AND%20fixVersion%20in%20(0.16.0%2C%200.16.1%2C%200.16.2%2C%200.16.3%2C%200.16.4%200.16.5)>`__
-
-
Behavior/Feature Changes
========================
to enable legacy BGP link state path attribute encoding has changed. It is using OSGi Configuration Admin interface, just
like other global settings.
-Here is the link to the features improved in this release:
-
-`OpenDaylight JIRA Tickets - Improvement <https://jira.opendaylight.org/issues/?jql=project+%3D+bgpcep+AND+type+%3D+Improvement+AND+status+in+%28Resolved%2C+Done%2C+Closed%29+AND+fixVersion+in+%28%22Silicon+GA%22%2C+Silicon%2C+silicon%29++ORDER+BY+issuetype+DESC%2C+key+ASC>`_
-
New Features
============
-
-Here is the link to the new features introduced in this release:
-
-`OpenDaylight JIRA Tickets - New Feature <https://jira.opendaylight.org/issues/?jql=project+%3D+bgpcep+AND+type+%3D+%22New+Feature%22+AND+status+in+%28Resolved%2C+Done%2C+Closed%29+AND+fixVersion+in+%28%22Silicon+GA%22%2C+Silicon%2C+silicon%29++ORDER+BY+issuetype+DESC%2C+key+ASC>`_
+No new features.
Deprecated Features
===================
-
-Here is the link to the features removed in this release:
-
-`OpenDaylight JIRA Tickets - Deprecated Feature <https://jira.opendaylight.org/issues/?jql=project+%3D+bgpcep+AND+type+%3D+Deprecate+AND+status+in+%28Resolved%2C+Done%2C+Closed%29+AND+fixVersion+in+%28%22Silicon+GA%22%2C+Silicon%2C+silicon%29++ORDER+BY+issuetype+DESC%2C+key+ASC>`_
+No deprecated features.
Resolved Issues
===============
+The following table lists the issues resolved in this release.
-Here is the link to the resolved issues fixed in this release:
-
-`OpenDaylight JIRA Tickets - Resolved Issue <https://jira.opendaylight.org/issues/?jql=project+%3D+bgpcep+AND+type+%3D+Bug+AND+status+in+%28Resolved%2C+Done%2C+Closed%29+AND+fixVersion+in+%28%22Silicon+GA%22%2C+Silicon%2C+silicon%29++ORDER+BY+issuetype+DESC%2C+key+ASC>`_
-
+.. jira_fixed_issues::
+ :project: BGPCEP
+ :versions: 0.16.0-0.16.6
Known Issues
============
+The following table lists the known issues that exist in this release.
-Here is the link to the known issues exist in this release:
-
-`OpenDaylight JIRA Tickets - Known Issue <https://jira.opendaylight.org/issues/?jql=project+%3D+bgpcep+AND+type+%3D+Bug+AND+status+not+in+%28Resolved%2C+Done%2C+Closed%29+ORDER+BY+issuetype+DESC%2C+key+ASC>`_
+.. jira_known_issues::
+ :project: BGPCEP
+ :versions: 0.16.0-0.16.6