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

[Api] Nullable #5801

Merged
merged 21 commits into from
Sep 24, 2024
Merged

Conversation

ysolomchenko
Copy link
Contributor

Towards #3958

Changes

OpenTelemety.Api mark as nullable

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)

@ysolomchenko ysolomchenko requested a review from a team August 22, 2024 14:17
@github-actions github-actions bot added pkg:OpenTelemetry.Api Issues related to OpenTelemetry.Api NuGet package pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package labels Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.33%. Comparing base (6250307) to head (cae599f).
Report is 329 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5801      +/-   ##
==========================================
+ Coverage   83.38%   86.33%   +2.95%     
==========================================
  Files         297      257      -40     
  Lines       12531    11193    -1338     
==========================================
- Hits        10449     9664     -785     
+ Misses       2082     1529     -553     
Flag Coverage Δ
unittests ?
unittests-Project-Experimental 86.14% <ø> (?)
unittests-Project-Stable 86.20% <ø> (?)
unittests-Solution 86.25% <ø> (?)
unittests-UnstableCoreLibraries-Experimental 85.75% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/OpenTelemetry.Api/ActivityContextExtensions.cs 100.00% <ø> (ø)
src/OpenTelemetry.Api/Baggage.cs 100.00% <ø> (ø)
src/OpenTelemetry.Api/BaseProvider.cs 100.00% <ø> (ø)
...emetry.Api/Context/AsyncLocalRuntimeContextSlot.cs 100.00% <ø> (+25.00%) ⬆️
...nTelemetry.Api/Context/Propagation/B3Propagator.cs 86.02% <ø> (+0.15%) ⬆️
...metry.Api/Context/Propagation/BaggagePropagator.cs 85.00% <ø> (-0.49%) ⬇️
.../Context/Propagation/CompositeTextMapPropagator.cs 100.00% <ø> (+16.66%) ⬆️
...y.Api/Context/Propagation/NoopTextMapPropagator.cs 33.33% <ø> (+33.33%) ⬆️
...etry.Api/Context/Propagation/PropagationContext.cs 64.28% <ø> (ø)
...enTelemetry.Api/Context/Propagation/Propagators.cs 100.00% <ø> (ø)
... and 25 more

... and 228 files with indirect coverage changes

@Kielek Kielek force-pushed the api-mark-as-nullable branch 2 times, most recently from de9f690 to 8ebf150 Compare August 30, 2024 10:17
Copy link
Contributor

@Kielek Kielek left a comment

Choose a reason for hiding this comment

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

LGTM with fixes.
While reviewing, please focus on Baggage and RuntimeContext related things.

Copy link
Contributor

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 Sep 13, 2024
@Kielek Kielek removed the Stale Issues and pull requests which have been flagged for closing due to inactivity label Sep 13, 2024
@@ -7,7 +7,7 @@ namespace OpenTelemetry.Metrics;

internal sealed class PullMetricScope : IDisposable
{
private static readonly RuntimeContextSlot<bool> Slot = RuntimeContext.RegisterSlot<bool>("otel.pull_metric");
private static readonly RuntimeContextSlot<bool> Slot = RuntimeContext.RegisterSlot<bool>("otel.pull_metric")!;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this one needs a closer look.
I'm not familiar with the RuntimeContext api. If the RegisterSlot method can return a nullable, that might suggest something failed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed in fe4d9bf

I double checked. There is no possibility to return null (at least as long someone does no play with reflection with contextSlotType field in RuntimeContext class.

@github-actions github-actions bot removed the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Sep 17, 2024
Copy link
Contributor

@TimothyMothra TimothyMothra left a comment

Choose a reason for hiding this comment

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

these changes LGTM.

One thing to note, I don't know the Baggage or RuntimeContext classes well enough to say if these values SHOULD be nullable.

@CodeBlanch CodeBlanch requested a review from a team as a code owner September 24, 2024 21:03
@CodeBlanch CodeBlanch merged commit c1f1c16 into open-telemetry:main Sep 24, 2024
49 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants