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

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

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

Conversation

rajkumar-rangaraj
Copy link
Contributor

@rajkumar-rangaraj rajkumar-rangaraj commented Sep 13, 2024

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

  • 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 infra Infra work - CI/CD, code coverage, linters dependencies Pull requests that update a dependency file documentation Documentation related labels Sep 13, 2024
Copy link

codecov bot commented Sep 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files

Impacted file tree graph

@@            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 Coverage Δ
unittests ?
unittests-Project-Experimental 86.17% <100.00%> (?)
unittests-Project-Stable 86.19% <100.00%> (?)
unittests-Solution 86.27% <100.00%> (?)
unittests-UnstableCoreLibraries-Experimental 85.70% <ø> (?)

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

Files with missing lines Coverage Δ
...nTelemetry/Internal/SelfDiagnosticsConfigParser.cs 84.09% <100.00%> (ø)

... and 222 files with indirect coverage changes

@github-actions github-actions bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Sep 18, 2024
@rajkumar-rangaraj rajkumar-rangaraj changed the title [Draft] Update System.Diagnostics.DiagnosticSource and Microsoft.Extensions.* packages to .NET 9.0 RC.1 [Draft] Replace .NET6 target with .NET9 Sep 18, 2024
@github-actions github-actions bot removed the documentation Documentation related label Sep 18, 2024
@rajkumar-rangaraj rajkumar-rangaraj changed the title [Draft] Replace .NET6 target with .NET9 Replace .NET6 target with .NET9 Sep 18, 2024
@rajkumar-rangaraj rajkumar-rangaraj marked this pull request as ready for review September 18, 2024 21:43
@rajkumar-rangaraj rajkumar-rangaraj requested a review from a team as a code owner September 18, 2024 21:43
@reyang
Copy link
Member

reyang commented Sep 18, 2024

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.

@github-actions github-actions bot added the documentation Documentation related label Sep 19, 2024
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.

1 I think that this PR should include information about these changes in all affected CHANGELOG files.
2. 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.
3. 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.

.github/ISSUE_TEMPLATE/bug_report.yml Outdated Show resolved Hide resolved
.editorconfig Outdated
Comment on lines 152 to 154
# IDE0058: Remove unnecessary expression value
dotnet_diagnostic.IDE0058.severity = none

Copy link
Contributor

Choose a reason for hiding this comment

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

Potentially it can be good issue detector.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were around 60+ errors from different parts of the project with IDE0058. We could create a new issue to track them.

Comment on lines +31 to +33
<TargetFrameworksForLibraries>net9.0;net8.0;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibraries>
<TargetFrameworksForLibrariesExtended>net9.0;net8.0;netstandard2.1;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibrariesExtended>
<TargetFrameworksForPrometheusAspNetCore>net9.0;net8.0</TargetFrameworksForPrometheusAspNetCore>
Copy link
Contributor

Choose a reason for hiding this comment

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

One more thing, should we really add there net9? .NET8 will be supported longer than .NET8.
Previously there were no packages targeted .NET7. Ref: #5795

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CodeBlanch What are your thoughts on it?

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any particular advantage with a net9 target...

Copy link
Member

@CodeBlanch CodeBlanch Sep 19, 2024

Choose a reason for hiding this comment

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

Reminds me of this: #4918

Question being, why did we add net8.0 to everything? 🤣 At the time I tried to block that because it exploded the amount of public API files we had and maintaining those is a pain. But I went and changed how the public API stuff works so we don't need public API files for a TFM unless there are customizations for that TFM.

Where we are now I don't have an issue with adding net9.0. We did it for net8.0. Which I guess is to say I'm fine with each year adding the latest version as a target when we upgrade. Don't have a strong reason for that other than when users look at NuGet and they see explicit targets I guess it is strong indication we were intentional 🤷

/cc @alanwest

Copy link
Contributor

Choose a reason for hiding this comment

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

Was net8.0 more valid to add because it's a LTS release? net7.0 end of support is before net6.0, so it'll be removed before net6.0 anyways. net8.0, however, will outlive net6.0. Not adding net8.0 will unavoidably leave a gap somewhere in the timeline.

image

@rajkumar-rangaraj
Copy link
Contributor Author

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 - #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.

@CodeBlanch CodeBlanch changed the title Replace .NET6 target with .NET9 [repo] Replace .NET6 target with .NET9 Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation Documentation related infra Infra work - CI/CD, code coverage, linters pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace .NET6 target with .NET9
6 participants