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

Increase use of NotNullWhen polyfill #6090

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

SimonCropp
Copy link
Contributor

Fixes #
Design discussion issue #

Changes

also allows us to remove some redundant ! null suppressions

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)

@SimonCropp SimonCropp requested a review from a team as a code owner January 23, 2025 05:04
@github-actions github-actions bot added pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package labels Jan 23, 2025
@SimonCropp SimonCropp changed the title leverage more NotNullWhen polyfill via an InternalsVIsibleTo Increase use of NotNullWhen polyfill Jan 23, 2025
@TimothyMothra
Copy link
Contributor

LGTM. You have conflicts with main and will need to update your branch

@SimonCropp
Copy link
Contributor Author

conflicts resolved

@@ -13,6 +13,7 @@
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("OpenTelemetry.Extensions.Hosting.Tests" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("OpenTelemetry.Tests" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("OpenTelemetry.Api.Tests" + AssemblyInfo.PublicKey)]
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't seem logically sound—an implementation exposing its internal details to the API. I understand it's intended for a test project, but it's better to avoid this approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rajkumar-rangaraj how is this different than the internalsvsiible to for OpenTelemetry.Extensions.Hosting.Tests, OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests, OpenTelemetry.Exporter.Prometheus.AspNetCore.Tests, and OpenTelemetry.Extensions.Hosting.Tests

Copy link
Contributor

github-actions bot commented Feb 3, 2025

This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.

@github-actions github-actions bot added the Stale Issues and pull requests which have been flagged for closing due to inactivity label Feb 3, 2025
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.39%. Comparing base (b508b84) to head (cecf769).
Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6090      +/-   ##
==========================================
- Coverage   86.40%   86.39%   -0.01%     
==========================================
  Files         257      257              
  Lines       11649    11644       -5     
==========================================
- Hits        10065    10060       -5     
  Misses       1584     1584              
Files with missing lines Coverage Δ
...etryProtocol/Implementation/ExperimentalOptions.cs 88.23% <ø> (-1.24%) ⬇️
...Telemetry.Exporter.Zipkin/ZipkinExporterOptions.cs 100.00% <ø> (ø)
src/OpenTelemetry/Logs/LoggerProviderSdk.cs 92.85% <ø> (ø)
...OpenTelemetry/Resources/OtelEnvResourceDetector.cs 100.00% <ø> (ø)
...lemetry/Resources/OtelServiceNameEnvVarDetector.cs 100.00% <ø> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry.Exporter.OpenTelemetryProtocol Issues related to OpenTelemetry.Exporter.OpenTelemetryProtocol NuGet package pkg:OpenTelemetry.Exporter.Zipkin Issues related to OpenTelemetry.Exporter.Zipkin NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package Stale Issues and pull requests which have been flagged for closing due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants