Skip to content

feat: add new autofill environment section on automatic issues - #1630

Merged
MODSetter merged 1 commit into
MODSetter:devfrom
Benebo7:feat/environment-section-on-issues
Jul 25, 2026
Merged

feat: add new autofill environment section on automatic issues#1630
MODSetter merged 1 commit into
MODSetter:devfrom
Benebo7:feat/environment-section-on-issues

Conversation

@Benebo7

@Benebo7 Benebo7 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

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

  • Adds detectEnvironment() to lib/env-config.ts, inferring the
    deployment from window.location.hostname:
    • surfsense.com and *.surfsense.comSurfSense Cloud
    • everything else → self-hosted
  • Both issue builders now include an - **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

  1. Run a self-hosted stack, trigger an error, click Report Issue
    the opened GitHub form shows - **Environment:** self-hosted.
  2. On surfsense.com (or a *.surfsense.com subdomain), the same flow
    shows - **Environment:** SurfSense Cloud.
  3. Trigger the full-page error boundary to confirm the global error path
    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
Order File Path
1 surfsense_web/lib/env-config.ts
2 surfsense_web/lib/error-toast.ts
3 surfsense_web/app/global-error.tsx

Need help? Join our Discord

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ce5992d-2547-4234-ab39-f0a5adeb6381

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@MODSetter
MODSetter merged commit 13ebb56 into MODSetter:dev Jul 25, 2026
4 of 9 checks passed
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.

2 participants