forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Enterprise Liquid deprecation handling to use new versions (gi…
…thub#15818) * update Liquid deprecation fixtures to use new versions * update module that removes deprecated GHES frontmatter for new versions * update module that removes deprecated GHES conditionals for new versions * update script to use new versions and also remove internal-developer checkout option * update deprecated Liquid tests to use new versions * remove unnecessary leading slash in getEnterpriseServerNumber pattern * include a step that runs script/remove-unused-assets.js * Update script/remove-deprecated-enterprise-version-markup.js Co-authored-by: Jason Etcovitch <[email protected]> * require script instead of execSync Co-authored-by: Jason Etcovitch <[email protected]>
- Loading branch information
Showing
14 changed files
with
211 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
module.exports = function removeDeprecatedFrontmatter (data, devCheckout, versionToDeprecate, nextOldestVersion) { | ||
// there are currently different frontmatter conventions for developer docs vs. help docs | ||
if (devCheckout) { | ||
// skip files with no exclude_version frontmatter | ||
if (!data.exclude_version) return data | ||
const { getEnterpriseServerNumber } = require('./patterns') | ||
|
||
// remove frontmatter like exclude_version: - "2.13" | ||
if (data.exclude_version.includes(`${versionToDeprecate}`)) { | ||
data.exclude_version = data.exclude_version.filter(version => !version.match(versionToDeprecate)) | ||
module.exports = function removeDeprecatedFrontmatter (file, frontmatterVersions, versionToDeprecate, nextOldestVersion) { | ||
// skip files with no versions or Enterprise Server versions frontmatter | ||
if (!frontmatterVersions) return | ||
if (!frontmatterVersions['enterprise-server']) return | ||
|
||
if (!data.exclude_version.length) delete data.exclude_version | ||
} | ||
} else { | ||
// skip files with no versions or Enterprise versions frontmatter | ||
if (!data.versions) return data | ||
if (!data.versions.enterprise) return data | ||
const enterpriseRange = frontmatterVersions['enterprise-server'] | ||
|
||
// change frontmatter like enterprise: '>=2.13' to enterprise: '*' | ||
if (data.versions.enterprise === `>=${versionToDeprecate}` || data.versions.enterprise === `>=${nextOldestVersion}`) { | ||
data.versions.enterprise = '*' | ||
} | ||
} | ||
// skip files with versions frontmatter that applies to all enterprise-server releases | ||
if (enterpriseRange === '*') return | ||
|
||
// get the release numbers alone | ||
const releaseToDeprecate = versionToDeprecate.match(getEnterpriseServerNumber)[1] | ||
const nextOldestRelease = nextOldestVersion.match(getEnterpriseServerNumber)[1] | ||
|
||
return data | ||
// if the release to deprecate is 2.13, and the FM is either '>=2.13' or '>=2.14', | ||
// we can safely change the FM to enterprise-server: '*' | ||
if (enterpriseRange === `>=${releaseToDeprecate}` || enterpriseRange === `>=${nextOldestRelease}`) { | ||
frontmatterVersions['enterprise-server'] = '*' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.