getsentry / getsentry/sentry-dotnet

Make Scope.Environment non nullable (next major)

Open Beginner friendly
#5,388 1 comment 0 reactions 0 assignees View on GitHub
.NET Breaking Change Improvement Next Major
Dominant language
C#
Stars
770
Forks
248
Avg merge
2d 22h
Merged PRs (30d)
51

Description

As of #5365, Scope.Environment can't be null:
https://github.com/getsentry/sentry-dotnet/blob/b7dd7fbabf138ed86e3d96e7a1744fe9e9d98832/src/Sentry/Scope.cs#L158-L162

We may as well reflect that in the property declaration (which is currently `string?`).

> [!NOTE]
> Breaking change so will need to wait till next major

Contributor guide

Open the contributing guide

Research direction

Open src/Sentry/Scope.cs around the Environment property and compare its current declaration with the non-null behavior introduced by #5365. Update the nullable annotation for the next major release, then run the relevant project checks to confirm the SDK still builds cleanly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Refactor
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.