-
-
Notifications
You must be signed in to change notification settings - Fork 225
Removed obsolete v6 APIs #4619
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
base: version6
Are you sure you want to change the base?
Removed obsolete v6 APIs #4619
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## version6 #4619 +/- ##
===========================================
Coverage ? 73.04%
===========================================
Files ? 478
Lines ? 17315
Branches ? 3422
===========================================
Hits ? 12647
Misses ? 3813
Partials ? 855 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606)) | ||
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602)) | ||
- Removed obsolete v6 APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619)) |
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.
suggestion:
- Removed obsolete v6 APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619)) | |
- Removed obsolete APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619)) |
To me, the v6
in the entry doesn't read well ... we haven't added any stable "v6" APIs yet.
|
||
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606)) | ||
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602)) | ||
- Removed obsolete v6 APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619)) |
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.
re: Extra
SentrySpan
SentryTransaction
TransactionTracer
I do agree on the argument about "consolidating all the Extra, Data, Tags, and such into Attributes".
... we may have an additional problem:
Does this actually also include Sentry.IHasExtra
and Sentry.HasExtraExtensions
.
If it does, then we can't really remove the Extra
indeed, because we haven't marked the IHasExtra
interface nor its members, neither have we marked the HasExtraExtensions
as obsolete. And also, we have missed the types Sentry.SpanTracer
and Sentry.Scope
as well:
hub.ConfigureScope(scope =>
{
scope.SetExtra("Extra!", "Some extra information"); // does not warn
_ = scope.Extra; // does not warn
});
ITransactionTracer transaction = SentrySdk.StartTransaction("", "");
transaction.SetExtra("", ""); // does not warn
transaction.SetExtras([]); // does not warn
_ = transaction.Extra; // does not warn
ISpan span = SentrySdk.StartSpan("", "");
span.SetExtra("", ""); // does not warn
span.SetExtras([]); // does not warn
_ = span.Extra; // does not warn
_ = (SentrySdk.StartTransaction("", "") as TransactionTracer)!.Extra; // CS0618
_ = (SentrySdk.StartSpan("", "") as SpanTracer)!.Extra; // does not warn
So we have been incomplete with marking the feature "Extra" as Obsolete.
Only if the concrete types SentryTransaction
, or SentrySpan
or TransactionTracer
are used.
But if any interface or other concrete types are used, "Extra" is not marked as Obsolete.
Perhaps we should, for this release, make sure, that we mark "Extra" as Obsolete consistently, including
IHasExtra
interface and membersHasExtraExtensions
type and membersScope
SpanTracer
- ...
Because currently, we only produce on some usages of "Extra" an Obsolete warning, but not on all usages of "Extra", especially on the interfaces which are usually the types that we return.
|
||
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606)) | ||
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602)) | ||
- Removed obsolete v6 APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619)) |
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.
re: GetInternalSentryOptions
Agreed. Obsolete
here is a misuse.
Although I do like something like "InternalApi" more than "Obsolete", this reminds me of Pubternal, which has been banned from the .NET libraries.
Can't we actually make this internal
?
...
No, we cannot ... due to the usage in Sentry.Hangfire
... we removed the Strong-Name: #4099
I would love a solution to no longer have this extension method as "Pubternal", but properly "Internal".
But we'd probably want to do this in a separate PR.
In other words:
I vote for leaving this method Obsolete
as-is, and think about a "proper" solution, preferably without the use of "Pubternal" through name/namespace/analyzer.
|
||
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606)) | ||
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602)) | ||
- Removed obsolete v6 APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619)) |
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.
re: CrashType
I do agree ... this is a bit of a misuse of Obsolete
... an Analyzer would be the better fit indeed.
A custom and specific diagnostic that indicates to the user that this method will crash.
This way we can also add a dedicated Help-Link, that the user may click in their IDE that could lead to a documentation page where we describe this and all our future Analyzers.
But I'd like to see this without an additional Attribute
.
An Attribute like InternalApi
reminds me of Pubternal, a pattern that has been "banned" by Microsoft for the .NET libraries.
Just a Diagnostic-Analyzer, that is enabled per default, reports a Warning per default, and flags all usages of Sentry.CrashType
and SentrySdk.CauseCrash
.
|
||
- SentryOptions.IsEnvironmentUser now defaults to false on MAUI. The means the User.Name will no longer be set, by default, to the name of the device ([#4606](https://github.com/getsentry/sentry-dotnet/pull/4606)) | ||
- Remove unnecessary files from SentryCocoaFramework before packing ([#4602](https://github.com/getsentry/sentry-dotnet/pull/4602)) | ||
- Removed obsolete v6 APIs ([#4619](https://github.com/getsentry/sentry-dotnet/pull/4619)) |
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.
re: EnableWatchdogTerminationTracking
Hmmm .... I'm uncertain right now 🤔
Resolves #4608
Obsolete
APIs for6.0.0
#4608For discussion
There are a couple of APIs left that are still marked as obsolete, which probably merit some discussion:
Extra
SentrySpan
,SentryTransaction
andTransactionTracer
all haveExtra
members like:sentry-dotnet/src/Sentry/SentrySpan.cs
Lines 82 to 84 in 748fcfe
sentry-dotnet/src/Sentry/SentrySpan.cs
Lines 86 to 88 in 748fcfe
Although we do probably want to get rid of these, as believe we also want to get rid of the
Data
members that we're recommending people switch to... since I think all of these will be replaced by Attributes at some stage right?Possibly we delay replacing these until the new Attributes are available and, at that point, we could ship an Analyzer and a Code fix to help people migrate (since Extras may be used quite widely).
GetInternalSentryOptions
We also have this, which is a bit of a misuse of the
ObsoleteAttribute
:sentry-dotnet/src/Sentry/SentryClientExtensions.cs
Lines 98 to 110 in 216bbc5
We could potentially replace it with this:
And then also ship a Roslyn Analyzer that warns if people use something decorated with
InternalApiAttribute
.CrashType
Same again for the APIs designed to deliberately create a crash:
sentry-dotnet/src/Sentry/CrashType.cs
Lines 7 to 8 in bd62cf0
EnableWatchdogTerminationTracking
Not sure what we want to do with this. Is the long term plan to remove this functionality entirely or are we planning to address the issues with this and "unobsolete" it eventually?
sentry-dotnet/src/Sentry/Platforms/Cocoa/SentryOptions.cs
Lines 147 to 157 in 4a608d4
In the meantime, do we want to remove it from the .NET API?