Skip to content

Commit 2936f9e

Browse files
Merge branch 'main' into gem-clarification-reusable
2 parents aa26a99 + 2228d11 commit 2936f9e

File tree

1,222 files changed

+293847
-968138
lines changed

Some content is hidden

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

1,222 files changed

+293847
-968138
lines changed

.github/actions/retry-command/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ inputs:
77
max_attempts:
88
description: 'Maximum number of retry attempts'
99
required: false
10-
default: '8'
10+
default: '12'
1111
delay:
1212
description: 'Delay between attempts in seconds'
1313
required: false
14-
default: '15'
14+
default: '30'
1515

1616
runs:
1717
using: 'composite'

.github/copilot-instructions.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
1-
This documentation repository consists mainly of content written in Markdown format. These files are converted into HTML for displaying on a website. Most Markdown files become a single article on the documentation site. Other files contain reusable content which is inserted into multiple articles. The repository also contains YAML files (e.g. for variable text), image files, JavaScript/TypeScript files, etc.
1+
This repository contains code to run the GitHub Docs site on docs.github.com, as well as the content that is displayed on the site. The code is written in JavaScript and TypeScript, and the content is primarily written in Markdown.
2+
3+
Changes to files in `src/*` or files with `.ts` or `.js` extensions are likely code-related changes. Please follow the engineering guidelines below when making changes to these files.
4+
5+
Changes to files in `content/*` and `data/*` are likely content-related changes. Content changes include updates to articles, reusable content, and data files that define variables used in articles. Please follow the content guidelines below when making changes to these files.
6+
7+
## Engineering guidelines
8+
9+
### Scripts
10+
11+
All scripts can be found in `package.json`.
12+
13+
To validate any code changes:
14+
- `npm run tsc`
15+
- `npm run build`
16+
- `npm run prettier`
17+
- `npm run lint`: you can include `-- --fix`
18+
19+
To validate specific changes,
20+
- `npm run test`: For all unit tests
21+
- You can pass specific paths, e.g. `npm run test -- src/search/tests/ai-search-proxy`
22+
- You can add `--silent=false` to include `console.log` debugging.
23+
- `npm run build && npm run playwright-test -- playwright-rendering`: You need to build for changes outside of the test to be picked up. We use playwright for all rendering and end-to-end tests
24+
- You can add `--ui` to keep open `localhost:4000` which can be viewed in a simple browser for debugging UI state.
25+
- `npm run dev` to start the development server on `localhost:4000`.
26+
27+
### Imports
28+
29+
We use absolute imports, relative to the `src` directory, using the `@` symbol.
30+
31+
For example, `getRedirect` which lives inn `src/redirects/lib/get-redirect.js` can be imported with `import getRedirect from '@/redirects/lib/get-redirect'`.
32+
33+
The same rule applies for TypeScript (`.ts`) imports, e.g. `import type { GeneralSearchHit } from '@/search/types'`
34+
35+
### Testing changes
36+
37+
We use `vitest` to write unit tests. Tests live in their own files in the `tests` subdirectory of a source (src) directory, e.g. `src/search/tests/api-ai-search.ts`.
38+
39+
For integration tests, we can use the mock server in `src/tests/mocks/start-mock-server.ts` to mock exteneral requests.
40+
41+
For UI rendering tests, we use `playwright` and write tests in `src/fixtures/tests/playwright-rendering.spec.ts`
242

343
## Content guidelines
444

@@ -90,31 +130,11 @@ Then, within a collapsed section, quote the original prompt from Copilot Chat:
90130

91131
This helps reviewers understand the context and intent behind the automated changes.
92132

93-
## Development and testing guidelines
94-
95-
### Content changes
133+
### Testing Content changes
96134

97135
Before committing content changes, always:
98136

99137
1. **Use the content linter** to validate content: `npm run lint-content -- --paths <file-paths>`
100138
2. **Check for proper variable usage** in your content
101139
3. **Verify [AUTOTITLE] links** point to existing articles
102140
4. **Run tests** on changed content: `npm run test -- src/content-render/tests/render-changed-and-deleted-files.js`
103-
104-
### Script and code changes
105-
106-
For TypeScript, JavaScript, and SCSS files:
107-
108-
1. **Run Prettier** to check formatting: `npm run prettier-check`
109-
2. **Run the linter**: `npm run lint`
110-
3. **Run TypeScript checks**: `npm run tsc`
111-
4. **Run relevant tests**: `npm test`
112-
113-
### Environment setup
114-
115-
When testing changes in your development environment:
116-
117-
1. Install dependencies: `npm ci`
118-
2. For content changes, ensure the content linter runs successfully
119-
3. For script changes, ensure all formatting and linting checks pass
120-
4. Always verify your changes don't break existing functionality

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ registries:
55
type: docker-registry
66
url: ghcr.io
77
username: PAT
8-
password: ${{secrets.CONTAINER_BUILDER_TOKEN}}
8+
password: ${{secrets.BASE_CONTAINER_IMAGE_READER_DEPENDABOT}}
99

1010
updates:
1111
- package-ecosystem: npm

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/lint-results.json
44+
run: npm run lint-report -- --path /tmp/lint-results.json
4545

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

.github/workflows/needs-sme-stale-check.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Stale check for issues or PRs with "needs SME" label
22

3-
# **What it does**: Provides stale checks on issues/PRs that need SME(subject matter expert) review on open source docs repo.
4-
# **Why we have it**: In the open repo, we want we want frequent checks on issues/PRs that are waiting on SME review.
3+
# **What it does**: Runs only in the OS repository to provide stale checks on issues/PRs that need SME(subject matter expert) review.
4+
# **Why we have it**: In the open repo, we want we want to check on issues/PRs that are waiting on SME review.
55
# **Who does it impact**: Anyone working in the open repo.
66

77
on:
88
schedule:
9-
- cron: '20 16 * * *' # Run each day at 16:20 UTC / 8:20 PST
9+
- cron: '20 16 * * 3' # Run each Wedneday at 16:20 UTC / 8:20 PST
1010

1111
permissions:
1212
contents: read
@@ -22,15 +22,17 @@ jobs:
2222
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
2323
with:
2424
only-labels: needs SME
25-
remove-stale-when-updated: true
2625
days-before-stale: 28 # adds stale label if no activity for 7 days - temporarily changed to 28 days as we work through the backlog
27-
stale-issue-message: 'This is a gentle bump for the docs team that this issue is waiting for technical review.'
28-
stale-issue-label: SME stale
26+
stale-issue-message: 'This is a gentle reminder for the docs team that this issue is waiting for technical review by a subject matter expert (SME).'
27+
stale-issue-label: 'Waiting on SME review'
2928
days-before-issue-close: -1 # never close
30-
stale-pr-message: 'This is a gentle bump for the docs team that this PR is waiting for technical review.'
31-
stale-pr-label: SME stale
29+
stale-pr-message: 'This is a gentle reminder for the docs team that this PR is waiting for technical review by a subject matter expert.'
30+
stale-pr-label: 'Waiting on SME review'
3231
days-before-pr-close: -1 # never close
3332

33+
- name: Print outputs
34+
run: echo "Staled issues/PRs:${{ steps.stale.outputs.staled-issues-prs || '0' }}, Closed issues/PRs:${{ steps.stale.outputs.closed-issues-prs || '0' }}"
35+
3436
- name: Check out repo
3537
if: ${{ failure() }}
3638
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

.github/workflows/no-response.yaml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: No Response
1+
name: Stale check for no response from author
22

3-
# **What it does**: Closes issues that don't have enough information to be
3+
# **What it does**: Runs only in the OS repository to close issues that don't have enough information to be
44
# actionable.
55
# **Why we have it**: To remove the need for maintainers to remember to check
66
# back on issues periodically to see if contributors have
77
# responded.
8-
# **Who does it impact**: Everyone that works on docs or docs-internal.
8+
# **Who does it impact**: Everyone that works in the docs repository.
99

1010
on:
1111
issue_comment:
1212
types: [created]
1313

1414
schedule:
15-
- cron: '20 * * * *' # Run each hour at 20 minutes past
15+
- cron: '20 16 * * 1' # Run each Monday at 16:20 UTC / 8:20 PST
1616

1717
permissions:
1818
contents: read
@@ -28,10 +28,11 @@ jobs:
2828
with:
2929
repo-token: ${{ secrets.GITHUB_TOKEN }}
3030
only-labels: 'more-information-needed'
31-
days-before-stale: -1
32-
days-before-issue-stale: 14
33-
days-before-close: -1
34-
days-before-issue-close: 0
31+
32+
# Define behavior for issues
33+
days-before-issue-stale: 21
34+
days-before-issue-close: 1 # close after 1 day if the issue is not updated
35+
stale-issue-label: 'Waiting on contributor'
3536
close-issue-message: >
3637
This issue has been automatically closed because there has been no response
3738
to our request for more information from the original author. With only the
@@ -40,13 +41,19 @@ jobs:
4041
that we can investigate further. See [this blog post on bug reports and the
4142
importance of repro steps](https://www.lee-dohm.com/2015/01/04/writing-good-bug-reports/)
4243
for more information about the kind of information that may be helpful.
43-
days-before-pr-stale: 7
44-
days-before-pr-close: 0
44+
45+
# Define behavior for pull requests
46+
days-before-pr-stale: 21
47+
days-before-pr-close: 1 # close after a day if no activity is detected
48+
stale-pr-label: 'Waiting on contributor'
4549
close-pr-message: >
4650
This PR has been automatically closed because there has been no response to
4751
to our request for more information from the original author. Please reach out
48-
if you have the information we requested, or open a [new issue](https://github.com/github/docs/issues/new/choose)
49-
to describe your changes. Then we can begin the review process.
52+
if you have the information we requested, or open an [issue](https://github.com/github/docs/issues/new/choose)
53+
to describe your changes. Then we can reopen this PR and begin the review process.
54+
55+
- name: Print outputs
56+
run: echo "Staled issues/PRs:${{ steps.stale.outputs.staled-issues-prs || '0' }}, Closed issues/PRs:${{ steps.stale.outputs.closed-issues-prs || '0' }}"
5057

5158
- name: Check out repo
5259
if: ${{ failure() }}

.github/workflows/stale.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
1-
name: Stale
1+
name: Stale check for stalled pull requests in the docs-internal repository
22

3-
# **What it does**: Close issues and pull requests after no updates for 365 days.
4-
# **Why we have it**: We want to manage our queue of issues and pull requests.
5-
# **Who does it impact**: Everyone that works on docs or docs-internal.
3+
# **What it does**: Identifies pull requests that have been inactive for 30 days.
4+
# **Why we have it**: We want to avoid pull requests that are stalled and not being reviewed.
5+
# **Who does it impact**: Everyone that works in the internal repository.
66

77
on:
88
schedule:
9-
- cron: '20 16 * * *' # Run every day at 16:20 UTC / 8:20 PST
9+
- cron: '20 16 * * 1' # Run each Monday at 16:20 UTC / 8:20 PST
10+
push:
11+
paths:
12+
- .github/workflows/stale.yml
1013

1114
permissions:
1215
contents: read
13-
issues: write
1416
pull-requests: write
17+
issues: write
1518

1619
jobs:
1720
stale:
18-
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'
21+
if: github.repository == 'github/docs-internal'
1922
runs-on: ubuntu-latest
2023
steps:
2124
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
2225
with:
2326
repo-token: ${{ secrets.GITHUB_TOKEN }}
24-
stale-issue-message: 'This issue is stale because there have been no updates in 365 days.'
25-
stale-pr-message: 'This PR is stale because there have been no updates in 365 days.'
26-
days-before-stale: 365
27-
days-before-close: 0
28-
stale-issue-label: 'stale'
27+
stale-pr-message: "It looks as if this pull request has been inactive for 30 days. We want to check in with you to see if you plan to continue working on it. If you do, please add a comment to let us know. If we don't hear from you, we will close this pull request after 14 days."
28+
days-before-stale: 30
29+
days-before-close: 14
2930
stale-pr-label: 'stale'
30-
exempt-pr-labels: 'never-stale,waiting for review'
31-
exempt-issue-labels: 'never-stale,help wanted,waiting for review'
32-
operations-per-run: 1000
33-
close-issue-reason: not_planned
31+
exempt-pr-labels: 'never-stale'
32+
close-pr-label: 'Closed as inactive'
33+
34+
operations-per-run: 150
35+
36+
- name: Print outputs
37+
run: echo "Staled PRs:${{ steps.stale.outputs.staled-issues-prs || '0' }}, Closed PRs:${{ steps.stale.outputs.closed-issues-prs || '0' }}"
3438

3539
- name: Check out repo
3640
if: ${{ failure() }}

.github/workflows/sync-graphql.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ jobs:
1717
update_graphql_files:
1818
if: github.repository == 'github/docs-internal'
1919
runs-on: ubuntu-latest
20+
outputs:
21+
ignored-changes: ${{ steps.sync.outputs.ignored-changes }}
22+
ignored-count: ${{ steps.sync.outputs.ignored-count }}
23+
ignored-types: ${{ steps.sync.outputs.ignored-types }}
2024
steps:
2125
- name: Checkout
2226
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2327
- uses: ./.github/actions/node-npm-setup
2428
- name: Run updater scripts
29+
id: sync
2530
env:
2631
# need to use a token from a user with access to github/github for this step
2732
GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }}
@@ -70,3 +75,22 @@ jobs:
7075
with:
7176
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
7277
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
78+
79+
notify_ignored_changes:
80+
if: github.repository == 'github/docs-internal' && needs.update_graphql_files.outputs.ignored-count > 0 && github.event_name != 'workflow_dispatch'
81+
needs: update_graphql_files
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
86+
- uses: ./.github/actions/slack-alert
87+
with:
88+
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
89+
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}
90+
color: warning
91+
message: |
92+
⚠️ GraphQL Sync found ${{ needs.update_graphql_files.outputs.ignored-count }} ignored change types: ${{ needs.update_graphql_files.outputs.ignored-types }}
93+
94+
These change types are not in CHANGES_TO_REPORT and were silently ignored. Consider reviewing if they should be added to the changelog.
95+
96+
See workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

0 commit comments

Comments
 (0)