Skip to content

Comments

feat: Add spam block schema and migration#23996

Merged
emrysal merged 11 commits intomainfrom
feat/spam-block-schema-change
Sep 24, 2025
Merged

feat: Add spam block schema and migration#23996
emrysal merged 11 commits intomainfrom
feat/spam-block-schema-change

Conversation

@alishaz-polymath
Copy link
Member

@alishaz-polymath alishaz-polymath commented Sep 23, 2025

What does this PR do?

Adds schema and migration to support spam blocking in org as well as globally. This is the first part of the bunch of PR stacked to complete the SPAM bookings blocking feature.

  • Fixes #XXXX (GitHub issue number)
  • Fixes CAL-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • NA - I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • NA - I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • NA - I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Warning

Rate limit exceeded

@alishaz-polymath has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 30 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 6ead82a and a390099.

📒 Files selected for processing (1)
  • packages/prisma/migrations/20250923082416_add_spam_block/migration.sql (1 hunks)

Walkthrough

Adds enum WatchlistAction (REPORT, BLOCK). Alters Watchlist to add action (WatchlistAction, NOT NULL, default REPORT), organizationId (nullable Int), and updates uniqueness/indexes to @@unique([type, value, organizationId]) plus an index on (type, value, organizationId, action) and a filtered unique index for global entries where organizationId IS NULL. Creates BlockedBookingLog with id (PK, uuid/text), email (NOT NULL), eventTypeId, organizationId, bookingData (JSONB/Json), watchlistId, createdAt (timestamp, default now) and indexes on id, (organizationId, createdAt), email, and watchlistId. Updates BillingPeriod to MONTHLY and ANNUALLY.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat: Add spam block schema and migration" succinctly and accurately summarizes the primary change in this changeset (adding Prisma schema changes and a migration to support spam blocking) and aligns with the modified files, so it is concise and on-topic.
Description Check ✅ Passed The description clearly states the intent to add schema and migration support for spam blocking and notes this is the first PR in a stacked implementation, which is directly related to the changes in schema.prisma and the migration SQL, so it passes the lenient relevance check.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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 and usage tips.

@github-actions github-actions bot added the ❗️ migrations contains migration files label Sep 23, 2025
@keithwillcode keithwillcode added core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO labels Sep 23, 2025
@alishaz-polymath alishaz-polymath marked this pull request as ready for review September 23, 2025 08:27
@alishaz-polymath alishaz-polymath requested a review from a team as a code owner September 23, 2025 08:27
@vercel
Copy link

vercel bot commented Sep 23, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
cal Ignored Ignored Sep 23, 2025 4:59pm
cal-eu Ignored Ignored Sep 23, 2025 4:59pm

@dosubot dosubot bot added the ✨ feature New feature or request label Sep 23, 2025
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as outdated.

@pull-request-size pull-request-size bot added size/M and removed size/L labels Sep 23, 2025
coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

LGTM, looks good to me.

Copy link
Contributor

@emrysal emrysal left a comment

Choose a reason for hiding this comment

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

LGTM, looks good to me.

@github-actions
Copy link
Contributor

E2E results are ready!

@emrysal emrysal merged commit 4413295 into main Sep 24, 2025
63 of 64 checks passed
@emrysal emrysal deleted the feat/spam-block-schema-change branch September 24, 2025 02:50
@coderabbitai coderabbitai bot mentioned this pull request Sep 24, 2025
8 tasks
saurabhraghuvanshii pushed a commit to saurabhraghuvanshii/cal.com that referenced this pull request Sep 24, 2025
* schema

* fix migration

* --

* optional org

* --

* remove prisma level relation

* --

* rename

* remove redundant key

* --
@coderabbitai coderabbitai bot mentioned this pull request Oct 3, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO ✨ feature New feature or request ❗️ migrations contains migration files ready-for-e2e size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants