Skip to content

Commit e1c60d3

Browse files
authored
Merge branch 'main' into patch-2
2 parents 4568b8c + 1e528f0 commit e1c60d3

4,763 files changed

Lines changed: 101268 additions & 120615 deletions

File tree

Some content is hidden

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

.devcontainer/devcontainer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@
3333

3434
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
3535
"remoteUser": "node"
36+
3637
}

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
babelOptions: { configFile: './.babelrc' },
1414
sourceType: 'module',
1515
},
16-
ignorePatterns: ['tmp/*'],
16+
ignorePatterns: ['tmp/*', '!/.*', '/.next/'],
1717
rules: {
1818
'import/no-extraneous-dependencies': ['error', { packageDir: '.' }],
1919
},

.github/CODEOWNERS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
/.github/ @github/docs-engineering
1111
/script/ @github/docs-engineering
1212
/includes/ @github/docs-engineering
13+
/lib/search/popular-pages.json @github/docs-engineering
1314
app.json @github/docs-engineering
1415
Dockerfile @github/docs-engineering
1516
package-lock.json @github/docs-engineering
@@ -19,8 +20,8 @@ package.json @github/docs-engineering
1920
/.github/workflows/create-translation-batch-pr.yml @github/docs-localization
2021
/.github/workflows/crowdin.yml @github/docs-localization
2122
/crowdin*.yml @github/docs-engineering @github/docs-localization
22-
/translations/ @github/docs-engineering @github/docs-localization @github-actions
23-
/translations/log/ @github/docs-localization
23+
/translations/ @github/docs-engineering @github/docs-localization @Octomerger
24+
/translations/log/ @github/docs-localization @Octomerger
2425

2526
# Site Policy
2627
/content/github/site-policy/ @github/site-policy-admins

.github/actions-scripts/fr-add-docs-reviewers-requests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ async function run() {
134134
// Exclude existing items going forward.
135135
// Until we have a way to check from a PR whether the PR is in a project,
136136
// this is how we (roughly) avoid overwriting PRs that are already on the board
137-
let newItemIDs = []
138-
let newItemAuthors = []
137+
const newItemIDs = []
138+
const newItemAuthors = []
139139
itemIDs.forEach((id, index) => {
140140
if (!existingItemIDs.includes(id)) {
141141
newItemIDs.push(id)

.github/actions-scripts/purge-fastly-edge-cache.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,4 @@
22

33
import purgeEdgeCache from '../../script/deployment/purge-edge-cache.js'
44

5-
try {
6-
await purgeEdgeCache()
7-
} catch (error) {
8-
console.error(`Failed to purge the edge cache: ${error.message}`)
9-
console.error(error)
10-
throw error
11-
}
5+
await purgeEdgeCache()

.github/actions-scripts/ready-for-docs-review.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ async function run() {
8585
// - affected docs sets (not considering changes to data/assets)
8686
let numFiles = 0
8787
let numChanges = 0
88-
let features = new Set([])
89-
const files = data.item.files.nodes.forEach((node) => {
88+
const features = new Set([])
89+
data.item.files.nodes.forEach((node) => {
9090
numFiles += 1
9191
numChanges += node.additions
9292
numChanges += node.deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env node
2+
3+
import * as github from '@actions/github'
4+
5+
import getOctokit from '../../script/helpers/github.js'
6+
7+
const { GITHUB_TOKEN } = process.env
8+
9+
// Exit if GitHub Actions PAT is not found
10+
if (!GITHUB_TOKEN) {
11+
throw new Error('You must supply a GITHUB_TOKEN environment variable!')
12+
}
13+
14+
// This helper uses the `GITHUB_TOKEN` implicitly!
15+
// We're using our usual version of Octokit vs. the provided `github`
16+
// instance to avoid versioning discrepancies.
17+
const octokit = getOctokit()
18+
19+
const { CONTEXT_NAME, ACTIONS_RUN_LOG, HEAD_SHA } = process.env
20+
if (!CONTEXT_NAME) {
21+
throw new Error('$CONTEXT_NAME not set')
22+
}
23+
if (!ACTIONS_RUN_LOG) {
24+
throw new Error('$ACTIONS_RUN_LOG not set')
25+
}
26+
if (!HEAD_SHA) {
27+
throw new Error('$HEAD_SHA not set')
28+
}
29+
30+
const { context } = github
31+
const owner = context.repo.owner
32+
const repo = context.payload.repository.name
33+
34+
await octokit.repos.createCommitStatus({
35+
owner,
36+
repo,
37+
sha: HEAD_SHA,
38+
context: CONTEXT_NAME,
39+
state: 'success',
40+
description: 'Successfully deployed! See logs.',
41+
target_url: ACTIONS_RUN_LOG,
42+
})

.github/actions-scripts/staging-deploy.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (!HEROKU_API_TOKEN) {
2121
// instance to avoid versioning discrepancies.
2222
const octokit = getOctokit()
2323

24-
const { RUN_ID, PR_URL, SOURCE_BLOB_URL, CONTEXT_NAME, ACTIONS_RUN_LOG, HEAD_SHA } = process.env
24+
const { RUN_ID, PR_URL, SOURCE_BLOB_URL } = process.env
2525
if (!RUN_ID) {
2626
throw new Error('$RUN_ID not set')
2727
}
@@ -31,15 +31,6 @@ if (!PR_URL) {
3131
if (!SOURCE_BLOB_URL) {
3232
throw new Error('$SOURCE_BLOB_URL not set')
3333
}
34-
if (!CONTEXT_NAME) {
35-
throw new Error('$CONTEXT_NAME not set')
36-
}
37-
if (!ACTIONS_RUN_LOG) {
38-
throw new Error('$ACTIONS_RUN_LOG not set')
39-
}
40-
if (!HEAD_SHA) {
41-
throw new Error('$HEAD_SHA not set')
42-
}
4334

4435
const { owner, repo, pullNumber } = parsePrUrl(PR_URL)
4536
if (!owner || !repo || !pullNumber) {
@@ -62,13 +53,3 @@ await deployToStaging({
6253
sourceBlobUrl: SOURCE_BLOB_URL,
6354
runId: RUN_ID,
6455
})
65-
66-
await octokit.repos.createCommitStatus({
67-
owner,
68-
repo,
69-
sha: HEAD_SHA,
70-
context: CONTEXT_NAME,
71-
state: 'success',
72-
description: 'Successfully deployed! See logs.',
73-
target_url: ACTIONS_RUN_LOG,
74-
})

.github/actions-scripts/update-merge-queue-branch.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ const github = getOctokit(token)
88
// https://docs.github.com/en/graphql/reference/enums#mergestatestatus
99
// https://docs.github.com/en/graphql/reference/enums#mergeablestate
1010

11-
/*
12-
This script gets a list of automerge-enabled PRs and sorts them
11+
/*
12+
This script gets a list of automerge-enabled PRs and sorts them
1313
by priority. The PRs with the skip-to-front-of-merge-queue label
14-
are prioritized first. The rest of the PRs are sorted by the date
15-
they were updated. This is basically a FIFO queue, while allowing
14+
are prioritized first. The rest of the PRs are sorted by the date
15+
they were updated. This is basically a FIFO queue, while allowing
1616
writers the ability to skip the line when high-priority ships are
1717
needed but a freeze isn't necessary.
1818
*/
1919

20+
const DRY_RUN = Boolean(JSON.parse(process.env.DRY_RUN || 'false'))
21+
2022
main()
2123

2224
async function main() {
@@ -47,6 +49,15 @@ async function main() {
4749
name
4850
}
4951
}
52+
commits(last: 1) {
53+
nodes {
54+
commit {
55+
statusCheckRollup {
56+
state
57+
}
58+
}
59+
}
60+
}
5061
}
5162
}
5263
pageInfo {
@@ -105,6 +116,14 @@ async function main() {
105116
// a PR is green and the automerge is enabled
106117
.filter((pr) => pr.mergeStateStatus !== 'DIRTY')
107118
.filter((pr) => pr.mergeStateStatus !== 'UNSTABLE')
119+
.filter((pr) => {
120+
const nodes = pr.commits.nodes
121+
if (!nodes || !nodes.length) {
122+
// If it has no commits, why is it even here? Anyway, skip it.
123+
return false
124+
}
125+
return nodes[0].commit.statusCheckRollup.state !== 'FAILURE'
126+
})
108127

109128
autoMergeEnabledPRs.push(...filteredPrs)
110129
}
@@ -120,11 +139,15 @@ async function main() {
120139
if (prioritizedPrList.length) {
121140
const nextInQueue = prioritizedPrList.shift()
122141
// Update the branch for the next PR in the merge queue
123-
github.rest.pulls.updateBranch({
124-
owner: org,
125-
repo,
126-
pull_number: nextInQueue.number,
127-
})
142+
if (DRY_RUN) {
143+
console.log('DRY RUN! But *would* update on next-in-queue')
144+
} else {
145+
github.rest.pulls.updateBranch({
146+
owner: org,
147+
repo,
148+
pull_number: nextInQueue.number,
149+
})
150+
}
128151
console.log(`⏱ Total PRs in the merge queue: ${prioritizedPrList.length + 1}`)
129152
console.log(`🚂 Updated branch for PR #${JSON.stringify(nextInQueue, null, 2)}`)
130153
}

.github/allowed-actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export default [
1313
'actions/upload-artifact@27121b0bdffd731efa15d66772be8dc71245d074', // v2.2.4
1414
'alex-page/github-project-automation-plus@bb266ff4dde9242060e2d5418e120a133586d488', // v0.8.1
1515
'andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90', // v1.0.4
16-
'crowdin/github-action@d0622816ed4f4744db27d04374b2cef6867f7bed', // v1.4.1
1716
'cschleiden/actions-linter@caffd707beda4fc6083926a3dff48444bc7c24aa', // uses github-actions-parser v0.23.0
17+
'lee-dohm/close-matching-issues@e9e43aad2fa6f06a058cedfd8fb975fd93b56d8f', // v2.1.0
1818
'dawidd6/action-delete-branch@47743101a121ad657031e6704086271ca81b1911', // v3.0.2
1919
'dawidd6/action-download-artifact@af92a8455a59214b7b932932f2662fdefbd78126', // v2.15.0
2020
'dorny/paths-filter@eb75a1edc117d3756a18ef89958ee59f9500ba58',

0 commit comments

Comments
 (0)