Redirects to master should always be temporary

We *know* that requirements will have a stable/train branch soon; make
sure clients don't go caching the redirect to master.

Change-Id: I8507d86e4f553b698163be61665267d42e033d91
Related-Change: Ia2e8c46c27ac97217576afdd1677efba4b99fc37
This commit is contained in:
Tim Burke 2019-10-03 13:58:21 -07:00
parent 79b8f22b7e
commit e392f0bd48
2 changed files with 5 additions and 4 deletions

View File

@ -41,7 +41,8 @@ def generate_constraints_redirections(_deliverables, future_releases=[]):
# Insert into the begining of the list so that redirections are
# master -> juno
redirections.insert(0, dict(code=301, src=deliv.series,
status = 302 if target == 'master' else 301
redirections.insert(0, dict(code=status, src=deliv.series,
ref_type=ref_type, dst=target))
for series in future_releases:

View File

@ -122,7 +122,7 @@ class TestRedirections(base.BaseTestCase):
deliverables = FakeDeliverables([
self.OPEN_DEVELOPMENT,
])
self.assertEqual([dict(code=301, src='stein', ref_type='branch',
self.assertEqual([dict(code=302, src='stein', ref_type='branch',
dst='master')],
generate_constraints_redirections(deliverables))
@ -130,7 +130,7 @@ class TestRedirections(base.BaseTestCase):
deliverables = FakeDeliverables([
self.DEVELOPMENT_RELEASE,
])
self.assertEqual([dict(code=301, src='stein', ref_type='branch',
self.assertEqual([dict(code=302, src='stein', ref_type='branch',
dst='master')],
generate_constraints_redirections(deliverables))
@ -172,7 +172,7 @@ class TestRedirections(base.BaseTestCase):
self.STABLE_RELEASE,
self.DEVELOPMENT_RELEASE,
])
self.assertEqual([dict(code=301, src='stein', ref_type='branch',
self.assertEqual([dict(code=302, src='stein', ref_type='branch',
dst='master'),
dict(code=301, src='rocky', ref_type='branch',
dst='stable/rocky'),