From b4690547a7af9b4e2f19873858c963f60439c5a0 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Fri, 15 Jan 2021 09:42:29 -0500 Subject: [PATCH] remove no-longer-needed feature flag --- lib/all-versions.js | 2 +- lib/redirects/get-old-paths-from-permalink.js | 21 ++++++------------- middleware/breadcrumbs.js | 12 +---------- 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/lib/all-versions.js b/lib/all-versions.js index d7fee98899..6f0f6027de 100644 --- a/lib/all-versions.js +++ b/lib/all-versions.js @@ -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 diff --git a/lib/redirects/get-old-paths-from-permalink.js b/lib/redirects/get-old-paths-from-permalink.js index a8781a72fb..b0acb22000 100644 --- a/lib/redirects/get-old-paths-from-permalink.js +++ b/lib/redirects/get-old-paths-from-permalink.js @@ -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/ from new path /enterprise-server@ oldPaths.add(oldPath diff --git a/middleware/breadcrumbs.js b/middleware/breadcrumbs.js index bc77e0cfc8..88cb31b425 100644 --- a/middleware/breadcrumbs.js +++ b/middleware/breadcrumbs.js @@ -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()