Skip to content

Commit ed47b5e

Browse files
authored
Merge pull request #40030 from github/repo-sync
Repo sync
2 parents fd4f180 + b10595f commit ed47b5e

File tree

9 files changed

+78
-32
lines changed

9 files changed

+78
-32
lines changed

src/frame/middleware/render-page.ts

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { get } from 'lodash-es'
55

66
import getMiniTocItems from '@/frame/lib/get-mini-toc-items'
77
import patterns from '@/frame/lib/patterns'
8-
import { pathLanguagePrefixed } from '@/languages/lib/languages'
98
import FailBot from '@/observability/lib/failbot'
109
import statsd from '@/observability/lib/statsd'
1110
import type { ExtendedRequest } from '@/types'
@@ -16,7 +15,6 @@ import { isConnectionDropped } from './halt-on-dropped-connection'
1615
import { nextHandleRequest } from './next'
1716

1817
const STATSD_KEY_RENDER = 'middleware.render_page'
19-
const STATSD_KEY_404 = 'middleware.render_404'
2018

2119
async function buildRenderedPage(req: ExtendedRequest): Promise<string> {
2220
const { context } = req
@@ -69,33 +67,10 @@ export default async function renderPage(req: ExtendedRequest, res: Response) {
6967
)
7068
}
7169

72-
if (!pathLanguagePrefixed(req.path)) {
73-
defaultCacheControl(res)
74-
return res.status(404).type('html').send(minimumNotFoundHtml)
75-
}
76-
77-
// For App Router migration: All language-prefixed 404s should use App Router
78-
statsd.increment(STATSD_KEY_404, 1, [
79-
`url:${req.url}`,
80-
`path:${req.path}`,
81-
`referer:${req.headers.referer || ''}`,
82-
])
83-
70+
// send minimal 404 at this point since we ran into hydration issues trying to pass
71+
// these along to AppRouter 404 handling
8472
defaultCacheControl(res)
85-
86-
// Create a mock request that will be handled by App Router
87-
const mockReq = Object.create(req)
88-
mockReq.url = '/404'
89-
mockReq.path = '/404'
90-
mockReq.method = 'GET'
91-
92-
// Only pass pathname
93-
res.setHeader('x-pathname', req.path)
94-
95-
// Import nextApp and handle directly
96-
const { nextApp } = await import('./next')
97-
res.status(404)
98-
return nextApp.getRequestHandler()(mockReq, res)
73+
return res.status(404).type('html').send(minimumNotFoundHtml)
9974
}
10075

10176
// Just finish fast without all the details like Content-Length

src/frame/tests/server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ describe('server', () => {
9090
expect($.res.statusCode).toBe(404)
9191
})
9292

93+
test('renders a 404 for language prefixed versioned non-existent pages', async () => {
94+
const res = await get('/en/enterprise-cloud@latest/nonexistent-page')
95+
expect(res.statusCode).toBe(404)
96+
})
97+
9398
// When using `got()` to send full end-to-end URLs, you can't use
9499
// URLs like in this test because got will
95100
// throw `RequestError: URI malformed`.

src/graphql/data/fpt/changelog.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
[
2+
{
3+
"schemaChanges": [
4+
{
5+
"title": "The GraphQL schema includes these changes:",
6+
"changes": [
7+
"<p>Field <code>viewerCanSetFields</code> was added to object type <code>Issue</code></p>",
8+
"<p>Field <code>viewerCanSeeIssueFields</code> was added to object type <code>Repository</code></p>"
9+
]
10+
}
11+
],
12+
"previewChanges": [],
13+
"upcomingChanges": [],
14+
"date": "2025-08-26"
15+
},
216
{
317
"schemaChanges": [
418
{

src/graphql/data/fpt/schema.docs.graphql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19546,6 +19546,11 @@ type Issue implements Assignable & Closable & Comment & Deletable & Labelable &
1954619546
"""
1954719547
viewerCanReopen: Boolean!
1954819548

19549+
"""
19550+
Check if the current viewer can set fields on the issue.
19551+
"""
19552+
viewerCanSetFields: Boolean
19553+
1954919554
"""
1955019555
Check if the viewer is able to change their subscription status for the repository.
1955119556
"""
@@ -51312,6 +51317,11 @@ type Repository implements Node & PackageOwner & ProjectOwner & ProjectV2Recent
5131251317
reason: "Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC."
5131351318
)
5131451319

51320+
"""
51321+
Indicates whether the current user can see issue fields in this repository
51322+
"""
51323+
viewerCanSeeIssueFields: Boolean!
51324+
5131551325
"""
5131651326
Check if the viewer is able to change their subscription status for the repository.
5131751327
"""

src/graphql/data/fpt/schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30735,6 +30735,14 @@
3073530735
"kind": "scalars",
3073630736
"href": "/graphql/reference/scalars#boolean"
3073730737
},
30738+
{
30739+
"name": "viewerCanSetFields",
30740+
"description": "<p>Check if the current viewer can set fields on the issue.</p>",
30741+
"type": "Boolean",
30742+
"id": "boolean",
30743+
"kind": "scalars",
30744+
"href": "/graphql/reference/scalars#boolean"
30745+
},
3073830746
{
3073930747
"name": "viewerCanSubscribe",
3074030748
"description": "<p>Check if the viewer is able to change their subscription status for the repository.</p>",
@@ -67952,6 +67960,14 @@
6795267960
"isDeprecated": true,
6795367961
"deprecationReason": "<p>Projects (classic) is being deprecated in favor of the new Projects experience, see: <a href=\"https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/\">https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/</a>. Removal on 2025-04-01 UTC.</p>"
6795467962
},
67963+
{
67964+
"name": "viewerCanSeeIssueFields",
67965+
"description": "<p>Indicates whether the current user can see issue fields in this repository.</p>",
67966+
"type": "Boolean!",
67967+
"id": "boolean",
67968+
"kind": "scalars",
67969+
"href": "/graphql/reference/scalars#boolean"
67970+
},
6795567971
{
6795667972
"name": "viewerCanSubscribe",
6795767973
"description": "<p>Check if the viewer is able to change their subscription status for the repository.</p>",

src/graphql/data/ghec/schema.docs.graphql

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19546,6 +19546,11 @@ type Issue implements Assignable & Closable & Comment & Deletable & Labelable &
1954619546
"""
1954719547
viewerCanReopen: Boolean!
1954819548

19549+
"""
19550+
Check if the current viewer can set fields on the issue.
19551+
"""
19552+
viewerCanSetFields: Boolean
19553+
1954919554
"""
1955019555
Check if the viewer is able to change their subscription status for the repository.
1955119556
"""
@@ -51312,6 +51317,11 @@ type Repository implements Node & PackageOwner & ProjectOwner & ProjectV2Recent
5131251317
reason: "Projects (classic) is being deprecated in favor of the new Projects experience, see: https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/. Removal on 2025-04-01 UTC."
5131351318
)
5131451319

51320+
"""
51321+
Indicates whether the current user can see issue fields in this repository
51322+
"""
51323+
viewerCanSeeIssueFields: Boolean!
51324+
5131551325
"""
5131651326
Check if the viewer is able to change their subscription status for the repository.
5131751327
"""

src/graphql/data/ghec/schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30735,6 +30735,14 @@
3073530735
"kind": "scalars",
3073630736
"href": "/graphql/reference/scalars#boolean"
3073730737
},
30738+
{
30739+
"name": "viewerCanSetFields",
30740+
"description": "<p>Check if the current viewer can set fields on the issue.</p>",
30741+
"type": "Boolean",
30742+
"id": "boolean",
30743+
"kind": "scalars",
30744+
"href": "/graphql/reference/scalars#boolean"
30745+
},
3073830746
{
3073930747
"name": "viewerCanSubscribe",
3074030748
"description": "<p>Check if the viewer is able to change their subscription status for the repository.</p>",
@@ -67952,6 +67960,14 @@
6795267960
"isDeprecated": true,
6795367961
"deprecationReason": "<p>Projects (classic) is being deprecated in favor of the new Projects experience, see: <a href=\"https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/\">https://github.blog/changelog/2024-05-23-sunset-notice-projects-classic/</a>. Removal on 2025-04-01 UTC.</p>"
6795467962
},
67963+
{
67964+
"name": "viewerCanSeeIssueFields",
67965+
"description": "<p>Indicates whether the current user can see issue fields in this repository.</p>",
67966+
"type": "Boolean!",
67967+
"id": "boolean",
67968+
"kind": "scalars",
67969+
"href": "/graphql/reference/scalars#boolean"
67970+
},
6795567971
{
6795667972
"name": "viewerCanSubscribe",
6795767973
"description": "<p>Check if the viewer is able to change their subscription status for the repository.</p>",

src/secret-scanning/data/public-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5558,7 +5558,7 @@
55585558
isPublic: true
55595559
isPrivateWithGhas: true
55605560
hasPushProtection: true
5561-
hasValidityCheck: '{% ifversion fpt or ghes %}false{% else %}true{% endif %}'
5561+
hasValidityCheck: false
55625562
base64Supported: false
55635563
isduplicate: true
55645564
- provider: WorkOS
@@ -5571,7 +5571,7 @@
55715571
isPublic: true
55725572
isPrivateWithGhas: true
55735573
hasPushProtection: true
5574-
hasValidityCheck: '{% ifversion fpt or ghes %}false{% else %}true{% endif %}'
5574+
hasValidityCheck: false
55755575
base64Supported: false
55765576
isduplicate: true
55775577
- provider: xAI
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"sha": "428b03b8d51ba2b06dcd11b03a5548e627c64faf",
3-
"blob-sha": "7acf4c4d90e79612ebf5f405772e3678a1757711",
2+
"sha": "44a6c7a210c90e7d599674b70e8835b5292b4215",
3+
"blob-sha": "c74f02d913adea5b78986158480cb9533e41bafe",
44
"targetFilename": "code-security/secret-scanning/introduction/supported-secret-scanning-patterns"
55
}

0 commit comments

Comments
 (0)