Skip to content

Repo sync #39723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/archives/tests/deprecated-enterprise-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ describe('recently deprecated redirects', () => {
})

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

test('deprecation warning banner includes the right text depending on the date', async () => {
// The deprecation banner is temporarily hidden for supported versions
test.skip('deprecation warning banner includes the right text depending on the date', async () => {
const { $ } = await getDOM(`/en/enterprise/${enterpriseServerReleases.oldestSupported}`)
const expectedString = enterpriseServerReleases.isOldestReleaseDeprecated
? 'was discontinued'
Expand Down
11 changes: 7 additions & 4 deletions src/rest/components/get-rest-code-samples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,11 @@ function getRequiredQueryParamsPath(operation: Operation, codeSample: CodeSample
}

function getAcceptHeader(codeSample: CodeSample) {
// This allows us to display custom media types like application/sarif+json
return codeSample?.response?.contentType?.includes('+json')
? codeSample.response.contentType
: 'application/vnd.github+json'
const contentType = codeSample?.response?.contentType

if (!contentType || contentType === 'application/json') {
return 'application/vnd.github+json'
}

return contentType
}
10 changes: 10 additions & 0 deletions src/versions/components/DeprecationBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import cx from 'classnames'

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

// GHES deprecation dates are being extended while
// performance issues are being addressed in versions >= 3.15.
// This banner should remain hidden for the supported versions (>=3.14) until
// new deprecation dates are announced.
const DEPRECATION_BANNER_EXCEPTIONS = ['3.14']

export const DeprecationBanner = () => {
const { data, enterpriseServerReleases } = useMainContext()
const { currentVersion } = useVersion()
Expand All @@ -23,6 +29,10 @@ export const DeprecationBanner = () => {
? enterpriseDeprecation.version_was_deprecated
: enterpriseDeprecation.version_will_be_deprecated

if (DEPRECATION_BANNER_EXCEPTIONS.some((version) => currentVersion.includes(version))) {
return null
}

return (
<div
data-testid="deprecation-banner"
Expand Down
Loading