diff --git a/tools/www-generator.py b/tools/www-generator.py index 6fb4f5da3c..7cdfc30428 100755 --- a/tools/www-generator.py +++ b/tools/www-generator.py @@ -436,6 +436,14 @@ _INFRA_REPOS_EXCEPTION = [ '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 def _get_official_repos(): @@ -449,6 +457,7 @@ def _get_official_repos(): regular_repos = [] infra_repos = [] deliverables = set() + retired_repos = [] # NOTE(dhellmann): We could get fancy and support loading # 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: 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, - template_files, template_file, output_directory, - is_publish, extra={}): + retired_repos, template_files, template_file, + output_directory, is_publish, extra={}): logger = logging.getLogger() logger.info("generating %s", template_file) @@ -538,6 +552,7 @@ def render_template(environment, project_data, regular_repos, infra_repos, RELEASED_SERIES=RELEASED_SERIES, MAINTAINED_SERIES=MAINTAINED_SERIES, SERIES_IN_DEVELOPMENT=SERIES_IN_DEVELOPMENT, + RETIRED_REPOS=retired_repos, TOPDIR=topdir, SCRIPTDIR=scriptdir, CSSDIR=cssdir, @@ -579,7 +594,8 @@ def main(): logger = initialize_logging(args.debug, args.verbose) 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 ...") project_data = load_project_data( source_directory=args.source_directory, @@ -616,6 +632,7 @@ def main(): project_data, regular_repos, infra_repos, + retired_repos, template_files, template_file, args.output_directory, diff --git a/www/.htaccess b/www/.htaccess index 5cc353d1fe..9bfbfe97ff 100644 --- a/www/.htaccess +++ b/www/.htaccess @@ -218,6 +218,18 @@ redirect 301 /doc-contrib-guide/ui-text-guidelines /doc-contrib-guide/ux-ui-guid {%- endfor %} # 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 # https://zuul-ci.org/docs/zuul redirectmatch 301 /infra/zuul/feature/zuulv3(.*)$ https://zuul-ci.org/docs/zuul$1 diff --git a/www/project-data/latest.yaml b/www/project-data/latest.yaml index f42fa32499..4d47608fad 100644 --- a/www/project-data/latest.yaml +++ b/www/project-data/latest.yaml @@ -822,10 +822,6 @@ service: Toolset for testing interoperability between OpenStack clouds. type: tool -- name: syntribos - service: Automated API security testing tool. - type: tool - - name: charm-guide type: deployment service: Understanding Juju Charms for deploying OpenStack diff --git a/www/redirect-tests.txt b/www/redirect-tests.txt index 7dc647bb26..2ecd515dea 100644 --- a/www/redirect-tests.txt +++ b/www/redirect-tests.txt @@ -243,6 +243,18 @@ {%- endfor %} # 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 # https://zuul-ci.org/docs/zuul /infra/zuul/feature/zuulv3/user/config.html 301 https://zuul-ci.org/docs/zuul/user/config.html