From fcac4b4f5223d9d95dc78a98a80b6385f662490f Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 1 Mar 2024 14:14:58 +0100 Subject: [PATCH 1/3] chore: remove ScopeExtensions class --- src/Sentry/Scope.cs | 178 +++++++++++++++ src/Sentry/ScopeExtensions.cs | 214 ------------------ .../ApiApprovalTests.Run.Net4_8.verified.txt | 31 ++- ...{ScopeExtensionsTests.cs => ScopeTests.cs} | 0 4 files changed, 192 insertions(+), 231 deletions(-) delete mode 100644 src/Sentry/ScopeExtensions.cs rename test/Sentry.Tests/Protocol/{ScopeExtensionsTests.cs => ScopeTests.cs} (100%) diff --git a/src/Sentry/Scope.cs b/src/Sentry/Scope.cs index 545a801223..6d4cefb92a 100644 --- a/src/Sentry/Scope.cs +++ b/src/Sentry/Scope.cs @@ -1,4 +1,5 @@ using Sentry.Extensibility; +using Sentry.Internal; using Sentry.Internal.Extensions; namespace Sentry; @@ -560,6 +561,183 @@ public ISpan? Span set => _span = value; } + /// + /// Invokes all event processor providers available. + /// + public IEnumerable GetAllEventProcessors() + { + foreach (var processor in Options.GetAllEventProcessors()) + { + yield return processor; + } + + foreach (var processor in EventProcessors) + { + yield return processor; + } + } + + /// + /// Invokes all transaction processor providers available. + /// + public IEnumerable GetAllTransactionProcessors() + { + foreach (var processor in Options.GetAllTransactionProcessors()) + { + yield return processor; + } + + foreach (var processor in TransactionProcessors) + { + yield return processor; + } + } + + /// + /// Invokes all exception processor providers available. + /// + public IEnumerable GetAllExceptionProcessors() + { + foreach (var processor in Options.GetAllExceptionProcessors()) + { + yield return processor; + } + + foreach (var processor in ExceptionProcessors) + { + yield return processor; + } + } + + /// + /// Add an exception processor. + /// + /// The exception processor. + public void AddExceptionProcessor(ISentryEventExceptionProcessor processor) + => ExceptionProcessors.Add(processor); + + /// + /// Add the exception processors. + /// + /// The exception processors. + public void AddExceptionProcessors(IEnumerable processors) + { + foreach (var processor in processors) + { + ExceptionProcessors.Add(processor); + } + } + + /// + /// Adds an event processor which is invoked when creating a . + /// + /// The event processor. + public void AddEventProcessor(ISentryEventProcessor processor) + => EventProcessors.Add(processor); + + /// + /// Adds an event processor which is invoked when creating a . + /// + /// The event processor. + public void AddEventProcessor(Func processor) + => AddEventProcessor(new DelegateEventProcessor(processor)); + + /// + /// Adds event processors which are invoked when creating a . + /// + /// The event processors. + public void AddEventProcessors(IEnumerable processors) + { + foreach (var processor in processors) + { + EventProcessors.Add(processor); + } + } + + /// + /// Adds an transaction processor which is invoked when creating a . + /// + /// The transaction processor. + public void AddTransactionProcessor(ISentryTransactionProcessor processor) + => TransactionProcessors.Add(processor); + + /// + /// Adds an transaction processor which is invoked when creating a . + /// + /// The transaction processor. + public void AddTransactionProcessor(Func processor) + => AddTransactionProcessor(new DelegateTransactionProcessor(processor)); + + /// + /// Adds transaction processors which are invoked when creating a . + /// + /// The transaction processors. + public void AddTransactionProcessors(IEnumerable processors) + { + foreach (var processor in processors) + { + TransactionProcessors.Add(processor); + } + } + + /// + /// Adds an attachment. + /// + /// + /// Note: the stream must be seekable. + /// + public void AddAttachment( + Stream stream, + string fileName, + AttachmentType type = AttachmentType.Default, + string? contentType = null) + { + var length = stream.TryGetLength(); + if (length is null) + { + Options.LogWarning( + "Cannot evaluate the size of attachment '{0}' because the stream is not seekable.", + fileName); + + return; + } + + // TODO: Envelope spec allows the last item to not have a length. + // So if we make sure there's only 1 item without length, we can support it. + AddAttachment( + new SentryAttachment( + type, + new StreamAttachmentContent(stream), + fileName, + contentType)); + } + + /// + /// Adds an attachment. + /// + public void AddAttachment( + byte[] data, + string fileName, + AttachmentType type = AttachmentType.Default, + string? contentType = null) => + AddAttachment( + new SentryAttachment( + type, + new ByteAttachmentContent(data), + fileName, + contentType)); + + /// + /// Adds an attachment. + /// + public void AddAttachment(string filePath, AttachmentType type = AttachmentType.Default, string? contentType = null) + => AddAttachment( + new SentryAttachment( + type, + new FileAttachmentContent(filePath, Options.UseAsyncFileIO), + Path.GetFileName(filePath), + contentType)); + internal void ResetTransaction(ITransactionTracer? expectedCurrentTransaction) => Interlocked.CompareExchange(ref _transaction, null, expectedCurrentTransaction); } diff --git a/src/Sentry/ScopeExtensions.cs b/src/Sentry/ScopeExtensions.cs deleted file mode 100644 index 8e1b8d5d82..0000000000 --- a/src/Sentry/ScopeExtensions.cs +++ /dev/null @@ -1,214 +0,0 @@ -using Sentry.Extensibility; -using Sentry.Internal; -using Sentry.Internal.Extensions; - -namespace Sentry; - -/// -/// Scope extensions. -/// -[EditorBrowsable(EditorBrowsableState.Never)] -public static class ScopeExtensions -{ - /// - /// Invokes all event processor providers available. - /// - /// The Scope which holds the processor providers. - public static IEnumerable GetAllEventProcessors(this Scope scope) - { - foreach (var processor in scope.Options.GetAllEventProcessors()) - { - yield return processor; - } - - foreach (var processor in scope.EventProcessors) - { - yield return processor; - } - } - - /// - /// Invokes all transaction processor providers available. - /// - /// The Scope which holds the processor providers. - public static IEnumerable GetAllTransactionProcessors(this Scope scope) - { - foreach (var processor in scope.Options.GetAllTransactionProcessors()) - { - yield return processor; - } - - foreach (var processor in scope.TransactionProcessors) - { - yield return processor; - } - } - - /// - /// Invokes all exception processor providers available. - /// - /// The Scope which holds the processor providers. - public static IEnumerable GetAllExceptionProcessors(this Scope scope) - { - foreach (var processor in scope.Options.GetAllExceptionProcessors()) - { - yield return processor; - } - - foreach (var processor in scope.ExceptionProcessors) - { - yield return processor; - } - } - - /// - /// Add an exception processor. - /// - /// The Scope to hold the processor. - /// The exception processor. - public static void AddExceptionProcessor(this Scope scope, ISentryEventExceptionProcessor processor) - => scope.ExceptionProcessors.Add(processor); - - /// - /// Add the exception processors. - /// - /// The Scope to hold the processor. - /// The exception processors. - public static void AddExceptionProcessors(this Scope scope, IEnumerable processors) - { - foreach (var processor in processors) - { - scope.ExceptionProcessors.Add(processor); - } - } - - /// - /// Adds an event processor which is invoked when creating a . - /// - /// The Scope to hold the processor. - /// The event processor. - public static void AddEventProcessor(this Scope scope, ISentryEventProcessor processor) - => scope.EventProcessors.Add(processor); - - /// - /// Adds an event processor which is invoked when creating a . - /// - /// The Scope to hold the processor. - /// The event processor. - public static void AddEventProcessor(this Scope scope, Func processor) - => scope.AddEventProcessor(new DelegateEventProcessor(processor)); - - /// - /// Adds event processors which are invoked when creating a . - /// - /// The Scope to hold the processor. - /// The event processors. - public static void AddEventProcessors(this Scope scope, IEnumerable processors) - { - foreach (var processor in processors) - { - scope.EventProcessors.Add(processor); - } - } - - /// - /// Adds an transaction processor which is invoked when creating a . - /// - /// The Scope to hold the processor. - /// The transaction processor. - public static void AddTransactionProcessor(this Scope scope, ISentryTransactionProcessor processor) - => scope.TransactionProcessors.Add(processor); - - /// - /// Adds an transaction processor which is invoked when creating a . - /// - /// The Scope to hold the processor. - /// The transaction processor. - public static void AddTransactionProcessor(this Scope scope, Func processor) - => scope.AddTransactionProcessor(new DelegateTransactionProcessor(processor)); - - /// - /// Adds transaction processors which are invoked when creating a . - /// - /// The Scope to hold the processor. - /// The transaction processors. - public static void AddTransactionProcessors(this Scope scope, IEnumerable processors) - { - foreach (var processor in processors) - { - scope.TransactionProcessors.Add(processor); - } - } - - /// - /// Adds an attachment. - /// - /// - /// Note: the stream must be seekable. - /// - public static void AddAttachment( - this Scope scope, - Stream stream, - string fileName, - AttachmentType type = AttachmentType.Default, - string? contentType = null) - { - var length = stream.TryGetLength(); - if (length is null) - { - scope.Options.LogWarning( - "Cannot evaluate the size of attachment '{0}' because the stream is not seekable.", - fileName); - - return; - } - - // TODO: Envelope spec allows the last item to not have a length. - // So if we make sure there's only 1 item without length, we can support it. - scope.AddAttachment( - new SentryAttachment( - type, - new StreamAttachmentContent(stream), - fileName, - contentType)); - } - - /// - /// Adds an attachment. - /// - public static void AddAttachment( - this Scope scope, - byte[] data, - string fileName, - AttachmentType type = AttachmentType.Default, - string? contentType = null) => - scope.AddAttachment( - new SentryAttachment( - type, - new ByteAttachmentContent(data), - fileName, - contentType)); - - /// - /// Adds an attachment. - /// - public static void AddAttachment( - this Scope scope, - string filePath, - AttachmentType type = AttachmentType.Default, - string? contentType = null) => - scope.AddAttachment( - new SentryAttachment( - type, - new FileAttachmentContent(filePath, scope.Options.UseAsyncFileIO), - Path.GetFileName(filePath), - contentType)); - - /// - /// Gets the last opened span. - /// - /// The scope. - /// The last span not finished or null. - internal static ISpan? LastCreatedSpan(this Scope scope) - => scope.Transaction?.Spans.LastOrDefault(s => !s.IsFinished); -} diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt index b4f86a2f48..3f55263723 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.Net4_8.verified.txt @@ -391,8 +391,19 @@ namespace Sentry public string? TransactionName { get; set; } public Sentry.SentryUser User { get; set; } public void AddAttachment(Sentry.SentryAttachment attachment) { } + public void AddAttachment(string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint hint) { } + public void AddEventProcessor(Sentry.Extensibility.ISentryEventProcessor processor) { } + public void AddEventProcessor(System.Func processor) { } + public void AddEventProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddExceptionProcessor(Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } + public void AddExceptionProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddTransactionProcessor(Sentry.Extensibility.ISentryTransactionProcessor processor) { } + public void AddTransactionProcessor(System.Func processor) { } + public void AddTransactionProcessors(System.Collections.Generic.IEnumerable processors) { } public void Apply(Sentry.IEventLike other) { } public void Apply(Sentry.Scope other) { } public void Apply(object state) { } @@ -400,27 +411,13 @@ namespace Sentry public void ClearAttachments() { } public void ClearBreadcrumbs() { } public Sentry.Scope Clone() { } + public System.Collections.Generic.IEnumerable GetAllEventProcessors() { } + public System.Collections.Generic.IEnumerable GetAllExceptionProcessors() { } + public System.Collections.Generic.IEnumerable GetAllTransactionProcessors() { } public void SetExtra(string key, object? value) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } } - public static class ScopeExtensions - { - public static void AddAttachment(this Sentry.Scope scope, string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddEventProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventProcessor processor) { } - public static void AddEventProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddEventProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddExceptionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } - public static void AddExceptionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryTransactionProcessor processor) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddTransactionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static System.Collections.Generic.IEnumerable GetAllEventProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllExceptionProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllTransactionProcessors(this Sentry.Scope scope) { } - } public sealed class SdkVersion : Sentry.ISentryJsonSerializable { public SdkVersion() { } diff --git a/test/Sentry.Tests/Protocol/ScopeExtensionsTests.cs b/test/Sentry.Tests/Protocol/ScopeTests.cs similarity index 100% rename from test/Sentry.Tests/Protocol/ScopeExtensionsTests.cs rename to test/Sentry.Tests/Protocol/ScopeTests.cs From 5721b4652e8465755d2ca7052a1355d3b5180825 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Fri, 1 Mar 2024 14:36:25 +0100 Subject: [PATCH 2/3] chore: update changelog --- CHANGELOG.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92cffb4275..13f2d9d5cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Added Crons support via `SentrySdk.CaptureCheckIn` and an integration with Hangfire ([#3128](https://github.com/getsentry/sentry-dotnet/pull/3128)) +### API changes + +- Removed `ScopeExtensions` class - all the public methods moved directly to `Scope` ([#3186](https://github.com/getsentry/sentry-dotnet/pull/3186)) + ### Fixes - Empty strings are used instead of underscores to replace invalid metric tag values ([#3176](https://github.com/getsentry/sentry-dotnet/pull/3176)) @@ -49,14 +53,14 @@ ### Fixes -- To resolve conflicting types due to the SDK adding itself to the global usings: +- To resolve conflicting types due to the SDK adding itself to the global usings: - The class `Sentry.Constants` has been renamed to `Sentry.SentryConstants` ([#3125](https://github.com/getsentry/sentry-dotnet/pull/3125)) ## 4.0.2 ### Fixes -- To resolve conflicting types due to the SDK adding itself to the global usings: +- To resolve conflicting types due to the SDK adding itself to the global usings: - The class `Sentry.Context` has been renamed to `Sentry.SentryContext` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121)) - The class `Sentry.Package` has been renamed to `Sentry.SentryPackage` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121)) - The class `Sentry.Request` has been renamed to `Sentry.SentryRequest` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121)) @@ -69,9 +73,9 @@ ## 4.0.1 -### Fixes +### Fixes -- To resolve conflicting types due to the SDK adding itself to the global usings: +- To resolve conflicting types due to the SDK adding itself to the global usings: - The interface `Sentry.ISession` has been renamed to `Sentry.ISentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110)) - The interface `Sentry.IJsonSerializable` has been renamed to `Sentry.ISentryJsonSerializable` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116)) - The class `Sentry.Session` has been renamed to `Sentry.SentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110)) @@ -113,7 +117,7 @@ We're dropping support for some of the old target frameworks, please check this ### Sentry Self-hosted Compatibility If you're using `sentry.io` this change does not affect you. -This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or higher. If you are using an older version of [self-hosted Sentry](https://develop.sentry.dev/self-hosted/) (aka on-premise), you will need to [upgrade](https://develop.sentry.dev/self-hosted/releases/). +This SDK version is compatible with a self-hosted version of Sentry `22.12.0` or higher. If you are using an older version of [self-hosted Sentry](https://develop.sentry.dev/self-hosted/) (aka on-premise), you will need to [upgrade](https://develop.sentry.dev/self-hosted/releases/). ### Significant change in behavior @@ -127,7 +131,7 @@ If you have conflicts, you can opt out by adding the following to your `csproj`: false ``` -- Transactions' spans are no longer automatically finished with the status `deadline_exceeded` by the transaction. This is now handled by the [Relay](https://github.com/getsentry/relay). +- Transactions' spans are no longer automatically finished with the status `deadline_exceeded` by the transaction. This is now handled by the [Relay](https://github.com/getsentry/relay). - Customers self hosting Sentry must use verion 22.12.0 or later ([#3013](https://github.com/getsentry/sentry-dotnet/pull/3013)) - The `User.IpAddress` is now set to `{{auto}}` by default, even when sendDefaultPII is disabled ([#2981](https://github.com/getsentry/sentry-dotnet/pull/2981)) - The "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io can be used to control this instead From d6d68ee32869e6c606a68c3218a4c2b9ba5770c7 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Tue, 5 Mar 2024 11:43:47 +0100 Subject: [PATCH 3/3] update api tests --- ...piApprovalTests.Run.DotNet6_0.verified.txt | 31 +++++++++---------- ...piApprovalTests.Run.DotNet7_0.verified.txt | 31 +++++++++---------- ...piApprovalTests.Run.DotNet8_0.verified.txt | 31 +++++++++---------- 3 files changed, 42 insertions(+), 51 deletions(-) diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt index 93d092d24d..f0c379d1f4 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet6_0.verified.txt @@ -392,8 +392,19 @@ namespace Sentry public string? TransactionName { get; set; } public Sentry.SentryUser User { get; set; } public void AddAttachment(Sentry.SentryAttachment attachment) { } + public void AddAttachment(string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint hint) { } + public void AddEventProcessor(Sentry.Extensibility.ISentryEventProcessor processor) { } + public void AddEventProcessor(System.Func processor) { } + public void AddEventProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddExceptionProcessor(Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } + public void AddExceptionProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddTransactionProcessor(Sentry.Extensibility.ISentryTransactionProcessor processor) { } + public void AddTransactionProcessor(System.Func processor) { } + public void AddTransactionProcessors(System.Collections.Generic.IEnumerable processors) { } public void Apply(Sentry.IEventLike other) { } public void Apply(Sentry.Scope other) { } public void Apply(object state) { } @@ -401,27 +412,13 @@ namespace Sentry public void ClearAttachments() { } public void ClearBreadcrumbs() { } public Sentry.Scope Clone() { } + public System.Collections.Generic.IEnumerable GetAllEventProcessors() { } + public System.Collections.Generic.IEnumerable GetAllExceptionProcessors() { } + public System.Collections.Generic.IEnumerable GetAllTransactionProcessors() { } public void SetExtra(string key, object? value) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } } - public static class ScopeExtensions - { - public static void AddAttachment(this Sentry.Scope scope, string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddEventProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventProcessor processor) { } - public static void AddEventProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddEventProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddExceptionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } - public static void AddExceptionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryTransactionProcessor processor) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddTransactionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static System.Collections.Generic.IEnumerable GetAllEventProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllExceptionProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllTransactionProcessors(this Sentry.Scope scope) { } - } public sealed class SdkVersion : Sentry.ISentryJsonSerializable { public SdkVersion() { } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt index 93d092d24d..f0c379d1f4 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet7_0.verified.txt @@ -392,8 +392,19 @@ namespace Sentry public string? TransactionName { get; set; } public Sentry.SentryUser User { get; set; } public void AddAttachment(Sentry.SentryAttachment attachment) { } + public void AddAttachment(string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint hint) { } + public void AddEventProcessor(Sentry.Extensibility.ISentryEventProcessor processor) { } + public void AddEventProcessor(System.Func processor) { } + public void AddEventProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddExceptionProcessor(Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } + public void AddExceptionProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddTransactionProcessor(Sentry.Extensibility.ISentryTransactionProcessor processor) { } + public void AddTransactionProcessor(System.Func processor) { } + public void AddTransactionProcessors(System.Collections.Generic.IEnumerable processors) { } public void Apply(Sentry.IEventLike other) { } public void Apply(Sentry.Scope other) { } public void Apply(object state) { } @@ -401,27 +412,13 @@ namespace Sentry public void ClearAttachments() { } public void ClearBreadcrumbs() { } public Sentry.Scope Clone() { } + public System.Collections.Generic.IEnumerable GetAllEventProcessors() { } + public System.Collections.Generic.IEnumerable GetAllExceptionProcessors() { } + public System.Collections.Generic.IEnumerable GetAllTransactionProcessors() { } public void SetExtra(string key, object? value) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } } - public static class ScopeExtensions - { - public static void AddAttachment(this Sentry.Scope scope, string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddEventProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventProcessor processor) { } - public static void AddEventProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddEventProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddExceptionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } - public static void AddExceptionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryTransactionProcessor processor) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddTransactionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static System.Collections.Generic.IEnumerable GetAllEventProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllExceptionProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllTransactionProcessors(this Sentry.Scope scope) { } - } public sealed class SdkVersion : Sentry.ISentryJsonSerializable { public SdkVersion() { } diff --git a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet8_0.verified.txt b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet8_0.verified.txt index d3ade57485..1b6c1c9ae0 100644 --- a/test/Sentry.Tests/ApiApprovalTests.Run.DotNet8_0.verified.txt +++ b/test/Sentry.Tests/ApiApprovalTests.Run.DotNet8_0.verified.txt @@ -393,8 +393,19 @@ namespace Sentry public string? TransactionName { get; set; } public Sentry.SentryUser User { get; set; } public void AddAttachment(Sentry.SentryAttachment attachment) { } + public void AddAttachment(string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } + public void AddAttachment(System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb) { } public void AddBreadcrumb(Sentry.Breadcrumb breadcrumb, Sentry.SentryHint hint) { } + public void AddEventProcessor(Sentry.Extensibility.ISentryEventProcessor processor) { } + public void AddEventProcessor(System.Func processor) { } + public void AddEventProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddExceptionProcessor(Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } + public void AddExceptionProcessors(System.Collections.Generic.IEnumerable processors) { } + public void AddTransactionProcessor(Sentry.Extensibility.ISentryTransactionProcessor processor) { } + public void AddTransactionProcessor(System.Func processor) { } + public void AddTransactionProcessors(System.Collections.Generic.IEnumerable processors) { } public void Apply(Sentry.IEventLike other) { } public void Apply(Sentry.Scope other) { } public void Apply(object state) { } @@ -402,27 +413,13 @@ namespace Sentry public void ClearAttachments() { } public void ClearBreadcrumbs() { } public Sentry.Scope Clone() { } + public System.Collections.Generic.IEnumerable GetAllEventProcessors() { } + public System.Collections.Generic.IEnumerable GetAllExceptionProcessors() { } + public System.Collections.Generic.IEnumerable GetAllTransactionProcessors() { } public void SetExtra(string key, object? value) { } public void SetTag(string key, string value) { } public void UnsetTag(string key) { } } - public static class ScopeExtensions - { - public static void AddAttachment(this Sentry.Scope scope, string filePath, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, byte[] data, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddAttachment(this Sentry.Scope scope, System.IO.Stream stream, string fileName, Sentry.AttachmentType type = 0, string? contentType = null) { } - public static void AddEventProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventProcessor processor) { } - public static void AddEventProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddEventProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddExceptionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryEventExceptionProcessor processor) { } - public static void AddExceptionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, Sentry.Extensibility.ISentryTransactionProcessor processor) { } - public static void AddTransactionProcessor(this Sentry.Scope scope, System.Func processor) { } - public static void AddTransactionProcessors(this Sentry.Scope scope, System.Collections.Generic.IEnumerable processors) { } - public static System.Collections.Generic.IEnumerable GetAllEventProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllExceptionProcessors(this Sentry.Scope scope) { } - public static System.Collections.Generic.IEnumerable GetAllTransactionProcessors(this Sentry.Scope scope) { } - } public sealed class SdkVersion : Sentry.ISentryJsonSerializable { public SdkVersion() { }