show per-deliverable stable status on releases.o.o

Add an API to Deliverable to let the sphinxext inject the series status
information, since the build conditions and working directory are
different under sphinx.

Change-Id: Id2bbdc4815564d28a5f4989bf7c74aed93e8c129
Story: #2001852
Task: #12620
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-04-20 11:43:43 -04:00
parent 9bb5fec5f8
commit a817e3a6ab
4 changed files with 27 additions and 5 deletions

View File

@ -14,7 +14,7 @@ updates.
.. _combined release calendar: schedule.ics
.. datatemplate::
:source: ../../deliverables/series_status.yaml
:source: series_status.yaml
:template: series_status_table.tmpl
.. toctree::

View File

@ -0,0 +1 @@
../../deliverables/series_status.yaml

View File

@ -526,10 +526,17 @@ class Deliverable(object):
@property
def series_info(self):
if self._series_status_data is None:
self._series_status_data = series_status.SeriesStatus.default()
self.init_series_status_data()
return self._series_status_data[self.series]
@classmethod
def init_series_status_data(cls, data=None):
if cls._series_status_data is not None:
return
if data is None:
data = series_status.SeriesStatus.default()
cls._series_status_data = data
@property
def stable_status(self):
status = self._data.get('stable-status')

View File

@ -26,8 +26,11 @@ from sphinx.util.nodes import nested_parse_with_titles
from openstack_releases import deliverable
from openstack_releases import governance
from openstack_releases import links
from openstack_releases import series_status
_TEAM_DATA = governance.get_team_data()
_PHASE_DOC_URL = 'https://docs.openstack.org/project-team-guide/stable-branches.html#maintenance-phases' # noqa
def _list_table(add, headers, data, title='', columns=None):
@ -73,6 +76,9 @@ _deliverables = None
def _initialize_deliverable_data(app):
global _deliverables
series_status_data = series_status.SeriesStatus.from_directory(
'deliverables')
deliverable.Deliverable.init_series_status_data(series_status_data)
_deliverables = deliverable.Deliverables('deliverables')
@ -221,13 +227,21 @@ class DeliverableDirectiveBase(rst.Directive):
)
else:
notes_link = '`release notes <%s>`__' % release_notes
stable_status = '`{} <{}>`__'.format(
deliv.stable_status.title(),
_PHASE_DOC_URL,
)
most_recent.append(
(ref, earliest_version, recent_version, notes_link)
(ref,
earliest_version,
recent_version,
stable_status,
notes_link)
)
_list_table(
lambda t: result.append(t, source_name),
['Deliverable', 'Earliest Version',
'Most Recent Version', 'Notes'],
'Most Recent Version', 'Stable Status', 'Notes'],
most_recent,
title='Release Summary',
)