remove no-longer-needed feature flag

This commit is contained in:
Sarah Schneider 2021-01-15 09:42:29 -05:00
Родитель 535dae5a8a
Коммит b4690547a7
3 изменённых файлов: 8 добавлений и 27 удалений

Просмотреть файл

@ -10,7 +10,7 @@ const plans = [
{ // free-pro-team is **not** a user-facing version and is stripped from URLs.
// See lib/remove-fpt-from-path.js for details.
plan: 'free-pro-team',
planTitle: process.env.FEATURE_REMOVE_FPT ? 'GitHub.com' : 'Free, Pro, and Team',
planTitle: 'Free, Pro, and Team',
releases: [latestNonNumberedRelease],
latestRelease: latestNonNumberedRelease,
nonEnterpriseDefault: true, // permanent way to refer to this plan if the name changes

Просмотреть файл

@ -57,22 +57,13 @@ module.exports = function getOldPathsFromPath (currentPath, languageCode, curren
// ------ BEGIN MODERN VERSION FORMAT REPLACEMENTS ------//
if (currentlySupportedVersions.includes(currentVersion) || versionSatisfiesRange(currentVersion, `>${lastReleaseWithLegacyFormat}`)) {
(new Set(oldPaths)).forEach(oldPath => {
if (!process.env.FEATURE_REMOVE_FPT) {
// create old path /github from new path /free-pro-team@latest/github
oldPaths.add(oldPath
.replace(`/${nonEnterpriseDefaultVersion}`, ''))
// create old path /github from new path /free-pro-team@latest/github
oldPaths.add(oldPath
.replace(`/${nonEnterpriseDefaultVersion}`, ''))
// create old path /free-pro-team/github from new path /free-pro-team@latest/github
oldPaths.add(oldPath
.replace('@latest', ''))
}
// TODO THIS ONE IS TRICKY BECAUSE OF VERSIONS TO ENABLE
// if (process.env.FEATURE_REMOVE_FPT) {
// // create old path /free-pro-team@latest/github from new path /github
// oldPaths.add(oldPath
// .replace(`/${nonEnterpriseDefaultVersion}`, ''))
// }
// create old path /free-pro-team/github from new path /free-pro-team@latest/github
oldPaths.add(oldPath
.replace('@latest', ''))
// create old path /enterprise/<version> from new path /enterprise-server@<version>
oldPaths.add(oldPath

Просмотреть файл

@ -30,17 +30,7 @@ module.exports = async (req, res, next) => {
}
// drop the version segment so pathParts now starts with /product
if (!process.env.FEATURE_REMOVE_FPT) {
pathParts.shift()
}
if (process.env.FEATURE_REMOVE_FPT) {
// if this is not FPT, drop the version segment so pathParts now starts with /product
// if this is FPT, there is no version segment so pathParts already starts with /product
if (req.context.currentVersion !== nonEnterpriseDefaultVersion) {
pathParts.shift()
}
}
pathParts.shift()
if (!pathParts[1]) return next()