Skip to content

feat(sentry): use correct env#4149

Open
jog1t wants to merge 1 commit into02-06-fix_rivetkit_buildfrom
02-06-feat_sentry_use_correct_env
Open

feat(sentry): use correct env#4149
jog1t wants to merge 1 commit into02-06-fix_rivetkit_buildfrom
02-06-feat_sentry_use_correct_env

Conversation

@jog1t
Copy link
Contributor

@jog1t jog1t commented Feb 6, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@jog1t jog1t marked this pull request as ready for review February 6, 2026 22:30
Copy link
Contributor Author

jog1t commented Feb 6, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jog1t jog1t mentioned this pull request Feb 6, 2026
11 tasks
@claude
Copy link

claude bot commented Feb 6, 2026

Code Review

This PR adds proper Sentry environment configuration to distinguish between staging and production environments. Overall, the changes are straightforward and improve observability. Here are my findings:

✅ Positives

  1. Correct approach: Using VITE_APP_SENTRY_ENV to configure Sentry environment is the right pattern
  2. Consistent implementation: The environment variable is added across all necessary locations (Dockerfiles, env schema, and Sentry initialization)
  3. Proper defaults: Using RAILWAY_ENVIRONMENT_NAME:-staging provides a sensible fallback

🐛 Issues Found

1. Missing import in components package (frontend/packages/components/src/third-party-providers.tsx:39)

The file references commonEnv() on line 39 but doesn't import it. This will cause a runtime error.

// Missing import - need to add:
import { commonEnv } from '@/lib/env';
// Or equivalent relative path

2. Duplicate/leftover code removed (frontend/packages/components/src/third-party-providers.tsx:46)

Good catch removing the duplicate tunnel assignment and the undefined cloudEnv() reference that would have caused issues.

3. Console.log in production code (frontend/vite.engine.config.ts:36-39)

The added console.log is useful for debugging but should probably use a proper logging mechanism or be removed before merging to production:

console.log(
    env.SENTRY_AUTH_TOKEN
        ? "Sentry plugin enabled"
        : "Sentry plugin disabled (missing auth token)",
);

Consider: Is this intended for debugging only, or should it stay? If keeping it, consider using a conditional based on environment.

📝 Minor Observations

  1. Removed empty line (.env): Minor formatting cleanup - acceptable
  2. Environment schema: Properly added to Zod schema with optional typing - correct approach

🧪 Testing Recommendations

Before merging:

  1. Verify the commonEnv import issue in the components package is resolved
  2. Test that Sentry correctly tags events with "staging" vs "production" environments
  3. Verify Railway deployments correctly set RAILWAY_ENVIRONMENT_NAME
  4. Confirm local development still works (should default to "staging")

🔒 Security

No security concerns - Sentry DSN and environment names are public-facing values that are safe to include in client-side code.

⚡ Performance

No performance impact.


Summary: The PR is solid conceptually but has a critical import issue that will break the build. Fix the missing commonEnv import in the components package, decide on the console.log, and this should be good to merge.

Recommendation: Request changes to fix the import error before merging.

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 6, 2026

Graphite Automations

"Test" took an action on this PR • (02/06/26)

1 assignee was added to this PR based on Kacper Wojciechowski's automation.

@jog1t jog1t force-pushed the 02-06-feat_sentry_use_correct_env branch from 7e97d88 to b392e46 Compare February 6, 2026 23:32
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.

1 participant