fix(ci): unblock Vercel deploys (Hobby cron limit) and the contracts CI job - #312
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
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>
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.
Why
* * * * *) would run more than once per day." — see the vercel[bot] comment on chore: cleanup — remove dead code, indexer stack, stale docs and assets #311.usdc_lending_pool(Add Smart Contract for USDC Lending Pool #252) never compiled its tests (u64passed to au128saturating_mul, plus test-only lifetime /catch_unwinderrors).What
Vercel
vercel.json: all crons are now daily (the Hobby ceiling).reputation-scoringgets an entry (it had a route but was never scheduled)..github/workflows/keepers.yml: hits/api/cron/liquidationand/api/cron/price-oracleevery 5 minutes withBearer CRON_SECRET. No-op until theKEEPER_BASE_URLandCRON_SECRETrepository secrets are set..env.example, route comment and the schedule test updated for the new cadence.usdc_lending_poolu64/u128mismatch incompute_yield.depositusedtransfer_from, which requires an allowance nobody grants →transferunder the depositor'srequire_auth, consistent withlending.create_token,try_depositinstead ofcatch_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 inusdc_lending_pool)cargo build --target wasm32-unknown-unknown --release✅tsc --noEmit,eslint,vitest __tests__/api/cron✅After merging
Add repo secrets
KEEPER_BASE_URL(production URL, no trailing slash) andCRON_SECRET(same value as on Vercel) to enable the 5-minute keepers.🤖 Generated with Claude Code