Skip to content

Commit 3aeaabe

Browse files
authored
Merge pull request #39723 from github/repo-sync
Repo sync
2 parents c4a1366 + a1b475c commit 3aeaabe

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

src/archives/tests/deprecated-enterprise-versions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ describe('recently deprecated redirects', () => {
138138
})
139139

140140
describe('deprecation banner', () => {
141-
test('renders a deprecation warning banner on oldest supported Enterprise version', async () => {
141+
// The deprecation banner is temporarily hidden for supported versions
142+
test.skip('renders a deprecation warning banner on oldest supported Enterprise version', async () => {
142143
const { $ } = await getDOM(`/en/enterprise/${enterpriseServerReleases.oldestSupported}`)
143144
expect($('[data-testid=deprecation-banner]').length).toBe(1)
144145
})
@@ -153,7 +154,8 @@ describe('deprecation banner', () => {
153154
expect($('[data-testid=deprecation-banner] b').text().endsWith('discontinued on .')).toBe(false)
154155
})
155156

156-
test('deprecation warning banner includes the right text depending on the date', async () => {
157+
// The deprecation banner is temporarily hidden for supported versions
158+
test.skip('deprecation warning banner includes the right text depending on the date', async () => {
157159
const { $ } = await getDOM(`/en/enterprise/${enterpriseServerReleases.oldestSupported}`)
158160
const expectedString = enterpriseServerReleases.isOldestReleaseDeprecated
159161
? 'was discontinued'

src/rest/components/get-rest-code-samples.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,11 @@ function getRequiredQueryParamsPath(operation: Operation, codeSample: CodeSample
498498
}
499499

500500
function getAcceptHeader(codeSample: CodeSample) {
501-
// This allows us to display custom media types like application/sarif+json
502-
return codeSample?.response?.contentType?.includes('+json')
503-
? codeSample.response.contentType
504-
: 'application/vnd.github+json'
501+
const contentType = codeSample?.response?.contentType
502+
503+
if (!contentType || contentType === 'application/json') {
504+
return 'application/vnd.github+json'
505+
}
506+
507+
return contentType
505508
}

src/versions/components/DeprecationBanner.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ import cx from 'classnames'
66

77
import styles from './DeprecationBanner.module.scss'
88

9+
// GHES deprecation dates are being extended while
10+
// performance issues are being addressed in versions >= 3.15.
11+
// This banner should remain hidden for the supported versions (>=3.14) until
12+
// new deprecation dates are announced.
13+
const DEPRECATION_BANNER_EXCEPTIONS = ['3.14']
14+
915
export const DeprecationBanner = () => {
1016
const { data, enterpriseServerReleases } = useMainContext()
1117
const { currentVersion } = useVersion()
@@ -23,6 +29,10 @@ export const DeprecationBanner = () => {
2329
? enterpriseDeprecation.version_was_deprecated
2430
: enterpriseDeprecation.version_will_be_deprecated
2531

32+
if (DEPRECATION_BANNER_EXCEPTIONS.some((version) => currentVersion.includes(version))) {
33+
return null
34+
}
35+
2636
return (
2737
<div
2838
data-testid="deprecation-banner"

0 commit comments

Comments
 (0)