Skip to content

Commit 497671e

Browse files
authored
Merge pull request #46376 from github/repo-sync
Repo sync
2 parents 4256ba0 + 2592c10 commit 497671e

44 files changed

Lines changed: 846 additions & 131 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/benchmark-pages.yml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,22 @@ jobs:
5151
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
5252
run: |
5353
echo "Reading benchmark results..."
54+
# The Run step pipes through tee, so a crashed benchmark passes that step and leaves no results file.
55+
if [ ! -s /tmp/benchmark-results.json ]; then
56+
echo "::error::No benchmark results file. The benchmark did not finish, so no issue was closed."
57+
exit 1
58+
fi
5459
ERRORS=$(jq '.errors | length' /tmp/benchmark-results.json 2>/dev/null || echo "0")
5560
SLOW=$(jq '.slow | length' /tmp/benchmark-results.json 2>/dev/null || echo "0")
5661
TOTAL=$(jq '.totalRequests' /tmp/benchmark-results.json 2>/dev/null || echo "0")
5762
P50=$(jq '.p50' /tmp/benchmark-results.json 2>/dev/null || echo "0")
5863
P99=$(jq '.p99' /tmp/benchmark-results.json 2>/dev/null || echo "0")
5964
MAX=$(jq '.max' /tmp/benchmark-results.json 2>/dev/null || echo "0")
6065
echo "Done reading results: $TOTAL pages, $ERRORS errors, $SLOW slow"
66+
if [ "$TOTAL" = "0" ] || [ "$TOTAL" = "null" ]; then
67+
echo "::error::Benchmark ran 0 requests, so no issue was closed."
68+
exit 1
69+
fi
6170
6271
VERSIONS="free-pro-team@latest, enterprise-cloud@latest, enterprise-server@latest"
6372
LANGS="en"

‎.github/workflows/headless-tests.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
matrix:
2828
node:
2929
- playwright-rendering
30+
- playwright-header
3031
- playwright-a11y
3132
- playwright-secret-scanning
3233
fail-fast: false

‎.github/workflows/orphaned-files-check.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
git push origin $branchname
8989
9090
body=$(cat <<-EOM
91-
Found with the `npm run find-orphaned-assets`, `npm run -s reusables -- find unused`, and `npm run find-orphaned-tables` scripts.
91+
Found with the \`npm run find-orphaned-assets\`, \`npm run -s reusables -- find unused\`, and \`npm run find-orphaned-tables\` scripts.
9292
9393
The orphaned files workflow file .github/workflows/orphaned-files-check.yml runs every Monday at 16:20 UTC / 8:20 PST.
9494

‎.github/workflows/sync-sdk-docs.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
# Publishing runs must start from the default branch because preserve-redirects.ts reads
5454
# live URLs from git HEAD. workflow_dispatch from another branch could write stale redirects.
5555
- name: Verify publishing runs start from the default branch
56-
if: github.event_name != 'pull_request' && inputs.dry_run != 'true'
56+
if: github.event_name != 'pull_request' && inputs.dry_run != true
5757
run: |
5858
if [ "$GITHUB_REF_NAME" != "$DEFAULT_BRANCH" ]; then
5959
echo "::error::This run would push and open a PR, but it started from" \
@@ -192,7 +192,7 @@ jobs:
192192
if: >-
193193
env.has_changes == 'true'
194194
&& github.event_name != 'pull_request'
195-
&& inputs.dry_run != 'true'
195+
&& inputs.dry_run != true
196196
env:
197197
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
198198
run: |
@@ -215,7 +215,7 @@ jobs:
215215
if: >-
216216
env.has_changes == 'true'
217217
&& github.event_name != 'pull_request'
218-
&& inputs.dry_run != 'true'
218+
&& inputs.dry_run != true
219219
env:
220220
GH_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
221221
run: |

‎Dockerfile‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Update the base image digest from the gh-base-noble package page:
66
# https://github.com/github/gh-base-image/pkgs/container/gh-base-image%2Fgh-base-noble
7-
FROM ghcr.io/github/gh-base-image/gh-base-noble:20261007-171807-gaf2071665@sha256:57e57e0d0dd8cf12cbf047aa5ae7ead850f562bc66bace621598a460b803efc7 AS base
7+
FROM ghcr.io/github/gh-base-image/gh-base-noble:20261016-181622-g7dfd3798b@sha256:d41c754579434b9b6479a3d3786a6a84ad7be50ce64626bbc07579ab4c36302b AS base
88
# Install curl for NodeSource setup.
99
# Install git for early-access and translation clones.
1010
# Ubuntu's nodejs package lags the Node LTS release line.
@@ -79,7 +79,7 @@ COPY --chown=node:node --from=clones $APP_HOME/content content/
7979
COPY --chown=node:node --from=clones $APP_HOME/translations translations/
8080
COPY --chown=node:node --from=prod_deps $APP_HOME/node_modules node_modules/
8181
COPY --chown=node:node --from=build $APP_HOME/.next .next/
82-
COPY --chown=node:node --from=warmup_cache $APP_HOME/.remotejson-cache ./
82+
COPY --chown=node:node --from=warmup_cache $APP_HOME/.remotejson-cache .remotejson-cache/
8383
# Expose the build SHA at runtime when callers pass --build-arg BUILD_SHA=abc123.
8484
ARG BUILD_SHA
8585
ENV BUILD_SHA=$BUILD_SHA

‎content/copilot/tutorials/customization-library/index.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spotlight:
1313
image: /assets/images/copilot-landing/generating_unit_tests.png
1414
- article: /prompt-files/your-first-prompt-file
1515
image: /assets/images/copilot-landing/improving_code_readability.png
16-
- article: /custom-instructions/your-first-custom-agent
16+
- article: /custom-agents/your-first-custom-agent
1717
image: /assets/images/copilot-landing/generating_unit_tests.png
1818
filters:
1919
- category

‎src/article-api/lib/get-all-toc-items.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ export async function getAllTocItems(
4848
}))
4949
.filter(
5050
(entry): entry is { childHref: string; childPage: PageWithChildren } =>
51-
entry.childPage !== undefined,
51+
entry.childPage !== undefined &&
52+
// resolvePath can return a page from another version, which the website hides.
53+
(!context.currentVersion ||
54+
entry.childPage.applicableVersions.includes(context.currentVersion)),
5255
)
5356

5457
const items = await Promise.all(

‎src/article-api/lib/get-link-data.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ export async function getLinkData(
1212
pathname: string,
1313
context: Context,
1414
) => Page | undefined,
15-
): Promise<LinkData> {
15+
): Promise<LinkData | null> {
1616
const linkedPage = resolvePath(href, languageCode, pathname, context)
17-
if (!linkedPage) return { href, title: href }
17+
if (!linkedPage) return null
18+
// resolvePath can return a page from another version, which the website hides.
19+
if (context.currentVersion && !linkedPage.applicableVersions.includes(context.currentVersion)) {
20+
return null
21+
}
1822

1923
const title = await linkedPage.renderTitle(context, { unwrap: true })
2024
const intro = linkedPage.intro
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import path from 'path'
2+
3+
import type { Context, Page } from '@/types'
4+
import type { LinkData } from '@/article-api/transformers/types'
5+
6+
// Match resolve-carousels and GHD056: try the content root first, then the landing page's directory.
7+
export async function resolveCarouselLinks(
8+
rawPaths: string[],
9+
page: Page,
10+
context: Context,
11+
): Promise<LinkData[]> {
12+
const { default: getPageLinkData } = await import('@/frame/lib/get-link-data')
13+
const options = { title: true, intro: true }
14+
const pageDir = page.relativePath ? path.posix.dirname(page.relativePath) : '.'
15+
16+
const links: LinkData[] = []
17+
for (const rawPath of rawPaths) {
18+
let linkData = await getPageLinkData(rawPath, context, options)
19+
// Liquid can render to an empty path, which would resolve to the landing page itself.
20+
if (!linkData?.length && pageDir !== '.' && !rawPath.includes('{')) {
21+
linkData = await getPageLinkData(path.posix.join('/', pageDir, rawPath), context, options)
22+
}
23+
for (const item of linkData || []) {
24+
// Versionless redirects can resolve to a page that does not exist in the requested version.
25+
if (
26+
context.currentVersion &&
27+
!item.page.applicableVersions.includes(context.currentVersion)
28+
) {
29+
continue
30+
}
31+
links.push({ href: item.href, title: item.title || '', intro: item.intro || '' })
32+
}
33+
}
34+
return links
35+
}

‎src/article-api/lib/resolve-path.ts‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,17 @@ export function resolvePath(
1717
const page =
1818
findPage(candidate, pages, redirects) ||
1919
findPage(candidate.replace(/\/?$/, '/'), pages, redirects)
20-
if (page) return page
20+
if (page) {
21+
// Content-root candidates span every version, so drop pages the web page would omit.
22+
if (
23+
href.startsWith('/content/') &&
24+
context.currentVersion &&
25+
!page.applicableVersions?.includes(context.currentVersion)
26+
) {
27+
return undefined
28+
}
29+
return page
30+
}
2131
}
2232

2333
return undefined
@@ -28,6 +38,17 @@ function* candidates(href: string, lang: string, pathname: string) {
2838
const langPrefix = `/${lang}/`
2939
const cleanPathname = pathname.replace(/\/$/, '')
3040

41+
// Children like /content/actions/workflows point at the content root, matching create-tree.ts.
42+
if (href.startsWith('/content/')) {
43+
const rest = href.slice('/content/'.length).replace(/\/$/, '')
44+
if (!rest) return
45+
yield `${langPrefix}${rest}`
46+
for (const version of allVersionKeys) {
47+
yield `${langPrefix}${version}/${rest}`
48+
}
49+
return
50+
}
51+
3152
if (href.startsWith(langPrefix)) {
3253
yield href
3354
} else if (href.startsWith('/')) {

0 commit comments

Comments
 (0)