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

[Instrumentation.Wcf] Add .NET6 as target framework #2243

Merged
merged 10 commits into from
Oct 28, 2024

Conversation

Kielek
Copy link
Contributor

@Kielek Kielek commented Oct 23, 2024

Fixes scenario when you referencing Instrumentation.Wcf package from .NET6+ with enabled NuGet Audit like for .NET9.
Without changes it was leading to the issues:

image

Workaround:
Manual referencing safe version of System.Drawing.Common, but it is not user friendly.

Changes

  • Added .NET6 target (temporary, just to make a release and be able to use new version in .NET AutoInstrumnetation, just after I will bring here .NET8).
  • Nullability fixes after add .net6 as a target framework

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)

@github-actions github-actions bot added the comp:instrumentation.wcf Things related to OpenTelemetry.Instrumentation.Wcf label Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 5 lines in your changes missing coverage. Please review.

Project coverage is 78.34%. Comparing base (71655ce) to head (3643194).
Report is 554 commits behind head on main.

Files with missing lines Patch % Lines
...on.Wcf/Implementation/InstrumentedDuplexChannel.cs 66.66% 2 Missing ⚠️
...mplementation/HttpRequestMessagePropertyWrapper.cs 90.90% 1 Missing ⚠️
...n.Wcf/Implementation/InstrumentedRequestChannel.cs 80.00% 1 Missing ⚠️
...Wcf/Implementation/RequestTelemetryStateTracker.cs 75.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2243      +/-   ##
==========================================
+ Coverage   73.91%   78.34%   +4.43%     
==========================================
  Files         267       29     -238     
  Lines        9615      702    -8913     
==========================================
- Hits         7107      550    -6557     
+ Misses       2508      152    -2356     
Flag Coverage Δ
unittests-Instrumentation.Wcf 78.34% <83.33%> (?)

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

Files with missing lines Coverage Δ
...cf/Implementation/AsyncResultWithTelemetryState.cs 85.71% <100.00%> (ø)
...Wcf/Implementation/ClientChannelInstrumentation.cs 94.66% <100.00%> (-0.14%) ⬇️
...n.Wcf/Implementation/TelemetryPropagationWriter.cs 66.66% <100.00%> (ø)
...Implementation/WcfInstrumentationActivitySource.cs 100.00% <100.00%> (ø)
...mplementation/HttpRequestMessagePropertyWrapper.cs 70.27% <90.90%> (+7.77%) ⬆️
...n.Wcf/Implementation/InstrumentedRequestChannel.cs 68.75% <80.00%> (-6.25%) ⬇️
...Wcf/Implementation/RequestTelemetryStateTracker.cs 95.58% <75.00%> (-1.43%) ⬇️
...on.Wcf/Implementation/InstrumentedDuplexChannel.cs 59.75% <66.66%> (ø)

... and 261 files with indirect coverage changes

@Kielek Kielek marked this pull request as ready for review October 23, 2024 15:45
@Kielek Kielek requested a review from a team as a code owner October 23, 2024 15:45

try
{
ExecutionContext.Run(ExecutionContext.Capture(), executeInChildContext, null);
Copy link
Member

Choose a reason for hiding this comment

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

This is the part I'm not sure about. I'm going to try and find an expert on the .NET runtime team to ask about what to do here. I'll post back.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking for any advice you can give : )

Copy link
Member

Choose a reason for hiding this comment

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

Haven't nailed it down yet but I approved the PR. We're adding a throw here for null EC but ExecutionContext.Run should be throwing today in that case anyway and no user has complained about it AFAIK.

We can circle back to it if any new info comes to light.

Co-authored-by: Mikel Blanchard <[email protected]>
Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

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

LGTM

@Kielek Kielek merged commit fdedd5b into open-telemetry:main Oct 28, 2024
55 checks passed
@Kielek Kielek deleted the wcf-net-target branch October 28, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:instrumentation.wcf Things related to OpenTelemetry.Instrumentation.Wcf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants