Skip to content

Run the monitor via a Vercel cron task#1745

Open
yrong wants to merge 14 commits intomainfrom
ron/monitor-by-vercel
Open

Run the monitor via a Vercel cron task#1745
yrong wants to merge 14 commits intomainfrom
ron/monitor-by-vercel

Conversation

@yrong
Copy link
Contributor

@yrong yrong commented Mar 12, 2026

Context

With this PR, we can run vercel --prod --archive=tgz to deploy the monitor to Vercel on demand.

It is currently deployed at https://vercel.com/snowfork/snowbridge-hyl7 and runs the monitor periodically every 15 minutes.

@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
snowbridge-hyl7 Error Error Mar 12, 2026 3:44pm

Request Review

@yrong yrong marked this pull request as ready for review March 13, 2026 03:36
@yrong yrong requested a review from Copilot March 13, 2026 03:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Vercel Cron-driven deployment path for running the Snowbridge monitor on a schedule from the web/ workspace, including build-time Foundry installation and a serverless API entrypoint.

Changes:

  • Added Vercel configuration to deploy web/ with a cron schedule invoking /api/monitor every 15 minutes.
  • Added a Vercel serverless function (web/api/monitor.ts) that runs the existing operations monitor logic.
  • Added build/install scripting to ensure Foundry + contract type generation can run in Vercel builds, plus updated ignores and build scripts.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
web/vercel.json Configures Vercel install/build commands, cron schedule, and function timeout.
web/api/monitor.ts Adds the serverless endpoint that invokes the operations monitor.
web/api/README.md Documents the cron endpoint, auth expectations, and build requirements.
web/scripts/install-foundry.sh Installs Foundry from GitHub releases and installs/builds forge deps.
web/package.json Adds Vercel-specific build scripts and dependencies needed for the serverless deployment.
web/packages/contract-types/scripts/build.sh Adds a build wrapper to support environments with/without Foundry.
web/packages/contract-types/package.json Switches build to the new script and keeps a full build option.
web/.vercelignore Reduces uploaded deployment size for the web/ root directory.
.vercelignore Adds repo-wide ignore rules to reduce deployment size when deploying from repo root.
web/.gitignore Ignores .vercel and the local Foundry install directory under web/scripts.
.gitignore Ignores .vercel at the repo root.
web/pnpm-lock.yaml Captures dependency graph updates (notably Vercel runtime tooling deps).
Files not reviewed (1)
  • web/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +42
TAG="${FOUNDRY_TAG:-nightly}"
# e.g. foundry_nightly_linux_amd64.tar.gz or foundry_v1.0.0_linux_amd64.tar.gz
if [ "$TAG" = "nightly" ]; then
ASSET="foundry_nightly_${OS}_${ARCH}.tar.gz"
else
ASSET="foundry_${TAG#v}_${OS}_${ARCH}.tar.gz"
fi
URL="https://github.com/foundry-rs/foundry/releases/download/${TAG}/${ASSET}"
yrong and others added 5 commits March 13, 2026 14:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants