-
Notifications
You must be signed in to change notification settings - Fork 255
/
Copy pathredirect-tests.txt
339 lines (278 loc) · 14 KB
/
redirect-tests.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
{# NOTE(dhellmann): This file is not in a series directory,
so we need to set the series name ourselves. #}
{% set series = 'latest' %}
{% set projects = PROJECT_DATA[series] %}
{# Macro to generate tests for a specific directory to a
given page, allowing the path to not have a trailing slash.
Arguments:
path -- the partial regex representing the input path (should not end in /)
result -- the result pattern
code -- the response code (defaults to 301)
#}
{% macro dir_to_page(path, result, code=301) -%}
{{ path }} {{ code }} {{ result }}
{{ path }}/ {{ code }} {{ result }}
{%- endmacro %}
{# Macro to generate tests for anything under a given path to a
given page, allowing the path to not have a trailing slash.
Arguments:
path -- the partial regex representing the input path (should not end in /)
result -- the result pattern
code -- the response code (defaults to 301)
#}
{% macro path_to_page(path, result, code=301) -%}
{{ dir_to_page(path, result, code) }}
{{ path }}/any-page {{ code }} {{ result }}
{{ path }}/any-page.html {{ code }} {{ result }}
{%- endmacro %}
{# Macro to generate redirects for a given path to a location under
the RELEASED_SERIES. The result argument should be the sub-directory
under RELEASED_SERIES.
Arguments:
path -- the partial regex representing the input path (should not end in /)
result -- the subdirectory under /RELEASED_SERIES, (should start with /)
code -- the response code (defaults to 301)
#}
{% macro path_to_released_series(path, result, code=301) -%}
{{ path_to_page(path, '/' + RELEASED_SERIES + result, code) }}
{%- endmacro %}
{# Macro to generate tests for deep links under a page.
A trailing catch-all pattern is appended and can be referenced in
the result value.
Arguments:
path -- the partial regex representing the input path (should not end in /)
result_prefix -- the start of the new path (should not include /)
code -- the response code (defaults to 301)
#}
{% macro deep_links(path, result_prefix, code=301, nosuffix=True) -%}
{{ path }} {{ code }} {{ result_prefix }}/
{{ path }}/ {{ code }} {{ result_prefix }}/
{{ path }}/any-page {{ code }} {{ result_prefix }}/any-page
{{ path }}/any-page.html {{ code }} {{ result_prefix }}/any-page.html
{%- if nosuffix %}
{{ path }}suffix 200
{{ path }}suffix/ 200
{{ path }}suffix/any-page 200
{{ path }}suffix/any-page.html 200
{% endif -%}
{%- endmacro %}
{# Macro to handle project renames.
Arguments:
old -- The previous name of the project.
new -- The new name of the project.
#}
{% macro rename_project(old, new) -%}
{{ deep_links('/' + old, '/' + new) }}
{%- endmacro %}
# Redirect old top-level HTML pages to the version under most recent
# full release.
/ 301 /{{ RELEASED_SERIES }}/
/index.html 301 /{{ RELEASED_SERIES }}/
/openstack-projects.html 301 /{{ RELEASED_SERIES }}/projects.html
/language-bindings.html 301 /{{ RELEASED_SERIES }}/language-bindings.html
# Redirect docs.openstack.org index.html subpage pointers to main page
{{ dir_to_page('/install', '/' + RELEASED_SERIES + '/install/') }}
{{ dir_to_page('/basic-install', '/' + RELEASED_SERIES + '/install/') }}
{{ dir_to_page('/run', '/') }}
/developer/index.html 301 /{{ RELEASED_SERIES }}/projects.html
{{ dir_to_page('/cli', '/') }}
/api/api-specs.html 301 https://docs.openstack.org/api-quick-start/index.html
# Redirect old Admin Guides to new landing page
{{ path_to_released_series('/admin-guide', '/admin/') }}
{{ path_to_released_series('/user-guide-admin', '/admin/') }}
# A doc generation bug resulted in Google indexing links containing "//", which cause
# problems with linked content (images/css/etc). This rule generates a 301 redirect
# for these links.
#
# details: https://bugs.launchpad.net/openstack-manuals/+bug/1288513
/a//b/ 301 /a/b/
# Redirect networking-guide since it is now versioned
{{ dir_to_page('/networking-guide', '/ocata/networking-guide/') }}
# Redirect old releases content to new location
{{ deep_links('/releases', 'http://releases.openstack.org') }}
# redirect all kuryr sub-repositories appropriately
{{ deep_links('/developer/kuryr-kubernetes', '/kuryr-kubernetes/latest') }}
{{ deep_links('/developer/kuryr-libnetwork', '/kuryr-libnetwork/latest') }}
{{ deep_links('/developer/kuryr-tempest-plugin', '/kuryr-tempest-plugin/latest') }}
# redirect all kolla sub-repositories appropriately
{{ deep_links('/developer/kolla-kubernetes', '/kolla-kubernetes/latest') }}
# Redirect all openstack-ansible repositories appropriately
{{ deep_links('/developer/ansible-hardening', '/ansible-hardening/latest') }}
{{ deep_links('/developer/openstack-ansible-foo', '/openstack-ansible-foo/latest', nosuffix=False) }}
# Redirect some tripleo repositories appropriately
{{ deep_links('/developer/tripleo-common', '/tripleo-common/latest') }}
{{ deep_links('/developer/tripleo-quickstart', '/tripleo-quickstart/latest') }}
{{ deep_links('/developer/tripleo-validations', '/tripleo-validations/latest') }}
# Redirect sahara repositories appropriately
{{ deep_links('/developer/sahara-tests', '/sahara-tests/latest') }}
# Redirect removed user guide
{{ path_to_released_series('/user-guide', '/user/') }}
# Redirect removed ops guide
{{ path_to_released_series('/ops-guide', '/admin/') }}
{{ path_to_released_series('/ops', '/admin/') }}
{{ path_to_released_series('/openstack-ops', '/admin/') }}
{{ path_to_released_series('/trunk/openstack-ops', '/admin/') }}
# Redirect api list
{{ path_to_released_series('/api', '/api/') }}
# Redirect missing project page for openstack-charms
{{ path_to_page('/openstack-charms', '/charm-guide/') }}
# Redirect old security index
{{ path_to_page('/sec', '/security-guide/') }}
{{ path_to_page('/security-guide/content', '/security-guide/') }}
# Redirect to series indexes
{{ path_to_page('/latest/configuration', '/' + SERIES_IN_DEVELOPMENT + '/configuration/') }}
{{ path_to_page('/latest/install', '/' + SERIES_IN_DEVELOPMENT + '/install/') }}
{{ path_to_released_series('/user', '/user/') }}
{{ path_to_page('/latest/user', '/' + SERIES_IN_DEVELOPMENT + '/user/') }}
{{ path_to_released_series('/admin', '/admin/') }}
{{ path_to_page('/latest/admin', '/' + SERIES_IN_DEVELOPMENT + '/admin/') }}
{{ dir_to_page('/latest', '/' + SERIES_IN_DEVELOPMENT + '/') }}
# Redirect some pages users search for
{{ path_to_page('/arch-design/content', '/arch-design/') }}
{{ path_to_page('/image-guide/content', '/image-guide/') }}
{{ path_to_released_series('/admin-guide-cloud', '/admin/') }}
{{ path_to_page('/trunk/openstack-compute', '/nova/latest/admin/') }}
/glossary/content/glossary.html 301 /doc-contrib-guide/common/glossary.html
{{ dir_to_page('/icehouse/training-guides', '/upstream-training/') }}
# Redirect changed directory name for the Contributor Guide
{{ deep_links('/contributor-guide', '/doc-contrib-guide') }}
# Redirect changed sub-directory name in the Contributor Guide
/doc-contrib-guide/ui-text-guidelines.html 301 /doc-contrib-guide/ux-ui-guidelines/ui-text-guidelines.html
/doc-contrib-guide/ui-text-guidelines 301 /doc-contrib-guide/ux-ui-guidelines
# Redirect any deploy guide project directory back to the current stable index
{{ dir_to_page('/project-deploy-guide', '/' + RELEASED_SERIES + '/deploy/') }}
# Redirect all the project deploy folders to their appropriate branch
{# newton is a special case because it exists but is not maintained #}
{{ dir_to_page('/project-deploy-guide/newton', '/newton/deploy/') }}
{% for series in MAINTAINED_SERIES %}
{{ dir_to_page('/project-deploy-guide/' + series, '/' + series + '/deploy/') }}
{% endfor %}
# Ensure each project's deloy guide is reachable.
/project-deploy-guide/openstack-ansible/latest/ 200
/project-deploy-guide/openstack-ansible/pike/ 200
/project-deploy-guide/openstack-ansible/ocata/ 200
/project-deploy-guide/openstack-ansible/newton/ 200
/project-deploy-guide/kolla-ansible/pike/ 200
/project-deploy-guide/kolla-ansible/ocata/ 200
# Redirect old install guide list pages to their new home
{{ path_to_page('/havana/install-guide', '/havana/') }}
{{ path_to_page('/icehouse/install-guide', '/icehouse/') }}
{{ path_to_page('/juno/install-guide', '/juno/') }}
{{ path_to_page('/kilo/install-guide', '/kilo/') }}
{{ path_to_page('/mitaka/install-guide', '/mitaka/') }}
{{ dir_to_page('/project-install-guide/newton', '/newton/install/') }}
{{ deep_links('/project-install-guide/ocata', '/ocata/install') }}
# Redirecting infra docs links to new location
{{ deep_links('/infra/shade', '/shade/latest') }}
# Redirecting old project developer docs to the new layout. If a
# project has an in-tree .htaccess file, assume it can handle the full
# path in the redirect. Otherwise, redirect everything to the new
# latest index.html.
{% for project in projects|sort(attribute='name') -%}
{%- if project.has_in_tree_htaccess %}
{{ deep_links('/developer/' + project.name, '/' + project.name + '/latest') }}
{% else %}
{{ path_to_page('/developer/' + project.name, '/' + project.name + '/latest/') }}
{% endif -%}
{%- endfor %}
# Redirect project contributor docs for stable series to latest
/nova/wallaby/contributor 301 /nova/latest/contributor
/swift/xena/contributor/ 301 /swift/latest/contributor/
/cinder/pike/contributor/foo.html 301 /cinder/latest/contributor/foo.html
# Redirect old cli-reference to the OSC latest docs
{{ path_to_page('/cli-reference', '/python-openstackclient/latest/') }}
# Redirects from service-type to code-name
{% for project in projects -%}
{%- if project.type == 'service' and project.service_type and (project.service_type|lower != project.name) %}
{{ path_to_page('/' + project.service_type|lower, '/' + project.name + '/latest/', code=302) }}
{%- endif %}
{%- endfor %}
# End service-type redirects
# Redirect project-deploy-guide/code-name to project-deploy-guide/code-name/latest
{% for project in projects -%}
{%- if project.type == 'deployment' %}
{{ dir_to_page('/project-deploy-guide/' + project.name, '/project-deploy-guide/' + project.name + '/latest/') }}
{%- endif %}
{%- endfor %}
# End redirect project-deploy-guide
# Redirects from code-name without a series to latest
{% for repo in REGULAR_REPOS %}
{{ dir_to_page('/' + repo.base, '/' + repo.base + '/latest/') }}
{%- endfor %}
# End latest code-name redirects
# Redirects from infra code-name without a series to location
{% for repo in INFRA_REPOS %}
{{ dir_to_page('/' + repo.base, '/infra/' + repo.base + '/') }}
{%- 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
/infra/zuul/feature/zuulv3/index.html 301 https://zuul-ci.org/docs/zuul/index.html
# End redirect zuul/feature/zuulv3
# Redirect zuul to zuul-ci.org
{{ deep_links('/infra/zuul', 'https://zuul-ci.org/docs/zuul') }}
# End redirect zuul to zuul-ci.org
# Redirect https://docs.openstack.org/infra/nodepool/feature/zuulv3/ to
# https://zuul-ci.org/docs/nodepool
/infra/nodepool/feature/zuulv3/index.html 301 https://zuul-ci.org/docs/nodepool/index.html
# End redirect nodepool/feature/zuulv3
# Redirect nodepool to zuul-ci.org
{{ deep_links('/infra/nodepool', 'https://zuul-ci.org/docs/nodepool') }}
# End redirect nodepool to zuul-ci.org
# Redirect zuul-base-jobs to zuul-ci.org
{{ deep_links('/infra/zuul-base-jobs', 'https://zuul-ci.org/docs/zuul-base-jobs') }}
# End redirect zuul-base-jobs to zuul-ci.org
# Redirect zuul-jobs to zuul-ci.org
{{ deep_links('/infra/zuul-jobs', 'https://zuul-ci.org/docs/zuul-jobs') }}
# End redirect zuul-jobs to zuul-ci.org
# Redirect zuul-sphinx to zuul-ci.org
{{ deep_links('/infra/zuul-sphinx', 'https://zuul-ci.org/docs/zuul-sphinx') }}
# End redirect zuul-sphinx to zuul-ci.org
# Redirect from python-openstacksdk to openstacksdk
{{ rename_project('python-openstacksdk', 'openstacksdk') }}
# End redirect for openstacksdk
# Redirect from monasca to monasca-api
{{ rename_project('monasca', 'monasca-api') }}
# End redirect for monasca-api
# Redirect outdated bare metal installation guide
{{ deep_links('/project-install-guide/baremetal/draft', '/ironic/latest/install') }}
# End redirect outdated bare metal installation guide
# Redirect https://docs.openstack.org/infra/bindep to
# https://docs.opendev.org/opendev/bindep
{{ deep_links('/infra/bindep', 'https://docs.opendev.org/opendev/bindep/latest') }}
# End redirect bindep
# Redirect https://docs.openstack.org/infra/git-review to
# https://docs.opendev.org/opendev/git-review
{{ deep_links('/infra/git-review', 'https://docs.opendev.org/opendev/git-review/latest') }}
# End redirect git-review
# Redirect https://docs.openstack.org/infra/manual to
# https://docs.opendev.org/opendev/infra-manual
{{ deep_links('/infra/manual', 'https://docs.opendev.org/opendev/infra-manual/latest') }}
# End redirect infra-manual
# Redirect https://docs.openstack.org/infra/system-config to
# https://docs.opendev.org/opendev/system-config
{{ deep_links('/infra/system-config', 'https://docs.opendev.org/opendev/system-config/latest') }}
# End redirect system-config
# Redirect https://docs.openstack.org/python-tempestconf to
# https://docs.opendev.org/openinfra/python-tempestconf
{{ deep_links('/python-tempestconf', 'https://docs.opendev.org/openinfra/python-tempestconf') }}
# End redirect python-tempestconf
# Redirect https://docs.openstack.org/refstack to
# https://docs.opendev.org/openinfra/refstack
{{ deep_links('/refstack', 'https://docs.opendev.org/openinfra/refstack') }}
# End redirect refstack
# Redirect 2023.1.antelope, 2023.2.bobcat to 2023.1, 2023.2 respectively
{{ deep_links('/2023.1.antelope', '/2023.1') }}
{{ deep_links('/2023.2.bobcat', '/2023.2') }}
# End Redirect 2023.1.antelope, 2023.2.bobcat