Skip to content

Conversation

@rmgpinto
Copy link
Contributor

ref https://linear.app/ghost/issue/BER-3132

  • The require('@tryghost/errors') adds 50-100ms on boot time, this is due to the package's own initialization and require(). Since it's not needed at boot, it can be moved inside the beforeSend function.
@cursor
Copy link

cursor bot commented Dec 17, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on January 3.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Warning

Rate limit exceeded

@rmgpinto has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 14 minutes and 33 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 56e1a3e and ea35d84.

📒 Files selected for processing (1)
  • ghost/core/core/shared/sentry.js (2 hunks)

Walkthrough

A require statement for the @tryghost/errors module was relocated from the module's top-level scope into the beforeSend function within ghost/core/core/shared/sentry.js. This change implements lazy-loading of the dependency, deferring its initialization until the function is invoked rather than when the module is first imported. The module's functionality and internal logic remain unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Potential focus areas:
    • Verify that lazy-loading the errors module doesn't introduce timing or initialization order issues in the Sentry error handling flow
    • Confirm that the beforeSend function is reliably called before the errors module is needed
    • Check if there are any circular dependency implications from this change

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: moving a require() statement to improve boot performance by avoiding unnecessary module loading at startup.
Description check ✅ Passed The description is directly related to the changeset, explaining the performance motivation (50-100ms boot time reduction) and the specific implementation detail (lazy-loading errors module in beforeSend).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@rmgpinto rmgpinto force-pushed the shift-require-sentry branch 2 times, most recently from 8e6135d to 286b803 Compare December 17, 2025 16:43
ref https://linear.app/ghost/issue/BER-3132

- The `require('@tryghost/errors')` adds 50-100ms on boot time, this is
due to the package's own initialization and `require()`. Since it's not
needed at boot, it can be moved inside the `beforeSend` function.
@rmgpinto rmgpinto force-pushed the shift-require-sentry branch from 286b803 to ea35d84 Compare December 17, 2025 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants