Skip to content

[Infra] Fix new code analysis warnings#4379

Merged
Kielek merged 1 commit into
open-telemetry:mainfrom
martincostello:dotnet-11-prep
May 18, 2026
Merged

[Infra] Fix new code analysis warnings#4379
Kielek merged 1 commit into
open-telemetry:mainfrom
martincostello:dotnet-11-prep

Conversation

@martincostello

Copy link
Copy Markdown
Member

Changes

Fix new code analysis warnings raised when using the .NET 11 SDK in #3867.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Fix new code analysis warnings raised when using the .NET 11 SDK.
@github-actions github-actions Bot added comp:instrumentation.eventcounters Things related to OpenTelemetry.Instrumentation.EventCounters comp:opamp.client Things related to OpenTelemetry.OpAmp.Client labels May 12, 2026
@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.62%. Comparing base (d08b817) to head (d354e42).
⚠️ Report is 19 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4379      +/-   ##
==========================================
- Coverage   75.65%   75.62%   -0.03%     
==========================================
  Files         456      456              
  Lines       18246    18246              
==========================================
- Hits        13804    13799       -5     
- Misses       4442     4447       +5     
Flag Coverage Δ
unittests-Instrumentation.EventCounters 77.67% <ø> (ø)
unittests-OpAmp.Client 83.95% <ø> (-0.52%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martincostello martincostello marked this pull request as ready for review May 12, 2026 09:09
@martincostello martincostello requested a review from a team as a code owner May 12, 2026 09:09
Copilot AI review requested due to automatic review settings May 12, 2026 09:09
@martincostello martincostello enabled auto-merge May 12, 2026 09:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses new C#/.NET code analysis warnings introduced when building the repository with the .NET 11 SDK (per #3867), by making small, analyzer-friendly updates in affected unit tests.

Changes:

  • Refactor exception-type checks in WsTransportTest to use modern pattern matching (is ... or ...) instead of chained ||.
  • Remove an unnecessary async modifier from a test method that contains no await, eliminating “async method lacks await” warnings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/OpenTelemetry.OpAmp.Client.Tests/WsTransportTest.cs Updates exception assertions to use is null or ... pattern matching to satisfy analyzers.
test/OpenTelemetry.Instrumentation.EventCounters.Tests/EventCountersMetricsTests.cs Removes async from a test that performs no awaits to avoid analyzer warnings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@martincostello martincostello added the keep-open Prevents issues and pull requests being closed as stale label May 15, 2026
@martincostello martincostello added this pull request to the merge queue May 18, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 18, 2026
@Kielek Kielek added this pull request to the merge queue May 18, 2026
Merged via the queue into open-telemetry:main with commit d836525 May 18, 2026
79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.eventcounters Things related to OpenTelemetry.Instrumentation.EventCounters comp:opamp.client Things related to OpenTelemetry.OpAmp.Client keep-open Prevents issues and pull requests being closed as stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants