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

chore: Bump .NET SDK 4.1.2 #1488

Merged
merged 44 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
de48616
big bump
bitsandfoxes Nov 9, 2023
e935d27
more stuff
bitsandfoxes Nov 13, 2023
f811e21
bump
bitsandfoxes Nov 22, 2023
56c178c
merged main
bitsandfoxes Dec 1, 2023
9222cd7
no tracer
bitsandfoxes Dec 4, 2023
8bb4d7e
hub update
bitsandfoxes Dec 4, 2023
85244d9
whoopsie
bitsandfoxes Dec 4, 2023
f05889c
ClientMessageHandler
bitsandfoxes Dec 4, 2023
e1e309e
fixed context dictionary
bitsandfoxes Dec 4, 2023
15e1304
Format code
getsentry-bot Dec 4, 2023
4403396
Merge branch 'main' into chore/dotnet-4.0.0
bitsandfoxes Dec 15, 2023
e144a15
Merge branch 'chore/dotnet-4.0.0' of https://github.com/getsentry/sen…
bitsandfoxes Dec 15, 2023
ee6aff5
fix
bitsandfoxes Dec 28, 2023
9e39d73
merged
bitsandfoxes Dec 28, 2023
c43a51b
fix il2cpp
bitsandfoxes Dec 28, 2023
e89e9a4
making the il2cpp processor work again
bitsandfoxes Dec 28, 2023
6699a8e
cleanup
bitsandfoxes Dec 28, 2023
378429e
getting rid of casting
bitsandfoxes Dec 28, 2023
284b0f2
fixed address conversion
bitsandfoxes Jan 2, 2024
96828a9
fixed test
bitsandfoxes Jan 2, 2024
f48b591
Merge branch 'main' into chore/dotnet-4.0.0
bitsandfoxes Jan 2, 2024
25a65ff
bumped .NET
bitsandfoxes Jan 2, 2024
0f6e8b4
merged
bitsandfoxes Feb 5, 2024
502a3bc
bumped to 4.0.0
bitsandfoxes Feb 5, 2024
2e1c3d7
fixed breaking types
bitsandfoxes Feb 5, 2024
5f3b922
there too
bitsandfoxes Feb 5, 2024
91d0dfb
forgot the tests
bitsandfoxes Feb 5, 2024
58114c0
Updated CHANGELOG.md
bitsandfoxes Feb 5, 2024
2d383a5
Updated CHANGELOG.md
bitsandfoxes Feb 5, 2024
c24d6a0
bump to 4.0.1
bitsandfoxes Feb 6, 2024
326c92b
.net b ump
bitsandfoxes Feb 12, 2024
3aa37f9
fixed bump
bitsandfoxes Feb 12, 2024
e4e22fa
pwsh missing?
bitsandfoxes Feb 12, 2024
e76f071
escape the quotation?
bitsandfoxes Feb 12, 2024
5a4c575
gib version
bitsandfoxes Feb 12, 2024
6d5768a
free bad?
bitsandfoxes Feb 12, 2024
4a454cf
keep large packages because of pwsh
bitsandfoxes Feb 12, 2024
c95bc25
fixed smoke test
bitsandfoxes Feb 12, 2024
9989f66
Merge branch 'main' into chore/dotnet-4.0.0
bitsandfoxes Feb 13, 2024
86488d4
Updated CHANGELOG.md
bitsandfoxes Feb 13, 2024
2c5b4ea
bumped to 4.1.1
bitsandfoxes Feb 19, 2024
5289e6e
bump to 4.1.2
bitsandfoxes Feb 21, 2024
3cc8b18
Merge branch 'main' into chore/dotnet-4.0.0
bitsandfoxes Feb 21, 2024
05f648c
Update CHANGELOG.md
bitsandfoxes Feb 21, 2024
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
104 changes: 104 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,112 @@

## Unreleased

This major release is based on the .NET 4.0 release and includes features like [Metrics](https://docs.sentry.io/platforms/dotnet/metrics/)(preview) and [Spotlight](https://spotlightjs.com/).

### Significant change in behavior

- 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
- The `DiagnosticLogger` signature for `LogWarning` changed to take the `exception` as the first parameter. That way it no longer gets mixed up with the TArgs. ([#2987](https://github.com/getsentry/sentry-dotnet/pull/2987))

### API breaking Changes

If you have compilation errors you can find the affected types or overloads missing in the changelog entries below.

#### Changed APIs

- Class renamed from `Sentry.Attachment` to `Sentry.SentryAttachment` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
- Class renamed from `Sentry.Constants` to `Sentry.SentryConstants` ([#3125](https://github.com/getsentry/sentry-dotnet/pull/3125))
- Class renamed from `Sentry.Context` to `Sentry.SentryContext` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
- Class renamed from `Sentry.Hint` to `Sentry.SentryHint` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
- Class renamed from `Sentry.Package` to `Sentry.SentryPackage` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
- Class renamed from `Sentry.Request` to `Sentry.SentryRequest` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
- Class renamed from `Sentry.Runtime` to `Sentry.SentryRuntime` ([#3016](https://github.com/getsentry/sentry-dotnet/pull/3016))
- Class renamed from `Sentry.Session` to `Sentry.SentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
- Class renamed from `Sentry.Span` to `Sentry.SentrySpan` ([#3021](https://github.com/getsentry/sentry-dotnet/pull/3021))
- Class renamed from `Sentry.Transaction` to `Sentry.SentryTransaction` ([#3023](https://github.com/getsentry/sentry-dotnet/pull/3023))
- Class renamed from `Sentry.User` to `Sentry.SentryUser` ([#3015](https://github.com/getsentry/sentry-dotnet/pull/3015))
- Interface renamed from `Sentry.IJsonSerializable` to `Sentry.ISentryJsonSerializable` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
- Interface renamed from `Sentry.ISession` to `Sentry.ISentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
- `SentryClient.Dispose` is no longer obsolete ([#2842](https://github.com/getsentry/sentry-dotnet/pull/2842))
- `ISentryClient.CaptureEvent` overloads have been replaced by a single method accepting optional `Hint` and `Scope` parameters. You will need to pass `hint` as a named parameter from code that calls `CaptureEvent` without passing a `scope` argument. ([#2749](https://github.com/getsentry/sentry-dotnet/pull/2749))
- `ITransaction` has been renamed to `ITransactionTracer`. You will need to update any references to these interfaces in your code to use the new interface names ([#2731](https://github.com/getsentry/sentry-dotnet/pull/2731), [#2870](https://github.com/getsentry/sentry-dotnet/pull/2870))
- `TransactionContext` and `SpanContext` constructors were updated. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. ([#2694](https://github.com/getsentry/sentry-dotnet/pull/2694), [#2696](https://github.com/getsentry/sentry-dotnet/pull/2696))
- The `DiagnosticLogger` signature for `LogError` and `LogFatal` changed to take the `exception` as the first parameter. That way it no longer gets mixed up with the TArgs. The `DiagnosticLogger` now also receives an overload for `LogError` and `LogFatal` that accepts a message only. ([#2715](https://github.com/getsentry/sentry-dotnet/pull/2715))
- `Distribution` added to `IEventLike`. ([#2660](https://github.com/getsentry/sentry-dotnet/pull/2660))
- `StackFrame`'s `ImageAddress`, `InstructionAddress`, and `FunctionId` changed to `long?`. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691))
- `DebugImage` and `DebugMeta` moved to `Sentry.Protocol` namespace. ([#2815](https://github.com/getsentry/sentry-dotnet/pull/2815))
- `DebugImage.ImageAddress` changed to `long?`. ([#2725](https://github.com/getsentry/sentry-dotnet/pull/2725))
- Contexts now inherit from `IDictionary` rather than `ConcurrentDictionary`. The specific dictionary being used is an implementation detail. ([#2729](https://github.com/getsentry/sentry-dotnet/pull/2729))

#### Removed APIs

- SentrySinkExtensions.ConfigureSentrySerilogOptions is now internal. If you were using this method, please use one of the `SentrySinkExtensions.Sentry` extension methods instead. ([#2902](https://github.com/getsentry/sentry-dotnet/pull/2902))
- A number of `[Obsolete]` options have been removed ([#2841](https://github.com/getsentry/sentry-dotnet/pull/2841))
- `BeforeSend` - use `SetBeforeSend` instead.
- `BeforeSendTransaction` - use `SetBeforeSendTransaction` instead.
- `BeforeBreadcrumb` - use `SetBeforeBreadcrumb` instead.
- `CreateHttpClientHandler` - use `CreateHttpMessageHandler` instead.
- `DisableTaskUnobservedTaskExceptionCapture` method has been renamed to `DisableUnobservedTaskExceptionCapture`.
- `DebugDiagnosticLogger` - use `TraceDiagnosticLogger` instead.
- `KeepAggregateException` - this property is no longer used and has no replacement.
- `ReportAssemblies` - use `ReportAssembliesMode` instead.
- Obsolete `SystemClock` constructor removed, use `SystemClock.Clock` instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
- Obsolete `Runtime.Clone()` removed, this shouldn't have been public in the past and has no replacement. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
- Obsolete `SentryException.Data` removed, use `SentryException.Mechanism.Data` instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
- Obsolete `AssemblyExtensions` removed, this shouldn't have been public in the past and has no replacement. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
- Obsolete `SentryDatabaseLogging.UseBreadcrumbs()` removed, it is called automatically and has no replacement. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
- Obsolete `Scope.GetSpan()` removed, use `Span` property instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856))
- Obsolete `IUserFactory` removed, use `ISentryUserFactory` instead. ([#2856](https://github.com/getsentry/sentry-dotnet/pull/2856), [#2840](https://github.com/getsentry/sentry-dotnet/pull/2840))
- `IHasMeasurements` has been removed, use `ISpanData` instead. ([#2659](https://github.com/getsentry/sentry-dotnet/pull/2659))
- `IHasBreadcrumbs` has been removed, use `IEventLike` instead. ([#2670](https://github.com/getsentry/sentry-dotnet/pull/2670))
- `ISpanContext` has been removed, use `ITraceContext` instead. ([#2668](https://github.com/getsentry/sentry-dotnet/pull/2668))
- `IHasTransactionNameSource` has been removed, use `ITransactionContext` instead. ([#2654](https://github.com/getsentry/sentry-dotnet/pull/2654))
- ([#2694](https://github.com/getsentry/sentry-dotnet/pull/2694))
- The unused `StackFrame.InstructionOffset` has been removed. ([#2691](https://github.com/getsentry/sentry-dotnet/pull/2691))
- The unused `Scope.Platform` property has been removed. ([#2695](https://github.com/getsentry/sentry-dotnet/pull/2695))
- The obsolete setter `Sentry.PlatformAbstractions.Runtime.Identifier` has been removed ([2764](https://github.com/getsentry/sentry-dotnet/pull/2764))
- `Sentry.Values<T>` is now internal as it is never exposed in the public API ([#2771](https://github.com/getsentry/sentry-dotnet/pull/2771))
- The `TracePropagationTarget` class has been removed, use the `SubstringOrRegexPattern` class instead. ([#2763](https://github.com/getsentry/sentry-dotnet/pull/2763))
- The `WithScope` and `WithScopeAsync` methods have been removed. We have discovered that these methods didn't work correctly in certain desktop contexts, especially when using a global scope. ([#2717](https://github.com/getsentry/sentry-dotnet/pull/2717))
Replace your usage of `WithScope` with overloads of `Capture*` methods:

- `SentrySdk.CaptureEvent(SentryEvent @event, Action<Scope> scopeCallback)`
- `SentrySdk.CaptureMessage(string message, Action<Scope> scopeCallback)`
- `SentrySdk.CaptureException(Exception exception, Action<Scope> scopeCallback)`

```c#
// Before
SentrySdk.WithScope(scope =>
{
scope.SetTag("key", "value");
SentrySdk.CaptureEvent(new SentryEvent());
});

// After
SentrySdk.CaptureEvent(new SentryEvent(), scope =>
{
// Configure your scope here
scope.SetTag("key", "value");
});
```

### Features

- Experimental pre-release availability of Metrics. We're exploring the use of Metrics in Sentry. The API will very likely change and we don't yet have any documentation. ([#2949](https://github.com/getsentry/sentry-dotnet/pull/2949))
- `SentrySdk.Metrics.Set` now additionally accepts `string` as value ([#3092](https://github.com/getsentry/sentry-dotnet/pull/3092))
- Timing metrics can now be captured with `SentrySdk.Metrics.StartTimer` ([#3075](https://github.com/getsentry/sentry-dotnet/pull/3075))
- Support for [Spotlight](https://spotlightjs.com/), a debug tool for local development. ([#2961](https://github.com/getsentry/sentry-dotnet/pull/2961))
- Enable it with the option `EnableSpotlight`
- Optionally configure the URL to connect via `SpotlightUrl`. Defaults to `http://localhost:8969/stream`.

### Dependencies

- Bump .NET SDK from v3.41.3 to v4.0.0 [#1505](https://github.com/getsentry/sentry-unity/pull/1488)
- [changelog](https://github.com/getsentry/sentry-dotnet/blob/main/CHANGELOG.md#400)
- [diff](https://github.com/getsentry/sentry-dotnet/compare/3.41.3...4.0.0)
- Bump CLI from v2.24.1 to v2.28.6 ([#1534](https://github.com/getsentry/sentry-unity/pull/1534), [#1539](https://github.com/getsentry/sentry-unity/pull/1539), [#1540](https://github.com/getsentry/sentry-unity/pull/1540), [#1542](https://github.com/getsentry/sentry-unity/pull/1542), [#1547](https://github.com/getsentry/sentry-unity/pull/1547), [#1560](https://github.com/getsentry/sentry-unity/pull/1560), [#1562](https://github.com/getsentry/sentry-unity/pull/1562))
- [changelog](https://github.com/getsentry/sentry-cli/blob/master/CHANGELOG.md#2286)
- [diff](https://github.com/getsentry/sentry-cli/compare/2.24.1...2.28.6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public void SetUser()
{
SentrySdk.ConfigureScope(s =>
{
s.User = new User
s.User = new SentryUser
{
Email = "ant@farm.bug",
Username = "ant",
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity.Android/AndroidJavaScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override void UnsetTagImpl(string key)
sentry.CallStatic("removeTag", key);
}

public override void SetUserImpl(User user)
public override void SetUserImpl(SentryUser user)
{
AndroidJNI.AttachCurrentThread();

Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity.Android/SentryNativeAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static void Configure(SentryUnityOptions options, ISentryUnityInfo sentry
catch (Exception e)
{
options.DiagnosticLogger?.LogError(
"Failed to reinstall backend. Captured native crashes will miss scope data and tag.", e);
e, "Failed to reinstall backend. Captured native crashes will miss scope data and tag.");
}

options.NativeSupportCloseCallback = () => Close(options.DiagnosticLogger);
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry.Unity.Editor.iOS/BuildPostProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal static void SetupNoOpBridge(IDiagnosticLogger logger, string pathToProj
}
catch (Exception e)
{
logger.LogError("Failed to add the Sentry NoOp bridge to the output project.", e);
logger.LogError(e, "Failed to add the Sentry NoOp bridge to the output project.");
}
}

Expand Down Expand Up @@ -133,7 +133,7 @@ internal static void SetupSentry(SentryUnityOptions options,
}
catch (Exception e)
{
logger.LogError("Failed to add the Sentry framework to the generated Xcode project", e);
logger.LogError(e, "Failed to add the Sentry framework to the generated Xcode project");
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ internal void AddAndroidSdkDependencies(string gradleProjectPath)
}
catch (Exception e)
{
_logger.LogError($"Failed to {(nativeSupportEnabled ? "add" : "remove")} Android Dependencies in the gradle project", e);
_logger.LogError(e, $"Failed to {(nativeSupportEnabled ? "add" : "remove")} Android Dependencies in the gradle project");
}
}

Expand Down Expand Up @@ -277,7 +277,7 @@ internal void SetupSymbolsUpload(string unityProjectPath, string gradleProjectPa
}
catch (Exception e)
{
_logger.LogError("Failed to add the automatic symbols upload to the gradle project", e);
_logger.LogError(e, "Failed to add the automatic symbols upload to the gradle project");
}
}

Expand All @@ -299,7 +299,7 @@ private void SetupProguard(string gradleProjectPath)
}
catch (Exception e)
{
_logger.LogError($"Failed to {(nativeSupportEnabled ? "add" : "remove")} Proguard rules in the gradle project", e);
_logger.LogError(e, $"Failed to {(nativeSupportEnabled ? "add" : "remove")} Proguard rules in the gradle project");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public void OnPostBuildPlayerScriptDLLs(BuildReport report)
}
catch (Exception e)
{
logger.LogError("Failed to add the performance auto instrumentation. " +
"The assembly has not been modified.", e);
logger.LogError(e, "Failed to add the performance auto instrumentation. " +
"The assembly has not been modified.");
}

stopwatch.Stop();
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity.Editor/Native/BuildPostProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static void OnPostProcessBuild(BuildTarget target, string executablePath)
}
catch (Exception e)
{
logger.LogError("Failed to add the Sentry native integration to the built application", e);
logger.LogError(e, "Failed to add the Sentry native integration to the built application");
throw new BuildFailedException("Sentry Native BuildPostProcess failed");
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity.Native/NativeScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public override void SetExtraImpl(string key, string? value) =>

public override void UnsetTagImpl(string key) => C.sentry_remove_tag(key);

public override void SetUserImpl(User user)
public override void SetUserImpl(SentryUser user)
{
// see https://develop.sentry.dev/sdk/event-payloads/user/
var cUser = C.sentry_value_new_object();
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity.Native/SentryNative.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void Configure(SentryUnityOptions options, ISentryUnityInfo sentry
options.DefaultUserId = AnalyticsSessionInfo.userId;
if (options.DefaultUserId is not null)
{
options.ScopeObserver.SetUser(new User { Id = options.DefaultUserId });
options.ScopeObserver.SetUser(new SentryUser { Id = options.DefaultUserId });
}

// Note: we must actually call the function now and on every other call use the value we get here.
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity.Native/SentryNativeBridge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private static void nativeLogImpl(int cLevel, IntPtr format, IntPtr args, IntPtr
}
catch (Exception err)
{
logger.LogError("Exception in native log forwarder.", err);
logger.LogError(err, "Exception in native log forwarder.");
}

if (message == null)
Expand Down
2 changes: 1 addition & 1 deletion src/Sentry.Unity.iOS/NativeScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public override void SetExtraImpl(string key, string? value) =>

public override void UnsetTagImpl(string key) => SentryCocoaBridgeProxy.SentryNativeBridgeUnsetTag(key);

public override void SetUserImpl(User user) =>
public override void SetUserImpl(SentryUser user) =>
SentryCocoaBridgeProxy.SentryNativeBridgeSetUser(user.Email, user.Id, user.IpAddress, user.Username);

public override void UnsetUserImpl() => SentryCocoaBridgeProxy.SentryNativeBridgeUnsetUser();
Expand Down
7 changes: 6 additions & 1 deletion src/Sentry.Unity/ContextWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ internal abstract class ContextWriter
{
public void Write(Scope scope)
{
var unityContext = (Protocol.Unity)scope.Contexts.GetOrAdd(Protocol.Unity.Type, _ => new Protocol.Unity());
if (!scope.Contexts.TryGetValue(Protocol.Unity.Type, out var getThatUnityContext))
{
getThatUnityContext = new Protocol.Unity();
}
var unityContext = (Protocol.Unity)getThatUnityContext;

WriteScope(
scope.Contexts.App.StartTime?.ToString("o"),
scope.Contexts.App.BuildType,
Expand Down
Loading
Loading