From a817e3a6ab700455080bf201949634ac1e344a03 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 20 Apr 2018 11:43:43 -0400 Subject: [PATCH] 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 --- doc/source/index.rst | 2 +- doc/source/series_status.yaml | 1 + openstack_releases/deliverable.py | 11 +++++++++-- openstack_releases/sphinxext.py | 18 ++++++++++++++++-- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 120000 doc/source/series_status.yaml diff --git a/doc/source/index.rst b/doc/source/index.rst index a57df0c893..c8ea8219c7 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -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:: diff --git a/doc/source/series_status.yaml b/doc/source/series_status.yaml new file mode 120000 index 0000000000..aaaa5bd80a --- /dev/null +++ b/doc/source/series_status.yaml @@ -0,0 +1 @@ +../../deliverables/series_status.yaml \ No newline at end of file diff --git a/openstack_releases/deliverable.py b/openstack_releases/deliverable.py index 610ec76fd6..4431b18dc6 100644 --- a/openstack_releases/deliverable.py +++ b/openstack_releases/deliverable.py @@ -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') diff --git a/openstack_releases/sphinxext.py b/openstack_releases/sphinxext.py index e2bba23a91..8ce9464464 100644 --- a/openstack_releases/sphinxext.py +++ b/openstack_releases/sphinxext.py @@ -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', )