Skip to content

Commit 742d1a7

Browse files
committed
Merge branch 'main' into fix-typos-in-creating-redis-service-containers-docs
2 parents 344ea15 + c9b88b9 commit 742d1a7

File tree

2,423 files changed

+442673
-1076171
lines changed

Some content is hidden

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

2,423 files changed

+442673
-1076171
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: 43 additions & 23 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

@@ -10,7 +50,7 @@ The bulleted points in a bullet list should always be denoted in Markdown using
1050

1151
Within Markdown files, with the exception of the `title` field in the metadata at the start of a file, **always use the Liquid syntax variables rather than text** if a variable has been defined for that text. This ensures consistency and makes it easier to update product names globally.
1252

13-
**Important**: Variables must be used in all content, including reusable content, data files, and regular articles. The only exception is the `title` field in frontmatter metadata.
53+
**Important**: Variables must be used in all content, including reusable content, data files, and regular articles. The only exceptions are the `title` field in frontmatter metadata and any file in the `content/site-policy` directory.
1454

1555
For example:
1656

@@ -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
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
name: Create a PR to add an entry to the CHANGELOG.md file in this repo
2+
3+
# **What it does**: If a member of the github org posts a changelog comment, it creates a PR to update the CHANGELOG.md file.
4+
# **Why we have it**: This surfaces docs changelog details publicly.
5+
# **Who does it impact**: GitHub users and staff.
6+
7+
on:
8+
issue_comment:
9+
types: [created]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
env:
17+
CHANGELOG_FILE: CHANGELOG.md
18+
19+
jobs:
20+
docs-changelog-pr:
21+
if: ${{ github.repository == 'github/docs-internal' && github.event.issue.pull_request }}
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: 'Ensure ${{ env.CHANGELOG_FILE }} exists'
28+
run: |
29+
if [ ! -f ${{ env.CHANGELOG_FILE }} ]; then
30+
echo "${{ env.CHANGELOG_FILE }} is missing at the root of the repository."
31+
exit 1
32+
fi
33+
34+
- name: Check that the user belongs to the github org
35+
id: hubber_check
36+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
37+
with:
38+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
39+
script: |
40+
try {
41+
await github.rest.teams.getMembershipForUserInOrg({
42+
org: 'github',
43+
team_slug: 'employees',
44+
username: context.payload.sender.login,
45+
});
46+
core.exportVariable('CONTINUE_WORKFLOW', 'true');
47+
} catch(err) {
48+
core.info("Workflow triggered by a comment, but the commenter is not a Hubber. Exiting.");
49+
core.exportVariable('CONTINUE_WORKFLOW', 'false');
50+
}
51+
52+
- name: Check if comment starts with '## Changelog summary'
53+
if: env.CONTINUE_WORKFLOW == 'true'
54+
id: check_summary
55+
env:
56+
COMMENT_BODY: ${{ github.event.comment.body }}
57+
run: |
58+
# Get the first line of the comment and trim the leading/trailing whitespace:
59+
FIRST_LINE=$(printf "%s\n" "$COMMENT_BODY" | head -n1 | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
60+
if [[ "$FIRST_LINE" != '## Changelog summary' ]]; then
61+
echo "FIRST_LINE=|$FIRST_LINE|"
62+
echo "The pull request comment is not a changelog summary. Exiting."
63+
echo "CONTINUE_WORKFLOW=false" >> $GITHUB_ENV
64+
fi
65+
66+
- name: Create changelog text
67+
if: env.CONTINUE_WORKFLOW == 'true'
68+
id: create_text
69+
env:
70+
COMMENT_BODY: ${{ github.event.comment.body }}
71+
run: |
72+
set -euo pipefail
73+
DATE=$(date +"**%-d %B %Y**")
74+
BODY="$(printf "%s\n" "$COMMENT_BODY" | tail -n +2)"
75+
CHANGELOG_TEXT="$(printf "%s\n" "$BODY" | awk '/^:writing_hand:/{exit} {print}')"
76+
{
77+
echo "$DATE"
78+
echo -e "$CHANGELOG_TEXT\n<hr>"
79+
} > changelog_entry.txt
80+
81+
- name: Set up git
82+
if: env.CONTINUE_WORKFLOW == 'true'
83+
run: |
84+
git config user.name "github-actions[bot]"
85+
git config user.email "github-actions[bot]@users.noreply.github.com"
86+
87+
- name: Prepare branch
88+
if: env.CONTINUE_WORKFLOW == 'true'
89+
run: |
90+
BRANCH="changelog-update-$(date +%s)"
91+
echo "BRANCH=$BRANCH" >> $GITHUB_ENV
92+
git checkout -b "$BRANCH"
93+
94+
# Insert new changelog entry after the first heading, as follows:
95+
# Print the first line of the existing CHANGELOG.md file into a `tmp` file, followed by an empty line.
96+
# Then, print the contents of `changelog_entry.txt` into the `tmp` file.
97+
# Then, print the rest of the existing CHANGELOG.md file into the `tmp` file.
98+
# Finally, replace the existing CHANGELOG.md file with the `tmp` file.
99+
awk 'NR==1{print; print ""; while ((getline line < "changelog_entry.txt") > 0) print line; next}1' CHANGELOG.md > tmp && mv tmp CHANGELOG.md
100+
101+
git add CHANGELOG.md
102+
git commit -m "Update changelog for $(head -n1 changelog_entry.txt)"
103+
git push origin "$BRANCH"
104+
105+
- name: Create a pull request
106+
if: env.CONTINUE_WORKFLOW == 'true'
107+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
108+
id: create_pull_request
109+
with:
110+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
111+
script: |
112+
const { data: pullRequest } = await github.rest.pulls.create({
113+
owner: context.repo.owner,
114+
repo: context.repo.repo,
115+
title: `Update docs changelog (for PR #${context.payload.issue.number})`,
116+
body: `### Automated docs changelog update\n\n**Purpose:** Update the <code>${{ env.CHANGELOG_FILE }}</code> file with details of a recent docs change.\n\nThis PR is an automated update, generated by the <code>create-changelog-pr.yml</code> Actions workflow as a result of a "Changelog summary" comment being added to [PR #${context.payload.issue.number}](${context.payload.issue.html_url}).\n\n**Note for reviewer**: This change to the <code>${{ env.CHANGELOG_FILE }}</code> file will be synced to the public docs site, so make sure that the content of the entry is appropriate for public consumption. If the content is wholly inappropriate for public consumption, then this PR can be closed.\n\n<details><summary>Original PR comment posted by @${context.payload.comment.user.login}, using the <code>/changelog</code> slash command:</summary>\n\n${context.payload.comment.body}</details>`,
117+
head: process.env.BRANCH,
118+
base: 'main'
119+
});
120+
121+
core.setOutput('pull-request-number', pullRequest.number);
122+
core.setOutput('pull-request-url', pullRequest.html_url);
123+
124+
- name: Add 'ready-for-doc-review' label to PR
125+
if: env.CONTINUE_WORKFLOW == 'true'
126+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
127+
env:
128+
# Get the number of the PR that was just created:
129+
PULL_REQUEST_NUMBER: ${{ steps.create_pull_request.outputs.pull-request-number }}
130+
with:
131+
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
132+
script: |
133+
await github.rest.issues.addLabels({
134+
owner: context.repo.owner,
135+
repo: context.repo.repo,
136+
issue_number: Number(process.env.PULL_REQUEST_NUMBER),
137+
labels: ['ready-for-doc-review']
138+
});
139+
140+
- uses: ./.github/actions/slack-alert
141+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
142+
with:
143+
slack_channel_id: ${{ secrets.DOCS_ALERTS_SLACK_CHANNEL_ID }}
144+
slack_token: ${{ secrets.SLACK_DOCS_BOT_TOKEN }}

.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 lint-report -- --path /tmp/lint-results.json
4545

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

.github/workflows/move-help-wanted-issues.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.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

0 commit comments

Comments
 (0)