open-telemetry / opentelemetry-dotnet

The OpenTelemetry .NET Client
https://opentelemetry.io
Apache License 2.0
3.18k stars 753 forks source link

[repo] Replace .NET6 target with .NET9 #5832

Closed rajkumar-rangaraj closed 1 week ago

rajkumar-rangaraj commented 2 weeks ago

Fixes #5806

Changes

Please provide a brief description of the changes here.

  1. Removed .NET 6.0 Target Framework as the EOL for .NET 6.0 is approaching (Nov 12, 2024)
  2. Added .NET 9.0 RC1 Support
  3. Added PackageValidationBaselineFrameworkToIgnore to ignore validation against .NET 6.0, this has to be added, as previous versions of this package had .NET 6.0 support.

Next steps (follow up PRs)

Merge requirement checklist

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.38%. Comparing base (6250307) to head (d6940fd). Report is 318 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/graphs/tree.svg?width=650&height=150&src=pr&token=vscyfvPfy5&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #5832 +/- ## ========================================== + Coverage 83.38% 86.38% +2.99% ========================================== Files 297 257 -40 Lines 12531 11168 -1363 ========================================== - Hits 10449 9647 -802 + Misses 2082 1521 -561 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `?` | | | [unittests-Project-Experimental](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `86.17% <100.00%> (?)` | | | [unittests-Project-Stable](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `86.19% <100.00%> (?)` | | | [unittests-Solution](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `86.27% <100.00%> (?)` | | | [unittests-UnstableCoreLibraries-Experimental](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `85.70% <ø> (?)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files with missing lines](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [...nTelemetry/Internal/SelfDiagnosticsConfigParser.cs](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832?src=pr&el=tree&filepath=src%2FOpenTelemetry%2FInternal%2FSelfDiagnosticsConfigParser.cs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL09wZW5UZWxlbWV0cnkvSW50ZXJuYWwvU2VsZkRpYWdub3N0aWNzQ29uZmlnUGFyc2VyLmNz) | `84.09% <100.00%> (ø)` | | ... and [222 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-dotnet/pull/5832/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)
reyang commented 1 week ago

LGTM, I think https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/CONTRIBUTING.md#development-environment needs to be updated to cover .NET 9 as part of the environment setup. Can be a separate PR though.

rajkumar-rangaraj commented 1 week ago

I think that this PR should include information about these changes in all affected CHANGELOG files.

The best place to update this would be the RELEASENOTES.md file. This impacts all the projects in this repository. We haven't previously included the removal or addition of .NET in the changelog. If its fine, we could update this in a follow-up PR

  1. It can be follow up, but you can potentially include it also here. Review alle conditional compilation. At least NET7_0_OR_GREATER and NET8_0_OR_GREATER. I think that all of them can be converted just to NET. There were decision to simplify condition where possible and remove exact versions.

Created an issue to track - https://github.com/open-telemetry/opentelemetry-dotnet/issues/5848

  1. Please update test\OpenTelemetry.Instrumentation.W3cTraceContext.Tests\W3CTraceContextTests.cs around line 83. Tests are no longer executed on .NET6 so the TODO comment and the code can be simplified.

This is on my list; I will leave a TODO for this PR. We also need to identify similar code in the repo. Since we have a comment on this test, it was easier for us to find it.