Skip to content

Sf import#661

Merged
ashwin31 merged 3 commits intomasterfrom
sf_import
Feb 27, 2026
Merged

Sf import#661
ashwin31 merged 3 commits intomasterfrom
sf_import

Conversation

@ashwin31
Copy link
Copy Markdown
Member

@ashwin31 ashwin31 commented Feb 27, 2026

Summary by CodeRabbit

  • Chores
    • Made error monitoring service optional and configurable through environment variables, enabling setup in production while remaining disabled locally by default.
    • Implemented automatic source map uploads to enhance debugging capabilities.
    • Added version polling configuration to improve app update detection.

Copilot AI review requested due to automatic review settings February 27, 2026 17:49
const dsn = env.PUBLIC_SENTRY_DSN || '';

Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -1,29 +1,18 @@
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'import' is only available in ES6 (use 'esversion: 6').

const dsn = env.PUBLIC_SENTRY_DSN || '';

Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -1,13 +1,11 @@
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'import' is only available in ES6 (use 'esversion: 6').

const dsn = env.PUBLIC_SENTRY_DSN || '';

Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -1,29 +1,18 @@
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'import' is only available in ES6 (use 'esversion: 6').

const dsn = env.PUBLIC_SENTRY_DSN || '';

Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -1,13 +1,11 @@
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'import' is only available in ES6 (use 'esversion: 6').

const dsn = env.PUBLIC_SENTRY_DSN || '';

Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -1,29 +1,18 @@
import { handleErrorWithSentry, replayIntegration } from "@sentry/sveltekit";
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'import' is only available in ES6 (use 'esversion: 6').

const dsn = env.PUBLIC_SENTRY_DSN || '';

Sentry.init({
dsn,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'object short notation' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).


Sentry.init({
dsn: 'https://59bf64c93be48f6cd30087fef7bbc54f@o4509449489088512.ingest.de.sentry.io/4510910257496144',
const dsn = env.PUBLIC_SENTRY_DSN || '';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

@@ -1,13 +1,11 @@
import * as Sentry from '@sentry/sveltekit';
import { env } from '$env/dynamic/public';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'import' is only available in ES6 (use 'esversion: 6').

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 27, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae947ba and d2e3d70.

📒 Files selected for processing (5)
  • frontend/.env.example
  • frontend/src/hooks.client.js
  • frontend/src/instrumentation.server.js
  • frontend/svelte.config.js
  • frontend/vite.config.js

📝 Walkthrough

Walkthrough

The PR modifies the SvelteKit frontend's Sentry integration to use environment-based DSN configuration instead of hardcoded values. Sentry is now conditionally initialized only when the PUBLIC_SENTRY_DSN environment variable is provided. Build configuration updates include source map auto-upload and dependency optimization settings.

Changes

Cohort / File(s) Summary
Sentry DSN Configuration
frontend/.env.example, frontend/src/hooks.client.js, frontend/src/instrumentation.server.js
Replaced hardcoded Sentry DSN strings with environment-based loading via PUBLIC_SENTRY_DSN. Both client and server-side Sentry initialization now conditionally enable Sentry only when a DSN is present (enabled: !!dsn).
Build & Framework Configuration
frontend/vite.config.js, frontend/svelte.config.js
Added autoUploadSourceMaps option to Sentry SvelteKit plugin (enabled when DSN is present), excluded esm-env from Vite dependency optimization, and introduced new kit.version.pollInterval configuration set to 60000ms.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Sf import #655 — Modifies frontend Sentry integration across the same configuration files (hooks.client.js, instrumentation.server.js, svelte.config.js, vite.config.js).

Poem

🐰 Hop along, the Sentry now takes flight,
No hardcoded secrets in plain sight!
From env it draws the DSN thread,
Conditional loading—just as we said.
Source maps upload with grace so keen,
Building stronger than ever seen! 🚀

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sf_import

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@ashwin31 ashwin31 merged commit 9a4df27 into master Feb 27, 2026
7 of 8 checks passed
@ashwin31 ashwin31 deleted the sf_import branch February 27, 2026 17:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors Sentry configuration to use environment variables instead of hardcoded values, improving security and configurability across development and production environments. The changes make Sentry optional by conditionally enabling it based on whether the PUBLIC_SENTRY_DSN environment variable is set.

Changes:

  • Removed hardcoded Sentry DSN and replaced with configurable PUBLIC_SENTRY_DSN environment variable
  • Added conditional Sentry enablement that only activates when DSN is provided
  • Configured automatic version polling (60s) for better deployment tracking

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
frontend/vite.config.js Added autoUploadSourceMaps configuration based on DSN presence; added esm-env to optimizeDeps exclusion
frontend/svelte.config.js Added version polling configuration with 60-second interval for automatic version detection
frontend/src/instrumentation.server.js Replaced hardcoded DSN with environment variable; added conditional enablement; removed verbose comments
frontend/src/hooks.client.js Replaced hardcoded DSN with environment variable; added conditional enablement; removed verbose comments
frontend/.env.example Added documentation for PUBLIC_SENTRY_DSN environment variable with usage instructions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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