Skip to content

[#891] Add weekly stats snapshot cron + vercel.json#910

Merged
realproject7 merged 2 commits intomainfrom
task/891-weekly-cron
Apr 21, 2026
Merged

[#891] Add weekly stats snapshot cron + vercel.json#910
realproject7 merged 2 commits intomainfrom
task/891-weekly-cron

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Fixes #891

Summary

  • GET /api/cron/airdrop-weekly: weekly cron that aggregates campaign stats into pl_weekly_snapshots
    • Counts new storylines, buy events, new referrals for the past week
    • Records mcap at week start/end from pl_daily_prices
    • Sums total PL points earned during the week
    • Idempotent: one entry per week number
    • CRON_SECRET auth, GET method for Vercel cron compatibility
  • vercel.json: registered all 3 airdrop crons:
    • airdrop-points every 5 min (note: route exports POST — may need GET adapter for Vercel cron)
    • airdrop-price daily at midnight UTC
    • airdrop-weekly Monday midnight UTC

Test plan

  • Verify cron rejects unauthorized requests (401)
  • Verify idempotency — second call for same week returns skipped
  • Verify all stats aggregated correctly from respective tables
  • Verify mcap start/end pulled from correct date boundaries
  • Verify week number calculated from campaign start date
  • Verify vercel.json has all 3 airdrop cron entries

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
plotlink Ignored Ignored Apr 21, 2026 6:07am

Request Review

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The weekly snapshot route itself is plausible, but the vercel.json change registers an airdrop cron that this repo does not expose in a Vercel-compatible form.

Findings

  • [high] vercel.json schedules /api/cron/airdrop-points every 5 minutes, but this PR does not add a matching GET cron route or adapter for that path. The PR body itself notes that the existing airdrop-points route exports POST, which means this scheduled job will not run successfully as registered.
    • File: vercel.json:7
    • Suggestion: Either add a GET /api/cron/airdrop-points adapter that matches Vercel cron invocation, or remove this cron registration from the PR until the route supports it.

Decision

Requesting changes because the PR claims to register all 3 airdrop crons correctly, but one of those scheduled entries is not actually invokable in production as configured.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The follow-up update resolves the cron-registration issue from my prior review. vercel.json now only registers the two GET-compatible airdrop crons implemented in this repo: airdrop-price and airdrop-weekly.

Findings

  • No remaining code-level blockers in the changed files.

Decision

Approving because the weekly snapshot cron and cron registration I reviewed now match issue #891.

@realproject7 realproject7 merged commit d30d66c into main Apr 21, 2026
2 of 4 checks passed
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.

[Airdrop P4] Weekly stats snapshot cron + vercel.json

2 participants