Merge "Redirect retired repos"

This commit is contained in:
Zuul 2020-06-16 12:43:24 +00:00 committed by Gerrit Code Review
commit 660f465d5d
4 changed files with 45 additions and 8 deletions

View File

@ -436,6 +436,14 @@ _INFRA_REPOS_EXCEPTION = [
'openstack/reviewstats' 'openstack/reviewstats'
] ]
# List of repos that are retired, we link /REPO/latest/.* to
# it's README.rst file.
_RETIRED_REPOS = [
'openstack/congress',
'openstack/faafo',
'openstack/syntribos',
]
@cache @cache
def _get_official_repos(): def _get_official_repos():
@ -449,6 +457,7 @@ def _get_official_repos():
regular_repos = [] regular_repos = []
infra_repos = [] infra_repos = []
deliverables = set() deliverables = set()
retired_repos = []
# NOTE(dhellmann): We could get fancy and support loading # NOTE(dhellmann): We could get fancy and support loading
# governance data from a local repo so we could support zuul's # governance data from a local repo so we could support zuul's
@ -479,12 +488,17 @@ def _get_official_repos():
elif repo not in _IGNORED_REPOS: elif repo not in _IGNORED_REPOS:
add({'name': repo, 'base': base}) add({'name': repo, 'base': base})
return (regular_repos, infra_repos, list(sorted(deliverables))) for repo in _RETIRED_REPOS:
base = repo.rsplit('/')[-1]
retired_repos.append({'name': repo, 'base': base})
return (regular_repos, infra_repos, retired_repos,
list(sorted(deliverables)))
def render_template(environment, project_data, regular_repos, infra_repos, def render_template(environment, project_data, regular_repos, infra_repos,
template_files, template_file, output_directory, retired_repos, template_files, template_file,
is_publish, extra={}): output_directory, is_publish, extra={}):
logger = logging.getLogger() logger = logging.getLogger()
logger.info("generating %s", template_file) logger.info("generating %s", template_file)
@ -538,6 +552,7 @@ def render_template(environment, project_data, regular_repos, infra_repos,
RELEASED_SERIES=RELEASED_SERIES, RELEASED_SERIES=RELEASED_SERIES,
MAINTAINED_SERIES=MAINTAINED_SERIES, MAINTAINED_SERIES=MAINTAINED_SERIES,
SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT, SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT,
RETIRED_REPOS=retired_repos,
TOPDIR=topdir, TOPDIR=topdir,
SCRIPTDIR=scriptdir, SCRIPTDIR=scriptdir,
CSSDIR=cssdir, CSSDIR=cssdir,
@ -579,7 +594,8 @@ def main():
logger = initialize_logging(args.debug, args.verbose) logger = initialize_logging(args.debug, args.verbose)
logger.debug("getting official repos ...") logger.debug("getting official repos ...")
regular_repos, infra_repos, deliverables = _get_official_repos() (regular_repos, infra_repos, retired_repos,
deliverables) = _get_official_repos()
logger.debug("loading project data ...") logger.debug("loading project data ...")
project_data = load_project_data( project_data = load_project_data(
source_directory=args.source_directory, source_directory=args.source_directory,
@ -616,6 +632,7 @@ def main():
project_data, project_data,
regular_repos, regular_repos,
infra_repos, infra_repos,
retired_repos,
template_files, template_files,
template_file, template_file,
args.output_directory, args.output_directory,

View File

@ -218,6 +218,18 @@ redirect 301 /doc-contrib-guide/ui-text-guidelines /doc-contrib-guide/ux-ui-guid
{%- endfor %} {%- endfor %}
# End infra code-name redirects # End infra code-name redirects
# Redirects retired repos from code-name without a series to latest
{% for repo in RETIRED_REPOS %}
{{ dir_to_page('/' + repo.base, '/' + repo.base + '/latest/') }}
{%- endfor %}
# End latest code-name redirects
# Redirects retired repos to https://opendev.org/openstack/REPO/src/branch/master/README.rst
{% for repo in RETIRED_REPOS %}
{{ path_to_page('/' + repo.base + '/latest', 'https://opendev.org/' + repo.name + '/src/branch/master/README.rst' ) }}
{%- endfor %}
# End retired repos redirects
# Redirect https://docs.openstack.org/infra/zuul/feature/zuulv3/ to # Redirect https://docs.openstack.org/infra/zuul/feature/zuulv3/ to
# https://zuul-ci.org/docs/zuul # https://zuul-ci.org/docs/zuul
redirectmatch 301 /infra/zuul/feature/zuulv3(.*)$ https://zuul-ci.org/docs/zuul$1 redirectmatch 301 /infra/zuul/feature/zuulv3(.*)$ https://zuul-ci.org/docs/zuul$1

View File

@ -822,10 +822,6 @@
service: Toolset for testing interoperability between OpenStack clouds. service: Toolset for testing interoperability between OpenStack clouds.
type: tool type: tool
- name: syntribos
service: Automated API security testing tool.
type: tool
- name: charm-guide - name: charm-guide
type: deployment type: deployment
service: Understanding Juju Charms for deploying OpenStack service: Understanding Juju Charms for deploying OpenStack

View File

@ -243,6 +243,18 @@
{%- endfor %} {%- endfor %}
# End infra code-name redirects # End infra code-name redirects
# Redirects retired repos from code-name without a series to latest
{% for repo in RETIRED_REPOS %}
{{ dir_to_page('/' + repo.base, '/' + repo.base + '/latest/') }}
{%- endfor %}
# End latest code-name redirects
# Redirects retired repos /latest to https://opendev.org/openstack/REPO/src/branch/master/README.rst
{% for repo in RETIRED_REPOS %}
{{ path_to_page('/' + repo.base + '/latest', 'https://opendev.org/' + repo.name + '/src/branch/master/README.rst' ) }}
{%- endfor %}
# End retired repos redirects
# Redirect https://docs.openstack.org/infra/zuul/feature/zuulv3/ to # Redirect https://docs.openstack.org/infra/zuul/feature/zuulv3/ to
# https://zuul-ci.org/docs/zuul # https://zuul-ci.org/docs/zuul
/infra/zuul/feature/zuulv3/user/config.html 301 https://zuul-ci.org/docs/zuul/user/config.html /infra/zuul/feature/zuulv3/user/config.html 301 https://zuul-ci.org/docs/zuul/user/config.html