[Infra] Fix new code analysis warnings#7098
Merged
martincostello merged 1 commit intoopen-telemetry:mainfrom Apr 16, 2026
Merged
[Infra] Fix new code analysis warnings#7098martincostello merged 1 commit intoopen-telemetry:mainfrom
martincostello merged 1 commit intoopen-telemetry:mainfrom
Conversation
Cherry-pick fixes for new code analysis warnings identified by the .NET 11 preview 3 SDK in open-telemetry#6899.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7098 +/- ##
==========================================
- Coverage 88.79% 88.73% -0.07%
==========================================
Files 270 270
Lines 12928 12927 -1
==========================================
- Hits 11480 11471 -9
- Misses 1448 1456 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Cherry-picks small code tweaks to address new .NET 11 preview 3 SDK code analysis warnings across tests, benchmarks, and a few internal/runtime components.
Changes:
- Updates test/benchmark code to satisfy newer analyzer expectations (e.g., collection expressions, local function formatting).
- Adjusts a unit test timeout pattern using
WaitAsyncon modern TFMs while keeping compatibility for older targets. - Makes minor internal code cleanups (e.g., switch exhaustiveness, thread naming, null-forgiveness removal).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/OpenTelemetry.Tests/Logs/BatchLogRecordExportProcessorTests.cs | Uses collection expressions for list initialization in tests. |
| test/OpenTelemetry.Tests/Internal/InterlockedHelperTests.cs | Refines timeout handling to avoid hangs and align with newer analyzers across TFMs. |
| test/Benchmarks/Context/Propagation/BaggagePropagatorBenchmarks.cs | Rewrites a local function body to satisfy updated analyzer/style expectations. |
| src/OpenTelemetry/Internal/PeriodicExportingMetricReaderThreadWorker.cs | Adds an explicit default switch case for analyzer satisfaction (no functional change). |
| src/OpenTelemetry/Internal/BatchExportThreadWorker.cs | Adjusts nameof usage in thread naming to avoid generic-type analyzer warnings. |
| src/OpenTelemetry.Extensions.Propagators/JaegerPropagator.cs | Removes redundant null-forgiveness/conditional compilation around a non-nullable parameter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Kielek
approved these changes
Apr 16, 2026
Merged
via the queue into
open-telemetry:main
with commit Apr 16, 2026
1f3582a
124 of 126 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Cherry-pick fixes for new code analysis warnings identified by the .NET 11 preview 3 SDK in #6899.
Merge requirement checklist
AppropriateCHANGELOG.mdfiles updated for non-trivial changesChanges in public API reviewed (if applicable)