Add 'Future' series names to the redirections
Once we have the nest series in series_status.yaml we can add redirections for those constraints too. This allows us, should we want to, to have branches refer to the series by name, instead of 'master'. Change-Id: I0035190d11bf0c0bb43119fde18b5dc22d2cc1a0
This commit is contained in:
parent
209d658195
commit
59c8c13058
@ -74,16 +74,18 @@ def _get_category(deliv):
|
||||
|
||||
|
||||
_deliverables = None
|
||||
_series_status_data = None
|
||||
|
||||
|
||||
def _initialize_deliverable_data():
|
||||
global _deliverables
|
||||
global _series_status_data
|
||||
|
||||
LOG.info('Loading deliverable data...')
|
||||
|
||||
series_status_data = series_status.SeriesStatus.from_directory(
|
||||
_series_status_data = series_status.SeriesStatus.from_directory(
|
||||
'deliverables')
|
||||
deliverable.Deliverable.init_series_status_data(series_status_data)
|
||||
deliverable.Deliverable.init_series_status_data(_series_status_data)
|
||||
_deliverables = deliverable.Deliverables('deliverables')
|
||||
|
||||
|
||||
@ -472,7 +474,11 @@ def build_finished(app, exception):
|
||||
if exception is not None:
|
||||
return
|
||||
|
||||
redirections = generate_constraints_redirections(_deliverables)
|
||||
future_releases = [series.name
|
||||
for series in _series_status_data.values()
|
||||
if series.status == 'future']
|
||||
redirections = generate_constraints_redirections(_deliverables,
|
||||
future_releases)
|
||||
rendered_output = app.builder.templates.render(
|
||||
'htaccess',
|
||||
dict(redirections=redirections)
|
||||
|
@ -18,7 +18,7 @@ from sphinx.util import logging
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def generate_constraints_redirections(_deliverables):
|
||||
def generate_constraints_redirections(_deliverables, future_releases=[]):
|
||||
redirections = []
|
||||
# Loop through all the releases for requirements
|
||||
for deliv in _deliverables.get_deliverable_history('requirements'):
|
||||
@ -41,4 +41,7 @@ def generate_constraints_redirections(_deliverables):
|
||||
# master -> juno
|
||||
redirections.insert(0, dict(code=301, src=deliv.series, dst=target))
|
||||
|
||||
for series in future_releases:
|
||||
redirections.insert(0, dict(code=301, src=series, dst='master'))
|
||||
|
||||
return redirections
|
||||
|
Loading…
x
Reference in New Issue
Block a user