-
-
Notifications
You must be signed in to change notification settings - Fork 257
Fix: Read all environment variables in sentry #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ueman is PR title a typo? |
Yep, that was a typo |
c1bfc93
to
ecf2750
Compare
ee82b3d
to
f37fc9c
Compare
I've opened an issue for failing Flutter beta builds here: #377 |
Co-authored-by: Manoel Aranda Neto <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #375 +/- ##
==========================================
+ Coverage 90.19% 90.25% +0.05%
==========================================
Files 51 52 +1
Lines 1642 1652 +10
==========================================
+ Hits 1481 1491 +10
Misses 161 161
Continue to review full report at Codecov.
|
Removed the #376 from the title |
@marandaneto I fixed the last missing bits. Please let me know if it is now good to go. |
dart/lib/src/platform_checker.dart
Outdated
@@ -1,3 +1,5 @@ | |||
import 'sentry_options.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we move defaultEnvironment
to EnvironmentVariables
instead
dart/lib/src/platform_checker.dart
Outdated
@@ -17,4 +19,18 @@ class PlatformChecker { | |||
bool isProfileMode() { | |||
return const bool.fromEnvironment('dart.vm.profile', defaultValue: false); | |||
} | |||
|
|||
/// This can be set as [SentryOptions.environment] | |||
String get environment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be a method instead? quite a few conditions to be just a property, maybe we move hardcoded values to EnvironmentVariables
instead
dart/test/environment_test.dart
Outdated
expect(options.dist, 'foo'); | ||
}); | ||
|
||
test('No options are set', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe let's improve the test name, something like, SentryOptions are overridden by environment
@@ -3,10 +3,12 @@ import 'package:flutter/services.dart'; | |||
import 'package:flutter/widgets.dart'; | |||
import 'package:flutter_test/flutter_test.dart'; | |||
import 'package:mockito/mockito.dart'; | |||
import 'package:package_info_plus/package_info_plus.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge main into this branch to not show the diff of non related stuff
made a few small suggestions but other than that LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
📜 Description
Environment variables are now read in sentry.
This also includes #376
💡 Motivation and Context
#306
💚 How did you test it?
I've written new tests.
📝 Checklist
🔮 Next steps