Skip to content

Commit 6274944

Browse files
authored
fix: Renamed Constants (#3125)
* renamed constants * verify * Updated CHANGELOG.md
1 parent aaf69bb commit 6274944

23 files changed

+76
-69
lines changed

CHANGELOG.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- To resolve conflicting types due to the SDK adding itself to the global usings:
8+
- The class `Sentry.Constants` has been renamed to `Sentry.SentryConstants` ([#3125](https://github.com/getsentry/sentry-dotnet/pull/3125))
9+
310
## 4.0.2
411

512
### Fixes
613

714
- To resolve conflicting types due to the SDK adding itself to the global usings:
8-
- The class `Sentry.Context` has been renamed to `Sentry.SentryContext` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
9-
- The class `Sentry.Package` has been renamed to `Sentry.SentryPackage` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
10-
- The class `Sentry.Request` has been renamed to `Sentry.SentryRequest` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
15+
- The class `Sentry.Context` has been renamed to `Sentry.SentryContext` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
16+
- The class `Sentry.Package` has been renamed to `Sentry.SentryPackage` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
17+
- The class `Sentry.Request` has been renamed to `Sentry.SentryRequest` ([#3121](https://github.com/getsentry/sentry-dotnet/pull/3121))
1118

1219
### Dependencies
1320

@@ -20,11 +27,11 @@
2027
### Fixes
2128

2229
- To resolve conflicting types due to the SDK adding itself to the global usings:
23-
- The interface `Sentry.ISession` has been renamed to `Sentry.ISentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
24-
- The interface `Sentry.IJsonSerializable` has been renamed to `Sentry.ISentryJsonSerializable` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
25-
- The class `Sentry.Session` has been renamed to `Sentry.SentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
26-
- The class `Sentry.Attachment` has been renamed to `Sentry.SentryAttachment` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
27-
- The class `Sentry.Hint` has been renamed to `Sentry.SentryHint` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
30+
- The interface `Sentry.ISession` has been renamed to `Sentry.ISentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
31+
- The interface `Sentry.IJsonSerializable` has been renamed to `Sentry.ISentryJsonSerializable` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
32+
- The class `Sentry.Session` has been renamed to `Sentry.SentrySession` ([#3110](https://github.com/getsentry/sentry-dotnet/pull/3110))
33+
- The class `Sentry.Attachment` has been renamed to `Sentry.SentryAttachment` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
34+
- The class `Sentry.Hint` has been renamed to `Sentry.SentryHint` ([#3116](https://github.com/getsentry/sentry-dotnet/pull/3116))
2835

2936
### Dependencies
3037

src/Sentry/Dsn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private Dsn(
6161
public override string ToString() => Source;
6262

6363
public static bool IsDisabled(string? dsn) =>
64-
Constants.DisableSdkDsnValue.Equals(dsn, StringComparison.OrdinalIgnoreCase);
64+
SentryConstants.DisableSdkDsnValue.Equals(dsn, StringComparison.OrdinalIgnoreCase);
6565

6666
public static Dsn Parse(string dsn)
6767
{

src/Sentry/Protocol/ProfileInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public SentryContexts Contexts
3030

3131
public string? Environment { get; set; }
3232

33-
public string? Platform { get; set; } = Constants.Platform;
33+
public string? Platform { get; set; } = SentryConstants.Platform;
3434

3535
public string? Release { get; set; }
3636

src/Sentry/Constants.cs renamed to src/Sentry/SentryConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Sentry;
33
/// <summary>
44
/// Constant values.
55
/// </summary>
6-
public static class Constants
6+
public static class SentryConstants
77
{
88
/// <summary>
99
/// Empty string disables the SDK.

src/Sentry/SentryEvent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ internal SentryEvent(
222222
Exception = exception;
223223
Timestamp = timestamp ?? DateTimeOffset.UtcNow;
224224
EventId = eventId != default ? eventId : SentryId.Create();
225-
Platform = Constants.Platform;
225+
Platform = SentryConstants.Platform;
226226
}
227227

228228
/// <inheritdoc />

src/Sentry/SentryOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using Sentry.Internal.Http;
77
using Sentry.Internal.ScopeStack;
88
using Sentry.PlatformAbstractions;
9-
using static Sentry.Constants;
9+
using static Sentry.SentryConstants;
1010

1111
#if HAS_DIAGNOSTIC_INTEGRATION
1212
using Sentry.Internal.DiagnosticSource;

src/Sentry/SentryTransaction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public SentryId TraceId
5454
public bool? IsParentSampled { get; set; }
5555

5656
/// <inheritdoc />
57-
public string? Platform { get; set; } = Constants.Platform;
57+
public string? Platform { get; set; } = SentryConstants.Platform;
5858

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

src/Sentry/TransactionTracer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public SentryId TraceId
5050
public bool? IsParentSampled { get; set; }
5151

5252
/// <inheritdoc />
53-
public string? Platform { get; set; } = Constants.Platform;
53+
public string? Platform { get; set; } = SentryConstants.Platform;
5454

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

test/Sentry.AspNetCore.Tests/AspNetCoreSentryWebHostBuilder.IntegrationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void UseSentry_NoDsnProvided_ThrowsException()
3535
[Fact]
3636
public void UseSentry_DisableDsnString_DisabledSdk()
3737
{
38-
_ = _webHostBuilder.UseSentry(Sentry.Constants.DisableSdkDsnValue)
38+
_ = _webHostBuilder.UseSentry(Sentry.SentryConstants.DisableSdkDsnValue)
3939
.Build();
4040

4141
Assert.False(SentrySdk.IsEnabled);

test/Sentry.AspNetCore.Tests/SentryTracingBuilderTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public void UseRouting_AutoRegisterTracingDisabled_SentryTracingNotRegistered()
4747
_fixture.Configure = applicationBuilder => applicationBuilder.UseRouting();
4848
_fixture.ConfigureOptions = options =>
4949
{
50-
options.Dsn = Sentry.Constants.DisableSdkDsnValue;
50+
options.Dsn = Sentry.SentryConstants.DisableSdkDsnValue;
5151
options.AutoRegisterTracing = false;
5252
};
5353

@@ -66,7 +66,7 @@ public void UseRouting_OtelInstrumentation_SentryTracingNotRegistered()
6666
_fixture.Configure = applicationBuilder => applicationBuilder.UseRouting();
6767
_fixture.ConfigureOptions = options =>
6868
{
69-
options.Dsn = Sentry.Constants.DisableSdkDsnValue;
69+
options.Dsn = Sentry.SentryConstants.DisableSdkDsnValue;
7070
options.Instrumenter = Instrumenter.OpenTelemetry;
7171
};
7272

@@ -92,7 +92,7 @@ public void UseRouting_SentryTracingRegisteredWithoutWarning()
9292
_fixture.Configure = applicationBuilder => applicationBuilder.UseRouting();
9393
_fixture.ConfigureOptions = options =>
9494
{
95-
options.Dsn = Sentry.Constants.DisableSdkDsnValue;
95+
options.Dsn = Sentry.SentryConstants.DisableSdkDsnValue;
9696
};
9797

9898
// Act
@@ -121,7 +121,7 @@ public void UseSentryTracing_AutoRegisterTracing_Warning()
121121
};
122122
_fixture.ConfigureOptions = options =>
123123
{
124-
options.Dsn = Sentry.Constants.DisableSdkDsnValue;
124+
options.Dsn = Sentry.SentryConstants.DisableSdkDsnValue;
125125
};
126126

127127
// Act

0 commit comments

Comments
 (0)