Skip to content

feat(sentry): use correct env#4149

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

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 - PR #4149: feat(sentry): use correct env

Summary

This PR adds support for configuring the Sentry environment via VITE_APP_SENTRY_ENV to properly distinguish between staging and production deployments in Sentry.

Issues Found

🐛 Critical Bug: Missing Import in frontend/packages/components/src/third-party-providers.tsx

Location: frontend/packages/components/src/third-party-providers.tsx:39

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

// Line 39 - uses commonEnv() but it's not imported
environment: commonEnv().VITE_APP_SENTRY_ENV,

Fix needed: Add the import at the top of the file:

import { commonEnv } from '@/lib/env';

Note: The frontend/src/components/third-party-providers.tsx file correctly imports commonEnv, but the packages version does not.


⚠️ Code Quality: Duplicate tunnel Configuration

Location: frontend/packages/components/src/third-party-providers.tsx:36-38

The diff shows a duplicate tunnel assignment was removed, which is good. However, verify that the remaining tunnel configuration is correct:

// Before (had duplicate):
tunnel: getConfig().sentry?.tunnel,
tunnel: __APP_TYPE__ === "cloud" ? cloudEnv().VITE_APP_SENTRY_TUNNEL_URL : undefined,

// After (only one remains):
tunnel: getConfig().sentry?.tunnel,

Make sure this change doesn't break cloud-specific tunnel configuration if it was intentional.


Positive Changes

Proper Environment Separation: Using VITE_APP_SENTRY_ENV allows proper environment tagging in Sentry
Docker Configuration: Correctly uses RAILWAY_ENVIRONMENT_NAME with fallback to staging
Schema Validation: Added to commonEnvSchema with proper optional typing
Debug Logging: Console log in vite config helps understand Sentry plugin state

Recommendations

  1. Fix the import - Add commonEnv import to frontend/packages/components/src/third-party-providers.tsx
  2. Verify tunnel configuration - Confirm that removing the cloud-specific tunnel logic is intentional
  3. Consider default value - The schema marks VITE_APP_SENTRY_ENV as optional. Consider if a default value (like 'development') would be appropriate when not set
  4. Test both builds - Verify both the main frontend and the components package build correctly with these changes

Test Coverage

No new tests were added. Consider adding tests for:

  • Sentry initialization with the new environment parameter
  • Proper environment value propagation from env vars

Action Required: Fix the missing import before merging to prevent runtime errors.

@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
@jog1t jog1t force-pushed the 02-06-feat_sentry_use_correct_env branch from b392e46 to f4bf14b Compare February 9, 2026 19:17
@jog1t jog1t force-pushed the 02-06-fix_rivetkit_build branch from cead745 to 7cbc7e1 Compare February 9, 2026 19:17
@NathanFlurry NathanFlurry changed the base branch from 02-06-fix_rivetkit_build to graphite-base/4149 February 9, 2026 21:55
@NathanFlurry NathanFlurry force-pushed the 02-06-feat_sentry_use_correct_env branch from f4bf14b to b5d19c7 Compare February 10, 2026 01:30
@NathanFlurry NathanFlurry changed the base branch from graphite-base/4149 to 02-06-fix_rivetkit_build February 10, 2026 01:30
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 10, 2026

Merge activity

  • Feb 10, 8:45 AM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Feb 10, 8:46 AM UTC: CI is running for this pull request on a draft pull request (#4166) due to your merge queue CI optimization settings.
  • Feb 10, 8:48 AM UTC: The Graphite merge queue removed this pull request due to downstack failures on PR #4081.
  • Feb 10, 7:35 PM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Feb 10, 7:36 PM UTC: CI is running for this pull request on a draft pull request (#4167) due to your merge queue CI optimization settings.
  • Feb 10, 7:36 PM UTC: Merged by the Graphite merge queue via draft PR: #4167.

graphite-app bot pushed a commit that referenced this pull request Feb 10, 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
@NathanFlurry NathanFlurry changed the base branch from 02-06-fix_rivetkit_build to graphite-base/4149 February 10, 2026 19:19
@NathanFlurry NathanFlurry changed the base branch from graphite-base/4149 to 02-06-fix_rivetkit_build February 10, 2026 19:20
@NathanFlurry NathanFlurry force-pushed the 02-06-fix_rivetkit_build branch from 53320bb to e8fad3b Compare February 10, 2026 19:25
@NathanFlurry NathanFlurry force-pushed the 02-06-feat_sentry_use_correct_env branch from b5d19c7 to 061bcbc Compare February 10, 2026 19:25
graphite-app bot pushed a commit that referenced this pull request Feb 10, 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
@graphite-app graphite-app bot closed this Feb 10, 2026
@graphite-app graphite-app bot deleted the 02-06-feat_sentry_use_correct_env branch February 10, 2026 19:36
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