Skip to content
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

Removed Scope.Platform as it would never be applied. #2695

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ API Changes:
- Change `StackFrame`'s `ImageAddress`, `InstructionAddress` and `FunctionId` to `long?`. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691))
- Enable `CaptureFailedRequests` by default ([2688](https://github.com/getsentry/sentry-dotnet/pull/2688))
- Additional constructors removed from `TransactionTracer`. ([#2694](https://github.com/getsentry/sentry-dotnet/pull/2694))
- Removed the `Scope.Platform` property as it was never applied ([#2695](https://github.com/getsentry/sentry-dotnet/pull/2695))

## Unreleased

Expand Down
10 changes: 0 additions & 10 deletions src/Sentry/IEventLike.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,6 @@ public interface IEventLike : IHasTags, IHasExtra
/// </value>
User User { get; set; }

/// <summary>
/// The name of the platform.
/// </summary>
/// <remarks>
/// In most cases, the platform will be "csharp". However, it may differ if the event
/// was generated from another embeded SDK. For example, when targeting net6.0-android,
/// events generated by the Sentry Android SDK will have the platform "java".
/// </remarks>
public string? Platform { get; set; }

/// <summary>
/// The release version of the application.
/// </summary>
Expand Down
9 changes: 9 additions & 0 deletions src/Sentry/ITransactionData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,13 @@ namespace Sentry;
/// </summary>
public interface ITransactionData : ISpanData, ITransactionContext, IEventLike
{
/// <summary>
/// The name of the platform.
/// </summary>
/// <remarks>
/// In most cases, the platform will be "csharp". However, it may differ if the event
/// was generated from another embeded SDK. For example, when targeting net6.0-android,
/// events generated by the Sentry Android SDK will have the platform "java".
/// </remarks>
public string? Platform { get; set; }
}
3 changes: 0 additions & 3 deletions src/Sentry/Internal/Enricher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ public void Apply(IEventLike eventLike)
eventLike.Sdk.AddPackage("nuget:" + SdkVersion.Instance.Name, SdkVersion.Instance.Version);
}

// Platform
eventLike.Platform ??= Sentry.Constants.Platform;

// Release
eventLike.Release ??= _options.SettingLocator.GetRelease();

Expand Down
5 changes: 0 additions & 5 deletions src/Sentry/Scope.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@ public User User
}
}

/// <inheritdoc />
public string? Platform { get; set; }

/// <inheritdoc />
public string? Release { get; set; }

Expand Down Expand Up @@ -345,7 +342,6 @@ public void Clear()
Request = new();
Contexts.Clear();
User = new();
Platform = default;
Release = default;
Distribution = default;
Environment = default;
Expand Down Expand Up @@ -435,7 +431,6 @@ public void Apply(IEventLike other)
Request.CopyTo(other.Request);
User.CopyTo(other.User);

other.Platform ??= Platform;
other.Release ??= Release;
other.Distribution ??= Distribution;
other.Environment ??= Environment;
Expand Down
2 changes: 0 additions & 2 deletions test/Sentry.Tests/ScopeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,6 @@ public static void ApplyFakeValues(this Scope scope, string salt = "fake")
scope.Request = new() { Data = $"{salt} request" };
scope.Contexts.Add($"{salt} context", "{}");
scope.User = new User() { Username = $"{salt} username" };
scope.Platform = $"{salt} platform";
scope.Release = $"{salt} release";
scope.Distribution = $"{salt} distribution";
scope.Environment = $"{salt} environment";
Expand All @@ -643,7 +642,6 @@ public static void ShouldBeEquivalentTo(this Scope source, Scope target)
source.Request.Should().BeEquivalentTo(target.Request);
source.Contexts.Should().BeEquivalentTo(target.Contexts);
source.User.Should().BeEquivalentTo(target.User);
source.Platform.Should().Be(target.Platform);
source.Release.Should().Be(target.Release);
source.Distribution.Should().Be(target.Distribution);
source.Environment.Should().Be(target.Environment);
Expand Down