Skip to content

Commit f6cb8df

Browse files
authored
Merge pull request #39051 from github/repo-sync
Repo sync
2 parents 6064e72 + 78d90c4 commit f6cb8df

File tree

8 files changed

+99
-29
lines changed

8 files changed

+99
-29
lines changed

.github/workflows/lint-entire-content-data-markdown.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: 'Lint entire content and data markdown files'
22

3-
# **What it does**: Lints our content markdown weekly to ensure the content matches the specified styleguide. If errors exists, it opens a PR for the Docs content team to review.
3+
# **What it does**: Lints our content markdown weekly to ensure the content matches the specified styleguide. If errors or warnings exist, it opens an issue for the Docs content team to review.
44
# **Why we have it**: Extra precaution to run linter on the entire content/data directories.
55
# **Who does it impact**: Docs content.
66

@@ -32,7 +32,7 @@ jobs:
3232
id: linting-content-data
3333
timeout-minutes: 10
3434
continue-on-error: true
35-
run: npm run lint-content -- --errors-only --paths content data --output-file /tmp/error-lints.json
35+
run: npm run lint-content -- --paths content data --output-file /tmp/lint-results.json
3636

3737
- name: Open issue in docs-content
3838
if: ${{ always() && steps.linting-content-data.outcome == 'failure' }}
@@ -41,7 +41,7 @@ jobs:
4141
REPORT_AUTHOR: docs-bot
4242
REPORT_LABEL: broken content markdown report
4343
REPORT_REPOSITORY: github/docs-content
44-
run: npm run post-lints -- --path /tmp/error-lints.json
44+
run: npm run post-lints -- --path /tmp/lint-results.json
4545

4646
- uses: ./.github/actions/slack-alert
4747
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}

content/copilot/using-github-copilot/ai-models/choosing-the-right-ai-model-for-your-task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ Use this table to find a suitable model quickly, see more detail in the sections
2727
| {% data variables.copilot.copilot_o3 %} | Deep reasoning and debugging | Multi-step problem solving and architecture-level code analysis | Reasoning |
2828
| {% data variables.copilot.copilot_o3_mini %} | Fast help with simple or repetitive tasks | Quick responses for code snippets, explanations, and prototyping | Lower latency |
2929
| {% data variables.copilot.copilot_o4_mini %} | Fast help with simple or repetitive tasks | Fast, reliable answers to lightweight coding questions | Lower latency |
30-
| {% data variables.copilot.copilot_claude_opus %} | Deep reasoning and debugging | Advanced agentic workflows over large codebases, long-horizon projects | Reasoning |
30+
| {% data variables.copilot.copilot_claude_opus %} | Deep reasoning and debugging | Complex problem-solving challenges, sophisticated reasoning | Reasoning, vision |
3131
| {% data variables.copilot.copilot_claude_sonnet_35 %} | Fast help with simple or repetitive tasks | Quick responses for code, syntax, and documentation | Agent mode |
3232
| {% data variables.copilot.copilot_claude_sonnet_37 %} | Deep reasoning and debugging | Structured reasoning across large, complex codebases | Agent mode |
33-
| {% data variables.copilot.copilot_claude_sonnet_40 %} | Deep reasoning and debugging | High-performance code review, bug fixes, and efficient research workflows | Agent mode |
33+
| {% data variables.copilot.copilot_claude_sonnet_40 %} | Deep reasoning and debugging | Performance and practicality, perfectly balanced for coding workflows | Agent mode, vision |
3434
| {% data variables.copilot.copilot_gemini_25_pro %} | Deep reasoning and debugging | Complex code generation, debugging, and research workflows | Reasoning |
3535
| {% data variables.copilot.copilot_gemini_flash %} | Working with visuals (diagrams, screenshots) | Real-time responses and visual reasoning for UI and diagram-based tasks | Visual |
3636

content/copilot/using-github-copilot/ai-models/supported-ai-models-in-copilot.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ This table lists the AI models available in {% data variables.product.prodname_c
4040
| {% data variables.copilot.copilot_o3 %} | OpenAI | {% data variables.release-phases.public_preview_caps %} | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
4141
| {% data variables.copilot.copilot_o3_mini %} | OpenAI | GA | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
4242
| {% data variables.copilot.copilot_o4_mini %} | OpenAI | {% data variables.release-phases.public_preview_caps %} | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
43-
| {% data variables.copilot.copilot_claude_opus %} | Anthropic | {% data variables.release-phases.public_preview_caps %} | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
43+
| {% data variables.copilot.copilot_claude_opus %} | Anthropic | GA | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
4444
| {% data variables.copilot.copilot_claude_sonnet_35 %} | Anthropic | GA | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
4545
| {% data variables.copilot.copilot_claude_sonnet_37 %} | Anthropic | GA | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
4646
| {% data variables.copilot.copilot_claude_sonnet_37 %} Thinking | Anthropic | GA | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
47-
| {% data variables.copilot.copilot_claude_sonnet_40 %} | Anthropic | {% data variables.release-phases.public_preview_caps %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
47+
| {% data variables.copilot.copilot_claude_sonnet_40 %} | Anthropic | GA | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
4848
| {% data variables.copilot.copilot_gemini_25_pro %} | Google | {% data variables.release-phases.public_preview_caps %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
4949
| {% data variables.copilot.copilot_gemini_flash %} | Google | GA | {% octicon "x" aria-label="Not included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
5050

@@ -65,11 +65,11 @@ The following table shows which models are available in each client.
6565
| {% data variables.copilot.copilot_o3 %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
6666
| {% data variables.copilot.copilot_o3_mini %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
6767
| {% data variables.copilot.copilot_o4_mini %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
68-
| {% data variables.copilot.copilot_claude_opus %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "x" aria-label="Not included" %} | {% octicon "x" aria-label="Not included" %} | {% octicon "x" aria-label="Not included" %} | {% octicon "x" aria-label="Not included" %} |
68+
| {% data variables.copilot.copilot_claude_opus %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
6969
| {% data variables.copilot.copilot_claude_sonnet_35 %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
7070
| {% data variables.copilot.copilot_claude_sonnet_37 %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |{% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
7171
| {% data variables.copilot.copilot_claude_sonnet_37 %} Thinking | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
72-
| {% data variables.copilot.copilot_claude_sonnet_40 %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "x" aria-label="Not included" %} | {% octicon "x" aria-label="Not included" %} | {% octicon "x" aria-label="Not included" %} | {% octicon "x" aria-label="Not included" %} |
72+
| {% data variables.copilot.copilot_claude_sonnet_40 %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
7373
| {% data variables.copilot.copilot_gemini_25_pro %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
7474
| {% data variables.copilot.copilot_gemini_flash %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} | {% octicon "check" aria-label="Included" %} |
7575

data/reusables/organizations/additional-permissions.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,12 @@ For more information, see [AUTOTITLE](/discussions).
5858
* Dismiss or reopen {% data variables.product.prodname_dependabot_alerts %}
5959
* View {% data variables.product.prodname_secret_scanning %} results
6060
* Dismiss or reopen {% data variables.product.prodname_secret_scanning %} results
61+
62+
### Actions
63+
64+
* Manage {% data variables.product.prodname_actions %} general settings
65+
* Manage runners
66+
* Manage secrets
67+
* Manage variables
68+
* Manage environments (including environment secrets and variables)
69+

src/content-linter/scripts/post-lints.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { createReportIssue, linkReports } from '#src/workflows/issue-report.js'
1212
// the entire content and data directories based on our
1313
// markdownlint.js rules.
1414
//
15-
// If errors are found, it will open up a new issue in the
15+
// If errors or warnings are found, it will open up a new issue in the
1616
// docs-content repo with the label "broken content markdown report".
1717
//
1818
// The Content FR will go through the issue and update the content and
@@ -21,18 +21,20 @@ import { createReportIssue, linkReports } from '#src/workflows/issue-report.js'
2121
// [end-readme]
2222

2323
program
24-
.description('Opens an issue for Content FR with the errors from the weekly content/data linter.')
24+
.description(
25+
'Opens an issue for Content FR with the errors and warnings from the weekly content/data linter.',
26+
)
2527
.option(
2628
'-p, --path <path>',
27-
'provide a path to the errors output json file that will be in the issue body',
29+
'provide a path to the errors and warnings output json file that will be in the issue body',
2830
)
2931
.parse(process.argv)
3032

3133
const { path } = program.opts()
3234

3335
main()
3436
async function main() {
35-
const errors = fs.readFileSync(`${path}`, 'utf8')
37+
const lintResults = fs.readFileSync(`${path}`, 'utf8')
3638
const core = coreLib
3739
const { REPORT_REPOSITORY, REPORT_AUTHOR, REPORT_LABEL } = process.env
3840

@@ -41,18 +43,18 @@ async function main() {
4143
// or open an issue report, you might get cryptic error messages from Octokit.
4244
getEnvInputs(['GITHUB_TOKEN'])
4345

44-
core.info(`Creating issue for errors...`)
46+
core.info(`Creating issue for errors and warnings...`)
4547

4648
let reportBody = 'The following files have markdown lint warnings/errors:\n\n'
47-
for (const [file, flaws] of Object.entries(JSON.parse(errors))) {
49+
for (const [file, flaws] of Object.entries(JSON.parse(lintResults))) {
4850
reportBody += `File: \`${file}\`:\n`
4951
reportBody += `\`\`\`json\n${JSON.stringify(flaws, null, 2)}\n\`\`\`\n`
5052
}
5153

5254
const reportProps = {
5355
core,
5456
octokit,
55-
reportTitle: `Error(s) in content markdown file(s)`,
57+
reportTitle: `Error(s) and warning(s) in content markdown file(s)`,
5658
reportBody,
5759
reportRepository: REPORT_REPOSITORY,
5860
reportLabel: REPORT_LABEL,

src/frame/middleware/api.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { createProxyMiddleware } from 'http-proxy-middleware'
44
import events from '@/events/middleware.js'
55
import anchorRedirect from '@/rest/api/anchor-redirect.js'
66
import aiSearch from '@/search/middleware/ai-search'
7+
import aiSearchLocalProxy from '@/search/middleware/ai-search-local-proxy'
78
import search from '@/search/middleware/search-routes.js'
89
import pageList from '@/article-api/middleware/pagelist'
910
import article from '@/article-api/middleware/article'
@@ -31,16 +32,7 @@ if (process.env.CSE_COPILOT_ENDPOINT || process.env.NODE_ENV === 'test') {
3132
console.log(
3233
'Proxying AI Search requests to docs.github.com. To use the cse-copilot endpoint, set the CSE_COPILOT_ENDPOINT environment variable.',
3334
)
34-
router.use(
35-
'/ai-search',
36-
createProxyMiddleware({
37-
target: 'https://docs.github.com',
38-
changeOrigin: true,
39-
pathRewrite: function (path, req: ExtendedRequest) {
40-
return req.originalUrl
41-
},
42-
}),
43-
)
35+
router.use(aiSearchLocalProxy)
4436
}
4537
if (process.env.ELASTICSEARCH_URL) {
4638
router.use('/search', search)

src/search/components/input/SearchOverlay.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,6 @@ export function SearchOverlay({
481481
}
482482
}
483483
} else if (event.key === 'Enter') {
484-
if (searchLoading) {
485-
return
486-
}
487484
event.preventDefault()
488485
let pressedGroupKey = SEARCH_OVERLAY_EVENT_GROUP
489486
let pressedGroupId = searchEventGroupId
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// When in local development we want to proxy to the ai-search route at docs.github.com
2+
3+
import { Router, Request, Response, NextFunction } from 'express'
4+
import got from 'got'
5+
import { pipeline } from 'node:stream'
6+
7+
const router = Router()
8+
9+
const hopByHop = new Set([
10+
'connection',
11+
'keep-alive',
12+
'proxy-authenticate',
13+
'proxy-authorization',
14+
'te',
15+
'trailers',
16+
'transfer-encoding',
17+
'upgrade',
18+
])
19+
20+
function filterRequestHeaders(src: Request['headers']) {
21+
const out: Record<string, string | string[]> = {}
22+
for (const [key, value] of Object.entries(src)) {
23+
if (!value) continue
24+
const k = key.toLowerCase()
25+
if (hopByHop.has(k) || k === 'cookie' || k === 'host') continue
26+
out[key] = value
27+
}
28+
out['accept'] = 'application/x-ndjson'
29+
out['content-type'] = 'application/json'
30+
return out
31+
}
32+
33+
router.post('/ai-search/v1', async (req: Request, res: Response, next: NextFunction) => {
34+
try {
35+
const upstream = got.stream.post('https://docs.github.com/api/ai-search/v1', {
36+
headers: filterRequestHeaders(req.headers),
37+
body: JSON.stringify(req.body ?? {}),
38+
decompress: false,
39+
throwHttpErrors: false,
40+
retry: { limit: 0 },
41+
})
42+
43+
upstream.on('response', (uRes) => {
44+
res.status(uRes.statusCode || 500)
45+
46+
for (const [k, v] of Object.entries(uRes.headers)) {
47+
if (!v) continue
48+
const key = k.toLowerCase()
49+
// Never forward hop-by-hop; got already handles chunked → strip content-length
50+
if (hopByHop.has(key) || key === 'content-length') continue
51+
res.setHeader(k, v as string)
52+
}
53+
res.flushHeaders?.()
54+
})
55+
56+
pipeline(upstream, res, (err) => {
57+
if (err) {
58+
console.error('[ai-search proxy] pipeline error:', err)
59+
if (!res.headersSent) res.status(502).end('Bad Gateway')
60+
}
61+
})
62+
63+
upstream.on('error', (err) => console.error('[ai-search proxy] upstream error:', err))
64+
} catch (err) {
65+
console.error('[ai-search proxy] request failed:', err)
66+
next(err)
67+
}
68+
})
69+
70+
export default router

0 commit comments

Comments
 (0)