-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Default Environment setting if none provided. #550
Default Environment setting if none provided. #550
Conversation
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.
That was quick @PureKrome ! Thanks a lot.
I left one note though, if you could please address that.
Regarding aspnet core there's a IntegrationTest.cs which could be the way to test it. It boots an app with options, so you could dupe a test and set an environment. Or assert th current one isn't default if that makes sense.
Ah! i see it, i'll give that an 👀 and check it out. |
@bruno-garcia Okay - found the more appropriate place for this code. I know you mentioned it in the Issue, but I just couldn't find it (global search foo also wasn't working for me 😊 ) What is really important here is that this code stops you from setting the
So this means that (from now on) there will always be a value for the |
Codecov Report
@@ Coverage Diff @@
## main #550 +/- ##
==========================================
+ Coverage 85.16% 85.18% +0.02%
==========================================
Files 137 137
Lines 3317 3322 +5
Branches 749 749
==========================================
+ Hits 2825 2830 +5
Misses 294 294
Partials 198 198
Continue to review full report at Codecov.
|
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.
Nice and clean change. Thanks.
I did uncover some behavior which I believe isn't correct. If you don't mind, you could fix in this PR. Otherwise we cna merge and have a follow up
test/Sentry.AspNetCore.Tests/IntegrationMockedBackgroundWorker.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Bruno Garcia <[email protected]>
Can you take a moment to think about this question? I just want to make sure it's been considered. |
@PureKrome you can opt out on BeforeSend since that runs after the event processors |
To clarify:
|
Ah! gotcha! Yep, I think i noticed the Could this be documented? not sure if the docs need to get updated, at least with some guidence about the default value and order of setting, IMO. Check the Docs about Environments, I couldn't read anything there that suggests that the |
…o 549/default-environment-if-missing # Conflicts: # CHANGELOG.md
@PureKrome we've updated the SDK docs for SDK developers to add a default, but user docs wouldn't need to be changed in that way. We could/should document that a default is indeed sent in some SDKs, with the value |
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.
Excellent! Thanks a lot @PureKrome !
Fixes #549.
Required:
Done:
Environment
inSentryEvent
andSentryOptions
(see below, the reasoning)SentryClient
testsQuestions:
A few questions with respect to this PR.
I've included a
SentryOptions
check, also. My unskilled understanding is that theSentryEvent
might have it set (which is very granular) but if not, then it's possible it was set viaSentryOptions
(higher up/earlier on) ... which we should then respect.I'm not sure I found the scenario's for testing the ASP.NET Core app with respect to testing+environments. I did end up finding this test code, which I tested again (and passed). This test code hinted at the use of setting (and testing) for options (which I first read and referenced here). So I just added a note there, for future developers to get some hints to understanding the code base.