Skip to content

Membership cron job#1675

Merged
ErikaKK merged 4 commits intomasterfrom
membership-cron-job
Apr 9, 2026
Merged

Membership cron job#1675
ErikaKK merged 4 commits intomasterfrom
membership-cron-job

Conversation

@ErikaKK
Copy link
Copy Markdown
Contributor

@ErikaKK ErikaKK commented Apr 8, 2026

Change Summary

[Briefly summarise the changes that you made. Just high-level stuff]

Change Form

Fill this up (NA if not available). If a certain criteria is not met, can you please give a reason.

  • The pull request title has an issue number
  • The change works by "Smoke testing" or quick testing
  • The change has tests
  • The change has documentation

Other Information

[Is there anything in particular in the review that I should be aware of?]

@ErikaKK ErikaKK requested a review from Copilot April 8, 2026 15:13
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

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

Project Deployment Actions Updated (UTC)
website Ready Ready Preview, Comment Apr 8, 2026 3:14pm

Request Review

Comment on lines +84 to +101
name: Backup database to S3
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- name: Dump database
env:
SUPABASE_DB_URL: ${{ secrets.SUPABASE_DB_URL }}
PGSSLMODE: require
run: pg_dump "$SUPABASE_DB_URL" -Fc -f backup.dump

- name: Upload to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
run: |
aws s3 cp backup.dump "s3://$S3_BUCKET/backups/$(date +%Y-%m-%d_%H-%M-%S).dump"
Copy link
Copy Markdown

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 refactors membership-related cron behavior by removing the standalone membership renewal reminder cron/route, moving reminder sending into the membership cycling cron, and adding a new cron endpoint to periodically ping the database to prevent Supabase pausing. It also adds a database backup job to CI and includes a performance report document.

Changes:

  • Remove /api/cron/membership-renewal-reminder and update the renewal email template to support a dynamic membership end date.
  • Add /api/cron/prevent-supabase-pausing and schedule it in vercel.json.
  • Add a CI job to dump the Supabase database and upload the dump to S3.

Reviewed changes

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

Show a summary per file
File Description
vercel.json Removes the membership reminder cron schedule and adds a new keep-alive cron schedule.
src/components/email-template.tsx Updates the membership renewal reminder email to accept dynamic props (name/date/link).
src/app/api/cron/prevent-supabase-pausing/route.ts Adds a cron-protected DB “health” endpoint to prevent Supabase pausing.
src/app/api/cron/membership-renewal-reminder/route.ts Removes the old reminder-sending cron endpoint.
src/app/api/cron/cycle-memberships/route.ts Updates membership-cycling cron to also send reminder emails via Resend.
codersforcauses-performance-report.md Adds a performance report document.
.github/workflows/ci.yml Adds a database backup-to-S3 job on pushes to master.

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

@ErikaKK ErikaKK merged commit e9b72c8 into master Apr 9, 2026
4 checks passed
@ErikaKK ErikaKK deleted the membership-cron-job branch April 9, 2026 13:50
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.

3 participants