-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
saihaj
merged 13 commits into
graphql:source
from
hasparus:new-conf-design--rate-limit-workaround
Jun 10, 2025
Merged
Changes from 10 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7ae48de
Commit Sched data to JSON files
hasparus 8c7bf7b
Fix type errors
hasparus 894dda3
Fix type errors
hasparus 9977d31
Remove event_type_sort
hasparus 7844a2d
Merge years properly
hasparus 6341bfb
Fix type error
hasparus 4ddf366
Add generated .json files to .prettierignore
hasparus 792ddfd
Autoformat and remove nonexistend xs: breakpoint
hasparus 0fe9116
For now, run the conference-sync action only on workflow_dispatch
hasparus a42a889
Format
hasparus eb29574
Sync some more social URLs for 2023
hasparus b35aa4d
Improve error handling
hasparus 301d18d
Sync 2023 speaker social URLs
hasparus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
file_pattern: "scripts/sync-sched/*.json" | ||
commit_message: "Sync conference data from Sched" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,3 +61,5 @@ src/__generated__/ | |
.next/ | ||
public/sitemap.xml | ||
out/ | ||
|
||
tsconfig.tsbuildinfo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
})() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.