Skip to content

fix(ci): unblock Vercel deploys (Hobby cron limit) and the contracts CI job - #312

Merged
thisisouvik merged 2 commits into
mainfrom
fix/vercel-hobby-crons
Sep 12, 2026
Merged

fix(ci): unblock Vercel deploys (Hobby cron limit) and the contracts CI job#312
thisisouvik merged 2 commits into
mainfrom
fix/vercel-hobby-crons

Conversation

@thisisouvik

Copy link
Copy Markdown
Owner

Why

What

Vercel

  • vercel.json: all crons are now daily (the Hobby ceiling). reputation-scoring gets an entry (it had a route but was never scheduled).
  • New .github/workflows/keepers.yml: hits /api/cron/liquidation and /api/cron/price-oracle every 5 minutes with Bearer CRON_SECRET. No-op until the KEEPER_BASE_URL and CRON_SECRET repository secrets are set.
  • Docs, .env.example, route comment and the schedule test updated for the new cadence.

usdc_lending_pool

  • Fix the u64/u128 mismatch in compute_yield.
  • deposit used transfer_from, which requires an allowance nobody grants → transfer under the depositor's require_auth, consistent with lending.
  • Tests: lifetimes on create_token, try_deposit instead of catch_unwind, raised ledger TTLs for the year-long yield tests, snapshots committed like the other crates.

Verification

  • cargo test — all 17 crates green (22/22 in usdc_lending_pool)
  • cargo build --target wasm32-unknown-unknown --release
  • tsc --noEmit, eslint, vitest __tests__/api/cron
  • The Vercel preview build on this PR is the proof that the cron config is now accepted.

After merging

Add repo secrets KEEPER_BASE_URL (production URL, no trailing slash) and CRON_SECRET (same value as on Vercel) to enable the 5-minute keepers.

🤖 Generated with Claude Code

Vercel has rejected every deployment since 26 Aug with
"Hobby accounts are limited to daily cron jobs" because vercel.json
scheduled the liquidation and price-oracle crons on `* * * * *`.
Separately the contracts job has been red since 29 Aug because
usdc_lending_pool never compiled its tests.

Vercel
- vercel.json: every cron is now once a day (the Hobby ceiling), and the
  reputation-scoring cron is scheduled too (it had a route but no entry)
- new .github/workflows/keepers.yml runs the liquidation keeper and price
  oracle every 5 minutes by calling the same authenticated endpoints. It is
  a no-op until the KEEPER_BASE_URL and CRON_SECRET repo secrets exist.
- liquidation schedule test, route comment, .env.example and the
  keeper/oracle docs describe the new cadence

Contracts (usdc_lending_pool)
- `ledgers_elapsed` was u64 in a u128 saturating_mul (compile error)
- deposit used token.transfer_from, which needs a prior allowance the
  caller never grants; use transfer under the depositor's require_auth
  like the other contracts do
- tests: add lifetimes to create_token, replace catch_unwind (not
  UnwindSafe with an Env handle) with try_deposit, and raise ledger TTLs
  so the year-long yield tests do not archive contract storage
- commit the generated test snapshots like every other crate

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
trustlend-stellar Ready Ready Preview Sep 12, 2026 12:18pm UTC

@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d6f21c70-2b14-4f40-afb6-78f45e02dccb


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment on lines +24 to +53
name: Trigger cron endpoints
runs-on: ubuntu-latest
timeout-minutes: 5
env:
KEEPER_BASE_URL: ${{ secrets.KEEPER_BASE_URL }}
CRON_SECRET: ${{ secrets.CRON_SECRET }}
steps:
- name: Skip when secrets are not configured
id: gate
run: |
if [ -z "$KEEPER_BASE_URL" ] || [ -z "$CRON_SECRET" ]; then
echo "KEEPER_BASE_URL / CRON_SECRET not set — nothing to do."
echo "configured=false" >> "$GITHUB_OUTPUT"
else
echo "configured=true" >> "$GITHUB_OUTPUT"
fi

- name: Liquidation keeper
if: steps.gate.outputs.configured == 'true'
run: |
curl --fail-with-body --silent --show-error --max-time 120 \
-X POST "$KEEPER_BASE_URL/api/cron/liquidation" \
-H "Authorization: Bearer $CRON_SECRET"

- name: Price oracle
if: steps.gate.outputs.configured == 'true'
run: |
curl --fail-with-body --silent --show-error --max-time 120 \
-X POST "$KEEPER_BASE_URL/api/cron/price-oracle" \
-H "Authorization: Bearer $CRON_SECRET"
Name the elided lifetime on usdc_client's return type and prefix the
unused test binding, so `cargo clippy --all-targets -D warnings` passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@thisisouvik
thisisouvik merged commit 1a4c089 into main Sep 12, 2026
14 checks passed
@thisisouvik
thisisouvik deleted the fix/vercel-hobby-crons branch September 12, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants