Skip to content

Commit c535e25

Browse files
Merge branch 'main' into main
2 parents a540e27 + 107fb4e commit c535e25

File tree

799 files changed

+110295
-50579
lines changed

Some content is hidden

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

799 files changed

+110295
-50579
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# To find available Node images, see https://mcr.microsoft.com/en-us/product/devcontainers/javascript-node/tags
2-
3-
# [Choice] Node.js version
4-
ARG VARIANT="dev-24-bullseye"
5-
FROM mcr.microsoft.com/devcontainers/javascript-node:${VARIANT}
2+
ARG VARIANT=dev-24-bullseye
3+
FROM mcr.microsoft.com/devcontainers/javascript-node:dev-24-bullseye@sha256:3502f1f21b1989500e8c72ada7d6e496dc4540b0707d4ea4ff743077f88a6c2d

.github/actions/labeler/labeler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* See function main in this file for documentation */
22

3-
import coreLib from '@actions/core'
3+
import * as coreLib from '@actions/core'
44
import { type Octokit } from '@octokit/rest'
55
import { CoreInject } from '@/links/scripts/action-injections'
66

.github/instructions/all.instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ When you create a pull request:
1212

1313
1. **Always** make the first line of the PR description the following (in italics):
1414

15-
`_Copilot Chat generated this pull request._`
15+
`_GitHub Copilot generated this pull request._`
1616

17-
2. Optionally, you may include a collapsed section summarizing the prompt or discussion with Copilot Chat:
17+
2. Optionally, you may include a collapsed section summarizing the prompt or discussion with Copilot:
1818

1919
```markdown
2020
<details><summary>Prompt summary - submitted by @GITHUB-USER-ID</summary>
@@ -29,4 +29,4 @@ When you create a pull request:
2929
3. Label with "llm-generated".
3030
4. If an issue exists, include "fixes owner/repo#issue" or "towards owner/repo#issue" as appropriate.
3131
5. Always create PRs in **draft mode** using `--draft` flag.
32-
6. Always _escape backticks_ when you use gh cli.
32+
6. When you are using gh cli, always _escape backticks_.

.github/instructions/code.instructions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ For code reviews, follow guidelines, tests, and validate instructions. For creat
99
## Guidelines
1010

1111
- If available, use ripgrep (`rg`) instead of `grep`.
12-
- Make sure to always _escape backticks_ when using gh cli.
12+
- When using gh cli, always _escape backticks_.
1313
- All scripts should be listed in `package.json` and use `tsx`.
14-
- Whenever you create or comment on an issue or pull request, indicate you are an LLM.
15-
- Be careful fetching full HTML pages off the internet. Prefer to use gh cli whenever possible for github.com. Limit the number of tokens when grabbing HTML.
14+
- Whenever you create or comment on an issue or pull request, indicate you are GitHub Copilot.
15+
- Be careful fetching full HTML pages off the internet. Prefer to use MCP or gh cli whenever possible for github.com. Limit the number of tokens when grabbing HTML.
1616
- Avoid pull requests with over 300 lines of code changed. When significantly larger, offer to split up into smaller pull requests if possible.
1717
- All new code should be written in TypeScript and not JavaScript.
1818
- We use absolute imports, relative to the `src` directory, using the `@` symbol. For example, `getRedirect` which lives in `src/redirects/lib/get-redirect.ts` can be imported with `import getRedirect from '@/redirects/lib/get-redirect'`. The same rule applies for TypeScript (`.ts`) imports, e.g. `import type { GeneralSearchHit } from '@/search/types'`
@@ -43,7 +43,7 @@ Run the following commands to validate your changes:
4343

4444
0. Ask the human if they would like you to follow these steps.
4545
1. If this is new work, make sure you have the latest changes by running `git checkout main && git pull`. If this is existing work, update the branch you are working on with the head branch -- usually `main`.
46-
2. If the human provides a GitHub issue, use gh cli to read the issue and all comments.
46+
2. If the human provides a GitHub issue, use MCP or gh cli to read the issue and all comments.
4747
3. Begin by evaluating impact, effort, and estimate non-test lines of code that will change. Ask for more context and examples if needed.
4848
4. If you are running in agentic mode, _stop_ at this point and request approval from the human.
4949
5. If you need to add or change tests, work on tests before implementing.
@@ -52,7 +52,7 @@ Run the following commands to validate your changes:
5252
8. Validate that any new or changed tests pass. See "Tests".
5353
9. Validate that these changes meet our guidelines. See "Guidelines".
5454
10. If you are running in agentic mode, _stop_ at this point and request review before continuing. Suggest how the human should review the changes.
55-
11. If a branch and pull request already exist, commit and push, then _concisely_ comment on the pull request that you are an LLM and what changes you made and why.
55+
11. If a branch and pull request already exist, commit and push, then _concisely_ comment on the pull request that you are GitHub Copilot and what changes you made and why.
5656
12. If this is new work and no pull request exists yet, make a pull request:
5757
- label "llm-generated"
5858
- draft mode
@@ -61,4 +61,4 @@ Run the following commands to validate your changes:
6161
14. If you are in agentic mode, offer to do any or all of:
6262
- mark the pull request as ready,
6363
- assign the issue to the human if it is not already assigned,
64-
- _concisely_ comment on the issue explaining the change, indicating you are an LLM.
64+
- _concisely_ comment on the issue explaining the change, indicating you are GitHub Copilot.

.github/workflows/check-broken-links-github-github.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ jobs:
4444
PORT: 4000
4545
ENABLED_LANGUAGES: en
4646
run: |
47-
48-
npm run start &
47+
npm run start-for-ci &
4948
sleep 5
50-
curl --retry-connrefused --retry 3 -I http://localhost:4000/
49+
curl --retry-connrefused --retry 5 -I http://localhost:4000/
5150
5251
- name: Run broken github/github link check
5352
run: |

.github/workflows/index-general-search.yml

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ on:
2626
permissions:
2727
contents: read
2828

29-
# This allows a subsequently queued workflow run to cancel previous runs
29+
# This allows a subsequently queued workflow run to cancel previous runs.
30+
# Include the triggering workflow's conclusion in the group so that runs triggered
31+
# by skipped Purge Fastly workflows don't cancel runs triggered by successful ones.
3032
concurrency:
31-
group: '${{ github.workflow }} @ ${{ github.head_ref }} ${{ github.event_name }}'
33+
group: '${{ github.workflow }} @ ${{ github.head_ref }} ${{ github.event_name }} ${{ github.event.workflow_run.conclusion }}'
3234
cancel-in-progress: true
3335

3436
env:
@@ -40,7 +42,9 @@ env:
4042

4143
jobs:
4244
figureOutMatrix:
43-
if: ${{ github.repository == 'github/docs-internal' }}
45+
# Skip immediately if triggered by a non-successful Purge Fastly run.
46+
# This prevents skipped runs from canceling valid indexing runs via concurrency.
47+
if: ${{ github.repository == 'github/docs-internal' && (github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success') }}
4448
runs-on: ubuntu-latest
4549
outputs:
4650
matrix: ${{ steps.set-matrix.outputs.result }}
@@ -55,11 +59,13 @@ jobs:
5559
const allPossible = ["en", ...allNonEnglish]
5660
5761
if (context.eventName === "workflow_run") {
62+
// Job-level `if` already ensures we only get here for successful runs,
63+
// but keep this as a safety check.
5864
if (context.payload.workflow_run.conclusion === "success") {
5965
return ["en"]
6066
}
61-
console.warn(`NOTE! It was a workflow_run but not success ('${context.payload.workflow_run.conclusion}')`)
62-
console.warn("This means we're not going to index anything in the next dependent step.")
67+
// This shouldn't happen due to job-level filter, but handle gracefully.
68+
console.warn(`Unexpected: workflow_run with conclusion '${context.payload.workflow_run.conclusion}'`)
6369
return []
6470
}
6571
@@ -224,21 +230,64 @@ jobs:
224230
FASTLY_SURROGATE_KEY: api-search:${{ matrix.language }}
225231
run: npm run purge-fastly-edge-cache
226232

227-
- name: Alert on scraping failures
228-
if: ${{ steps.check-failures.outputs.has_failures == 'true' && github.event_name != 'workflow_dispatch' }}
229-
uses: ./.github/actions/slack-alert
233+
- name: Upload failures artifact
234+
if: ${{ steps.check-failures.outputs.has_failures == 'true' }}
235+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
236+
with:
237+
name: search-failures-${{ matrix.language }}
238+
path: /tmp/records/failures-summary.json
239+
retention-days: 1
240+
241+
- uses: ./.github/actions/slack-alert
242+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
230243
with:
231244
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
232245
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
233-
message: |
234-
:warning: ${{ steps.check-failures.outputs.failed_pages }} page(s) failed to scrape for general search indexing (language: ${{ matrix.language }})
235246

236-
The indexing completed but some pages could not be scraped. This may affect search results for those pages.
247+
notifyScrapingFailures:
248+
name: Notify scraping failures
249+
needs: updateElasticsearchIndexes
250+
if: ${{ always() && github.repository == 'github/docs-internal' && github.event_name != 'workflow_dispatch' && needs.updateElasticsearchIndexes.result != 'cancelled' }}
251+
runs-on: ubuntu-latest
252+
steps:
253+
- name: Check out repo
254+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
255+
256+
- name: Download all failure artifacts
257+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
258+
with:
259+
pattern: search-failures-*
260+
path: /tmp/failures
261+
continue-on-error: true
237262

238-
Workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
263+
- name: Check if any failures were downloaded
264+
id: check-artifacts
265+
run: |
266+
if [ -d /tmp/failures ] && [ "$(ls -A /tmp/failures 2>/dev/null)" ]; then
267+
echo "has_artifacts=true" >> $GITHUB_OUTPUT
268+
else
269+
echo "has_artifacts=false" >> $GITHUB_OUTPUT
270+
fi
239271
240-
- uses: ./.github/actions/slack-alert
241-
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
272+
- uses: ./.github/actions/node-npm-setup
273+
if: ${{ steps.check-artifacts.outputs.has_artifacts == 'true' }}
274+
275+
- name: Aggregate failures and format message
276+
if: ${{ steps.check-artifacts.outputs.has_artifacts == 'true' }}
277+
id: aggregate
278+
run: |
279+
RESULT=$(npx tsx src/search/scripts/aggregate-search-index-failures.ts /tmp/failures \
280+
--workflow-url "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}")
281+
{
282+
echo 'result<<EOF'
283+
echo "$RESULT"
284+
echo 'EOF'
285+
} >> "$GITHUB_OUTPUT"
286+
287+
- name: Send consolidated Slack notification
288+
if: ${{ steps.check-artifacts.outputs.has_artifacts == 'true' }}
289+
uses: ./.github/actions/slack-alert
242290
with:
243291
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
244292
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
293+
message: ${{ fromJSON(steps.aggregate.outputs.result).message }}

.github/workflows/link-check-daily.yml

Lines changed: 0 additions & 106 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Check External Links
2+
3+
# Runs weekly (Wednesday) at 16:20 UTC
4+
# Validates external URLs in content files
5+
6+
on:
7+
schedule:
8+
- cron: '20 16 * * 3' # Wednesday at 16:20 UTC
9+
workflow_dispatch:
10+
inputs:
11+
max_urls:
12+
description: 'Maximum number of URLs to check (leave blank for all)'
13+
type: number
14+
15+
permissions:
16+
contents: read
17+
issues: write
18+
19+
jobs:
20+
check-external-links:
21+
if: github.repository == 'github/docs-internal'
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 180 # 3 hours for external checks
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
27+
28+
- uses: ./.github/actions/node-npm-setup
29+
30+
- name: Install dependencies
31+
run: npm ci
32+
33+
- name: Check external links
34+
env:
35+
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
36+
CACHE_MAX_AGE_DAYS: '7'
37+
run: |
38+
if [[ -n "${{ inputs.max_urls }}" ]]; then
39+
npm run check-links-external -- --max ${{ inputs.max_urls }}
40+
else
41+
npm run check-links-external
42+
fi
43+
44+
- name: Upload report artifact
45+
if: always()
46+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
47+
with:
48+
name: external-link-report
49+
path: artifacts/external-link-report.*
50+
retention-days: 14
51+
if-no-files-found: ignore
52+
53+
- name: Check if report exists
54+
if: always()
55+
id: check_report
56+
run: |
57+
if [ -f "artifacts/external-link-report.md" ]; then
58+
echo "has_report=true" >> $GITHUB_OUTPUT
59+
else
60+
echo "has_report=false" >> $GITHUB_OUTPUT
61+
echo "No broken link report generated - all links valid!"
62+
fi
63+
64+
- name: Create issue if broken links found
65+
if: always() && steps.check_report.outputs.has_report == 'true'
66+
uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v5
67+
with:
68+
token: ${{ secrets.DOCS_BOT_PAT_BASE }}
69+
repository: github/docs-content
70+
title: '🌐 Broken External Links Report'
71+
content-filepath: artifacts/external-link-report.md
72+
labels: broken link report
73+
74+
- uses: ./.github/actions/slack-alert
75+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
76+
with:
77+
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
78+
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

0 commit comments

Comments
 (0)