Skip to content

chore: upgrade @unkey/ratelimit #22902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 5, 2025
Merged

chore: upgrade @unkey/ratelimit #22902

merged 2 commits into from
Aug 5, 2025

Conversation

chronark
Copy link
Contributor

@chronark chronark commented Aug 5, 2025

What does this PR do?

This PR upgrades @unkey/ratelimit to v2.
The v2 API runs on aws (including us-east-2, where cal runs) and has significantly lower latency.

Here's some more context, but it's not really relevant to this PR: https://www.unkey.com/blog/serverless-exit

Visual Demo (For contributors especially)

We run this in our own dashboard on vercel and get these numbers:
CleanShot 2025-08-05 at 15 14 05@2x

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • 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.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.
    I only tested this manually locally

How should this be tested?

It behaves the same way as before, just faster.

  1. clone the repo
  2. Set the UNKEY_ROOT_KEY env variable in .env
  3. Run yarn dx
  4. Click around in the dashboard to trigger ratelimits
  5. (Optionally) go to https://app.unkey.com to check the analytics of the ratelimit operations

Unkey's v2 api runs on AWS (including us-east-2, where cal runs) and has
significantly lower latency than v1.
@chronark chronark requested a review from a team as a code owner August 5, 2025 13:15
Copy link

vercel bot commented Aug 5, 2025

@chronark is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

coderabbitai bot commented Aug 5, 2025

Walkthrough

The package.json file was modified to include a new dependency: "@unkey/ratelimit" with version ^2.1.2. No other changes were made to the file, and there were no alterations to scripts, configurations, or exported/public entities.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e55cee4 and cd58e83.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: applies to **/*.{ts,tsx} : flag excessive day.js use in performance-critical code; prefer native dat...
Learnt from: CR
PR: calcom/cal.com#0
File: .cursor/rules/review.mdc:0-0
Timestamp: 2025-07-28T11:50:23.946Z
Learning: Applies to **/*.{ts,tsx} : Flag excessive Day.js use in performance-critical code; prefer native Date or Day.js `.utc()` in hot paths like loops

Applied to files:

  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Socket Security: Pull Request Alerts
🔇 Additional comments (1)
package.json (1)

121-122: Dependency upgrade looks correct

Adding the caret-pinned @unkey/ratelimit@^2.1.2 aligns with the PR objective of moving to the AWS-backed v2 API. No immediate concerns here.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Aug 5, 2025
@graphite-app graphite-app bot requested a review from a team August 5, 2025 13:16
@dosubot dosubot bot added the ⬆️ dependencies Pull requests that update a dependency file label Aug 5, 2025
Copy link

graphite-app bot commented Aug 5, 2025

Graphite Automations

"Add consumer team as reviewer" took an action on this PR • (08/05/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add foundation team as reviewer" took an action on this PR • (08/05/25)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add community label" took an action on this PR • (08/05/25)

1 label was added to this PR based on Keith Williams's automation.

Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmodule-alias@​2.2.310010010079100
Addedical.js@​1.5.01001001008170
Added@​formkit/​auto-animate@​1.0.0-beta.51001008481100

View full report

@emrysal
Copy link
Contributor

emrysal commented Aug 5, 2025

Thank you @chronark - we've had this PR in the making @ #22893 - but I see your version is slightly higher. Will prioritise this because of that.

@chronark
Copy link
Contributor Author

chronark commented Aug 5, 2025

@emrysal ah shit my bad. I didn't think you'd be that quick, we just posted that yesterday :D

Copy link
Contributor

github-actions bot commented Aug 5, 2025

E2E results are ready!

@kart1ka kart1ka closed this Aug 5, 2025
auto-merge was automatically disabled August 5, 2025 14:26

Pull request was closed

@kart1ka kart1ka reopened this Aug 5, 2025
@emrysal emrysal enabled auto-merge (squash) August 5, 2025 16:04
@emrysal emrysal merged commit 781d0d9 into calcom:main Aug 5, 2025
148 of 160 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Created by Linear-GitHub Sync ⬆️ dependencies Pull requests that update a dependency file ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants