Skip to content

Commit 5164fe9

Browse files
committed
yank outdated redirect code
1 parent 754ceda commit 5164fe9

1 file changed

Lines changed: 0 additions & 41 deletions

File tree

lib/redirects/precompile.js

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,6 @@ module.exports = async function precompileRedirects (pageList, pageMap) {
5050
const developerRouteWithLanguage = `/en${developerRoute}`
5151
allRedirects[developerRouteWithLanguage] = newPath
5252

53-
// TODO until we update all the old /v3 and /v4 links, we need to support redirects
54-
// from the old /enterprise/<number>/v3 format to the new /enterprise-server@<number/rest format
55-
// AS WELL AS /enterprise-server@<number/v3 to /enterprise-server@<number/rest.
56-
// This is because the new format gets created dynamically even when the links point to /v3 or /v4.
57-
// EXAMPLES:
58-
// /en/enterprise/2.20/v3/pulls/comments -> /en/enterprise-server@2.20/rest/reference/pulls#comments
59-
// /en/enterprise-server@2.20/v3/pulls/comments -> /en/enterprise-server@2.20/rest/reference/pulls#comments
60-
// NOTE: after we update all the /v3 and /v4 links, we can yank the following block
61-
if (developerRoute.includes('/enterprise/')) {
62-
const developerRouteWithNewFormat = developerRoute.replace(/\/enterprise\/(\d.\d\d)\//, '/enterprise-server@$1/')
63-
const developerRouteWithNewFormatWithLanguage = `/en${developerRouteWithNewFormat}`
64-
allRedirects[developerRouteWithNewFormat] = newPath
65-
allRedirects[developerRouteWithNewFormatWithLanguage] = newPath
66-
}
67-
// TODO ENDYANK
68-
6953
// although we only support developer Enterprise paths up to 2.21, we make
7054
// an exception to always redirect versionless paths to the latest version
7155
if (developerRoute.includes('/2.21/')) {
@@ -74,32 +58,7 @@ module.exports = async function precompileRedirects (pageList, pageMap) {
7458
const developerRouteWithLanguageWithoutVersion = `/en${developerRouteWithoutVersion}`
7559
allRedirects[developerRouteWithoutVersion] = newPathOnLatestVersion
7660
allRedirects[developerRouteWithLanguageWithoutVersion] = newPathOnLatestVersion
77-
// TODO after we update all the /v3 and /v4 links, we can yank the following
78-
const developerRouteWithoutVersionWithNewFormat = developerRouteWithoutVersion
79-
.replace('/enterprise/', 'enterprise-server')
80-
const developerRouteWithoutVersionWithNewFormatWithLanguage = `/en${developerRouteWithoutVersionWithNewFormat}`
81-
allRedirects[developerRouteWithoutVersionWithNewFormat] = newPathOnLatestVersion
82-
allRedirects[developerRouteWithoutVersionWithNewFormatWithLanguage] = newPathOnLatestVersion
83-
// TODO ENDYANK
84-
}
85-
86-
// TODO: TEMPORARILY support explicit 2.22 redirects (created on page render by lib/rewrite-local-links)
87-
// after we update `/v3` and `/v4` links everywhere to `/rest` and `/graphql`, we can
88-
// yank this entire block because 2.22 never existed on developer site
89-
if (developerRoute.includes('/2.21/')) {
90-
const newPath222 = newPath.replace('@2.21/', '@2.22/')
91-
const developerRoute222 = developerRoute.replace('/2.21/', '/2.22/')
92-
const developerRouteWithLanguage222 = `/en${developerRoute222}`
93-
allRedirects[developerRoute222] = newPath222
94-
allRedirects[developerRouteWithLanguage222] = newPath222
95-
96-
const developerRouteWithNewFormat222 = developerRoute222
97-
.replace('/enterprise/2.22/', '/enterprise-server@2.22/')
98-
const developerRouteWithNewFormatWithLanguage222 = `/en${developerRouteWithNewFormat222}`
99-
allRedirects[developerRouteWithNewFormat222] = newPath222
100-
allRedirects[developerRouteWithNewFormatWithLanguage222] = newPath222
10161
}
102-
// TODO ENDYANK
10362

10463
// given a developer route like `/enterprise/2.19/v3/activity`,
10564
// add a veriation like `/enterprise/2.19/user/v3/activity`;

0 commit comments

Comments
 (0)