Skip to content

Commit cb7e9ae

Browse files
author
Sarah Edwards
authored
Merge branch 'main' into patch-1
2 parents d0d1fa4 + 2b4ddf5 commit cb7e9ae

File tree

558 files changed

+8131
-5793
lines changed

Some content is hidden

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

558 files changed

+8131
-5793
lines changed

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ import { languageKeys } from '../../lib/languages.js'
55
import { makeLanguageSurrogateKey } from '../../middleware/set-fastly-surrogate-key.js'
66
import purgeEdgeCache from '../../script/deployment/purge-edge-cache.js'
77

8+
/**
9+
* In simple terms, this script sends purge commands for...
10+
*
11+
* 1. no-language
12+
* 2. 'en'
13+
* 3. 'ja'
14+
* 4. 'pt'
15+
* ...
16+
*
17+
* ...and so on for all languages.
18+
* But to avoid a stampeding herd after each purge, and to avoid unnecessary
19+
* load on the backend, put a slight delay between each language.
20+
* This gives the backend a chance to finish processing all the now stale
21+
* URLs, for that language, before tackling the next.
22+
*/
23+
const DELAY_BETWEEN_LANGUAGES = 10 * 1000
24+
25+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
26+
827
// This covers things like `/api/webhooks` which isn't language specific.
928
await purgeEdgeCache(makeLanguageSurrogateKey())
1029

@@ -16,6 +35,10 @@ const languages = process.env.LANGUAGES
1635
languageKeys.sort((a) => (a === 'en' ? -1 : 1))
1736

1837
for (const language of languages) {
38+
console.log(
39+
`Sleeping ${DELAY_BETWEEN_LANGUAGES / 1000} seconds before purging for '${language}'...`
40+
)
41+
await sleep(DELAY_BETWEEN_LANGUAGES)
1942
await purgeEdgeCache(makeLanguageSurrogateKey(language))
2043
}
2144

.github/workflows/browser-test.yml

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

.github/workflows/codeowners-docs-engineering.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ name: Codeowners - Docs Engineering
88

99
on:
1010
pull_request:
11+
types:
12+
- edited
13+
- opened
14+
- ready_for_review
15+
- reopened
16+
- synchronize
1117
paths:
1218
- '**.js'
1319
- '**.ts'
@@ -20,7 +26,7 @@ on:
2026

2127
jobs:
2228
codeowners-docs-engineering:
23-
if: ${{ github.repository == 'github/docs-internal' }}
29+
if: ${{ github.repository == 'github/docs-internal' && !github.event.pull_request.draft }}
2430
runs-on: ubuntu-latest
2531
env:
2632
GH_TOKEN: ${{ secrets.DOCS_BOT_FR }}
Binary file not shown.
-5.79 KB
Binary file not shown.
173 KB
Loading
193 KB
Loading
126 KB
Loading
38.2 KB
Loading
339 KB
Loading

0 commit comments

Comments
 (0)