Skip to content

Commit 4d017fd

Browse files
authored
new conf design — rate limit workaround (#2016)
* Commit Sched data to JSON files * Fix type errors * Fix type errors * Remove event_type_sort * Merge years properly * Fix type error * Add generated .json files to .prettierignore * Autoformat and remove nonexistend xs: breakpoint * For now, run the conference-sync action only on workflow_dispatch * Format * Sync some more social URLs for 2023 * Improve error handling * Sync 2023 speaker social URLs
1 parent aa8b8f8 commit 4d017fd

28 files changed

+12447
-220
lines changed

.github/workflows/prettier.yml renamed to .github/workflows/check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Prettier Check
1+
name: Lint and check formatting
22

33
on: pull_request
44

@@ -16,5 +16,10 @@ jobs:
1616

1717
- name: Install Dependencies
1818
run: pnpm i
19+
20+
# Commented out until later PR that changes the ESLint config
21+
# - name: Run ESLint
22+
# run: pnpm lint --quiet
23+
1924
- name: Run Prettier Check
2025
run: pnpm format:check

.github/workflows/conference-sync.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Sched's API rate limits are very limited, so we sync non-critical part of the data on a cron.
2+
on:
3+
workflow_dispatch:
4+
# schedule:
5+
# - cron: "*/10 * * * *" # every ten minutes
6+
7+
jobs:
8+
sync:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Sync conference data from Sched
17+
run: |
18+
tsx scripts/sync-sched/sync.ts --year 2025
19+
env:
20+
SCHED_ACCESS_TOKEN_2025: ${{ secrets.SCHED_ACCESS_TOKEN_2025 }}
21+
22+
- name: Commit changes
23+
uses: stefanzweifel/git-auto-commit-action@v5
24+
with:
25+
file_pattern: "scripts/sync-sched/*.json"
26+
commit_message: "Sync conference data from Sched"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,5 @@ src/__generated__/
6161
.next/
6262
public/sitemap.xml
6363
out/
64+
65+
tsconfig.tsbuildinfo

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ pnpm-lock.yaml
66
!src/pages/community/foundation/community-grant.mdx
77
!src/pages/blog/2025-06-01-graphiql-4/index.mdx
88
*.jpg
9+
10+
scripts/sync-sched/*.json
11+
src/github-stats.json
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env tsx
2+
3+
import { join } from "node:path"
4+
import { readFile } from "node:fs/promises"
5+
6+
import type { SchedSpeaker } from "@/app/conf/_api/sched-types"
7+
8+
/**
9+
* We count the number of speakers we didn't sync details for
10+
* to make sure we have social URLs for everybody.
11+
*/
12+
;(async function main() {
13+
try {
14+
const speakersFilePath = join(import.meta.dirname, "speakers.json")
15+
16+
console.log("Reading speakers.json...")
17+
18+
const speakersData = await readFile(speakersFilePath, "utf-8")
19+
const speakers: SchedSpeaker[] = JSON.parse(speakersData)
20+
21+
const speakersWithoutDetails = speakers.filter(
22+
speaker => !speaker["~syncedDetailsAt"],
23+
)
24+
25+
console.log(`Total speakers: ${speakers.length}`)
26+
console.log(
27+
`Speakers without ~syncedDetailsAt: ${speakersWithoutDetails.length}`,
28+
)
29+
30+
if (speakersWithoutDetails.length > 0) {
31+
console.log("\nSpeakers missing details:")
32+
for (const speaker of speakersWithoutDetails) {
33+
console.log(`- ${speaker.username} (${speaker.name || "No name"})`)
34+
}
35+
}
36+
} catch (error) {
37+
console.error("Error:", error)
38+
process.exit(1)
39+
}
40+
})()

0 commit comments

Comments
 (0)