Skip to content

new conf design — rate limit workaround #2016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Prettier Check
name: Lint and check formatting

on: pull_request

Expand All @@ -16,5 +16,10 @@ jobs:

- name: Install Dependencies
run: pnpm i

# Commented out until later PR that changes the ESLint config
# - name: Run ESLint
# run: pnpm lint --quiet

- name: Run Prettier Check
run: pnpm format:check
26 changes: 26 additions & 0 deletions .github/workflows/conference-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Sched's API rate limits are very limited, so we sync non-critical part of the data on a cron.
on:
workflow_dispatch:
# schedule:
# - cron: "*/10 * * * *" # every ten minutes

jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Sync conference data from Sched
run: |
tsx scripts/sync-sched/sync.ts --year 2025
env:
SCHED_ACCESS_TOKEN_2025: ${{ secrets.SCHED_ACCESS_TOKEN_2025 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't really have this configured here so need @benjie to set this. (We have it over email thread or can share on slack)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can disregard it for now to unblock deploys. I ran the script locally, and this is a workflow_dispatch trigger. I'd prefer to run this on a webhook from Sched and maybe every N minutes (to avoid the rate limit), but we don't need it yet.


- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "scripts/sync-sched/*.json"
commit_message: "Sync conference data from Sched"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ src/__generated__/
.next/
public/sitemap.xml
out/

tsconfig.tsbuildinfo
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ pnpm-lock.yaml
!src/pages/community/foundation/community-grant.mdx
!src/pages/blog/2025-06-01-graphiql-4/index.mdx
*.jpg

scripts/sync-sched/*.json
src/github-stats.json
40 changes: 40 additions & 0 deletions scripts/sync-sched/count-speakers-without-details.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env tsx

import { join } from "node:path"
import { readFile } from "node:fs/promises"

import type { SchedSpeaker } from "@/app/conf/_api/sched-types"

/**
* We count the number of speakers we didn't sync details for
* to make sure we have social URLs for everybody.
*/
;(async function main() {
try {
const speakersFilePath = join(import.meta.dirname, "speakers.json")

console.log("Reading speakers.json...")

const speakersData = await readFile(speakersFilePath, "utf-8")
const speakers: SchedSpeaker[] = JSON.parse(speakersData)

const speakersWithoutDetails = speakers.filter(
speaker => !speaker["~syncedDetailsAt"],
)

console.log(`Total speakers: ${speakers.length}`)
console.log(
`Speakers without ~syncedDetailsAt: ${speakersWithoutDetails.length}`,
)

if (speakersWithoutDetails.length > 0) {
console.log("\nSpeakers missing details:")
for (const speaker of speakersWithoutDetails) {
console.log(`- ${speaker.username} (${speaker.name || "No name"})`)
}
}
} catch (error) {
console.error("Error:", error)
process.exit(1)
}
})()
Loading