Repository navigation
feat(ops): Vercel Schedules backstop for time-sensitive workflows - #260
Open
NickAltstein wants to merge 2 commits into
Open
NickAltstein wants to merge 2 commits into
NickAltstein wants to merge 2 commits into
Conversation
GitHub's scheduled triggers drop and delay ticks, which shows up as staleness alarms. Vercel Schedules now calls a private function on the same cadence, and it fires workflow_dispatch for odds_freshness, game_context_ingest (Tuesday rollover and daily pre-pricing) and close_quality_capture. The GitHub crons stay as the second trigger; each workflow's concurrency group queues an overlapping run. - api/schedules/dispatch.mjs has a schedule/v1beta trigger, so it has no public URL: only Vercel's scheduler can invoke it. No shared secret to check or rotate. - Dispatch uses GITHUB_DISPATCH_TOKEN, a fine-grained PAT for this repo with Actions: write only, separate from DATA_BOT_TOKEN. A missing token or a GitHub rejection fails the run (500 in Vercel's execution history) instead of succeeding quietly; the token is never echoed. - Occurrences delivered more than 25 minutes late (outage catch-up) are skipped rather than replayed. - Cadences are Hobby-legal (no two runs closer than the 15-minute jitter); close_quality_capture runs every 15 minutes instead of its GitHub 10. - .vercelignore now ignores api/*.py and api/__pycache__/ instead of all of api/. It does not honour "!" re-includes, so the old rule would have dropped the dispatch function. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
- Any dispatch failure (missing token, failed run lookup, GitHub 401/403,
any non-2xx) now POSTs to ALARM_WEBHOOK_URL in the {"content","text"}
shape feed_age.py uses, then fails the run. An expired token alerts at
the next tick instead of hours later via the freshness alarm. A broken
webhook never masks the dispatch failure, and neither the token nor the
webhook URL is ever logged or sent.
- Before dispatching, the function asks GitHub for runs of the workflow
created since the slot's scheduled time (less 2 minutes of clock slack)
and skips if one is queued, in progress or succeeded. This stops the
Vercel trigger from opening a second data PR for a slot the GitHub cron
already covered. The window is anchored to scheduledAt, not delivery
time, because Hobby delivers up to 15 minutes late. Failed or cancelled
runs do not cover the slot.
- npm audit flagged GHSA-mrhx-c7xc-m3w5 (zod < 4.6.6) via @vercel/oidc ->
@vercel/cli-config. An overrides entry pins zod to 4.6.7 (same major);
npm audit now reports 0 vulnerabilities. None of the new packages are in
the static site output.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Deployment failed for project propstein with the following error: Learn More: https://vercel.com/nicks-projects-ec56abd4?upgradeToPro=build-rate-limit |
This was referenced Nov 24, 2026
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GitHub's scheduled triggers drop and delay ticks, which shows up as staleness alarms. This adds Vercel Schedules as an outside trigger for the time-sensitive workflows. The GitHub crons stay as a second trigger.
What changed
vercel.json)odds-freshness7,22,37,52 * * * *odds_freshness.ymlgame-context-rollover0 6 * * 2game_context_ingest.ymlgame-context-daily30 10 * * *game_context_ingest.ymlclose-quality-capture3,18,33,48 0-5,12-23 * * *close_quality_capture.ymlapi/schedules/dispatch.mjshas aschedule/v1betatrigger. The@vercel/schedulesREADME says: "A function with theschedule/v1betatrigger is private: only the scheduler can invoke it, so there is no public endpoint to protect." That leaves no shared secret to check or rotate. A test fails if any schedule is switched to a publicpathtarget.ALARM_WEBHOOK_URL(the same{"content","text"}shapefeed_age.pyuses), then fails the run. So an expired token alerts on the next tick, not hours later through the freshness alarm. A broken webhook never hides the dispatch failure, and neither the token nor the webhook URL is ever logged or sent.GITHUB_DISPATCH_TOKEN, a fine-grained PAT for this repo with Actions: Read and write only (read for the run lookup, write to dispatch), separate fromDATA_BOT_TOKEN..vercelignore. It now ignoresapi/*.pyandapi/__pycache__/instead of all ofapi/..vercelignoredoesn't honour!re-includes; I confirmed with a localvercel buildthat the negated form dropped the function.Before merging
GITHUB_DISPATCH_TOKEN: the PATALARM_WEBHOOK_URL: the same webhook the GitHub workflows useworkflow_dispatch. Or force a run right away:Dependencies
@vercel/schedules@0.0.3, pinned exactly. It's in beta on all plans, and limits may change before GA.@vercel/oidc's CLI helpers, all locked.npm auditflagged GHSA-mrhx-c7xc-m3w5 (zod < 4.6.6, memory exhaustion) via@vercel/oidc → @vercel/cli-config. Anoverridesentry pinszodto 4.6.7 (same major).npm auditnow reports 0 vulnerabilities. I kept this instead ofnpm audit fix, which would have downgraded@vercel/oidcfrom 3.8.10 to 3.5.0.vercel build, the packages appear only infunctions/api/schedules/dispatch.func;static/has nonode_modulesand no reference to the SDK.Reviewer notes
cancel-in-progress: false) then runs the two back to back, and both open data PRs. Closing that gap needs a check inside the workflows or inopen_automerge_data_pr.sh. That's left out to keep this PR scoped.close_quality_captureruns every 15 min here vs every 10 on GitHub.Testing
npm test: 231 passed, 0 failed, 3 skipped (Chrome-only; these pass in CI). Includes 19 tests intest/schedule-dispatch.test.mjs: dispatch, webhook on every failure mode, slot dedupe, the lateness skip, andvercel.json/.vercelignore/ workflow wiring.pytest tests --ignore=tests/ledger: 735 passed, 3 skipped.vercel build: one function,schedule/v1betatrigger, all four schedules inconfig.json, no Python files.🤖 Generated with Claude Code