feat: add new autofill environment section on automatic issues - #1630
Conversation
|
@Benebo7 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Auto-fills an Environment line in the GitHub issue body generated by
the "Report Issue", so maintainers can tell at a glance whether
a report came from SurfSense server or a self-hosted install.
What it does
detectEnvironment()tolib/env-config.ts, inferring thedeployment from
window.location.hostname:surfsense.comand*.surfsense.com→SurfSense Cloudself-hosted- **Environment:** …line:lib/error-toast.ts(buildIssueUrl— the in-app error toast)app/global-error.tsx(buildBasicIssueUrl— the global error boundary)Inferred from the hostname, so it needs no configuration from the
operator and adds no build/runtime env var.
Testing
the opened GitHub form shows
- **Environment:** self-hosted.surfsense.com(or a*.surfsense.comsubdomain), the same flowshows
- **Environment:** SurfSense Cloud.also includes the field.
Note
There are many issues reported by the "Report issue" button that the user don't
provide details, so probably this will help someway on providing few more info of user's env.
High-level PR Summary
This PR automatically adds environment information to GitHub issue reports generated by the application's error reporting features. It introduces a
detectEnvironment()function that infers whether the app is running on SurfSense Cloud (official domain) or self-hosted based on the hostname, and includes this information in both the error toast issue builder and the global error boundary issue builder. This helps maintainers quickly identify the deployment context when users report issues without needing any manual configuration or build-time environment variables.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_web/lib/env-config.tssurfsense_web/lib/error-toast.tssurfsense_web/app/global-error.tsx