Skip to content

Commit

Permalink
remove no-longer-needed feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahs committed Jan 15, 2021
1 parent 535dae5 commit b469054
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 27 deletions.
2 changes: 1 addition & 1 deletion lib/all-versions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 6 additions & 15 deletions lib/redirects/get-old-paths-from-permalink.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 /free-pro-team/github from new path /free-pro-team@latest/github
oldPaths.add(oldPath
.replace('@latest', ''))
}
// create old path /github from new path /free-pro-team@latest/github
oldPaths.add(oldPath
.replace(`/${nonEnterpriseDefaultVersion}`, ''))

// 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
Expand Down
12 changes: 1 addition & 11 deletions middleware/breadcrumbs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b469054

Please sign in to comment.