Skip to content

Commit c923ec4

Browse files
authored
Merge branch 'main' into repo-sync
2 parents c858815 + 8e7b1a0 commit c923ec4

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

lib/enterprise-server-releases.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ export const dates = JSON.parse(
1212
// Some frontmatter may contain the upcoming GHES release number
1313
export const next = '3.2'
1414

15-
export const supported = ['3.1', '3.0', '2.22', '2.21']
15+
export const supported = ['3.1', '3.0', '2.22']
1616
export const deprecated = [
17+
'2.21',
1718
'2.20',
1819
'2.19',
1920
'2.18',

lib/patterns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const dataReference = /{% ?data\s(?:early-access\.)?(?:reusables|variable
2929
export const imagePath = /\/?assets\/images\/.*?\.(png|svg|gif|pdf|ico|jpg|jpeg)/gi
3030
export const homepagePath = /^\/\w{2}$/ // /en, /ja /cn
3131
export const multipleSlashes = /^\/{2,}/
32-
export const assetPaths = /\/(?:javascripts|stylesheets|assets|node_modules|dist)\//
32+
export const assetPaths = /\/(?:javascripts|stylesheets|assets|node_modules|dist|_next)\//
3333
export const oldApiPath = /\/v[34]\/(?!guides|overview).+?\/.+/
3434
export const staticRedirect = /<link rel="canonical" href="(.+?)">/
3535
export const enterpriseNoVersion = /\/enterprise\/([^\d].*$)/

script/enterprise-server-deprecations/archive-version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class RewriteAssetPathsPlugin {
6565
// https://githubdocs.azureedge.net/github-images/enterprise/2.17/assets/images/foo/bar.png
6666
if (resource.isHtml()) {
6767
newBody = text.replace(
68-
/(?<attribute>src|href)="(?:\.\.\/)*(?<basepath>dist|javascripts|stylesheets|assets\/fonts|assets\/images|node_modules)/g,
68+
/(?<attribute>src|href)="(?:\.\.\/)*(?<basepath>_next\/static|javascripts|stylesheets|assets\/fonts|assets\/images|node_modules)/g,
6969
(match, attribute, basepath) => {
7070
let replaced = path.join('/enterprise', this.version, basepath)
7171
if (basepath === 'assets/images') {

tests/linting/lint-files.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import renderContent from '../../lib/render-content/index.js'
1919
import getApplicableVersions from '../../lib/get-applicable-versions.js'
2020
import { execSync } from 'child_process'
2121
import { allVersions } from '../../lib/all-versions.js'
22-
import { supported, next } from '../../lib/enterprise-server-releases.js'
22+
import { supported, next, deprecated } from '../../lib/enterprise-server-releases.js'
2323
import { getLiquidConditionals } from '../../script/helpers/get-liquid-conditionals.js'
2424
import allowedVersionOperators from '../../lib/liquid-tags/ifversion-supported-operators.js'
2525
const __dirname = path.dirname(fileURLToPath(import.meta.url))
@@ -1102,10 +1102,12 @@ function validateIfversionConditionals(conds) {
11021102
`Found a "${operator}" operator inside "${cond}", but "${operator}" is not supported`
11031103
)
11041104
}
1105-
// NOTE: The following will throw errors when we deprecate a version until we run the script to remove the
1106-
// deprecated versioning. If we deprecate a version before we have a working version of that script,
1107-
// we can comment out this part of the test temporarily and re-enable it once the script is ready.
1108-
if (!(supported.includes(release) || release === next)) {
1105+
// Check that the versions in conditionals are supported
1106+
// versions of GHES or the first deprecated version. Allowing
1107+
// the first deprecated version to exist in code ensures
1108+
// allows us to deprecate the version before removing
1109+
// the old liquid content.
1110+
if (!(supported.includes(release) || release === next || deprecated[0] === release)) {
11091111
errors.push(
11101112
`Found ${release} inside "${cond}", but ${release} is not a supported GHES release`
11111113
)

0 commit comments

Comments
 (0)