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

Removing of dotnet 3.1 sdk from ci #988

Closed

Conversation

m3nax
Copy link
Contributor

@m3nax m3nax commented Aug 29, 2022

As documented in the project readme currently .Net Core 3.1 is not supported.

This pull request removes .Net Core 3.1 from files used in the CI and test projects (KubernetesClient.Tests and E2E.Tests).

From my analysis, no project in the /src folder uses .Net Core 3.1 and can be safely removed.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 29, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: m3nax
Once this PR has been reviewed and has the lgtm label, please assign tg123 for approval by writing /assign @tg123 in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@brendandburns
Copy link
Contributor

cc @tg123

This looks fine with me, but I want Boshi's input before we merge this.

@tg123
Copy link
Member

tg123 commented Aug 29, 2022

Thanks for the PR
the netstandard2.0/netstandard2.1 will be left uncovered if netcore3.1 was removed.

lets defer the after the removal of netstandard2.1 and should find alternative runtime to cover netstandard2.0

@m3nax
Copy link
Contributor Author

m3nax commented Aug 30, 2022

Why will it be left uncovered if netcoreapp3.1 has been removed?

This pull, without .NET 3.1 SDK, already build netstandard2.0 and netstandard2.1 libraries
build log of pull -> https://github.com/kubernetes-client/csharp/runs/8085624502?check_suite_focus=true#step:5:39472

I have created a project and tested compilation only with .NET 6.0 SDK and everything seems to work.
Project -> https://github.com/m3nax/ClassLibraryTest
Build output -> https://github.com/m3nax/ClassLibraryTest/runs/8088826769?check_suite_focus=true#step:5:6

I checked if a library contains the .NET 3.1 framework target but from what I see in Nuget.org there is nothing.
https://www.nuget.org/packages/KubernetesClient
https://www.nuget.org/packages/KubernetesClient.Basic
https://www.nuget.org/packages/KubernetesClient.Models

What is the difference of netstandard2.0 compilation between .NET 3.1 SDK and .NET 6.0 SDK?

@tg123
Copy link
Member

tg123 commented Aug 30, 2022

.net will find closet library's target to the proj which depends on it
for exmaple, libA(target net5 net6)
when your app B (net6)->libA, the dist folder will copy dlls from libA/net/A.dll

@m3nax
Copy link
Contributor Author

m3nax commented Sep 22, 2022

I'm not understanding what the problem is.

From what I know and I have checked (lib version 9.0.25):

Target Framework Supported by project SDKs that can compile the lib version Shipped in KubernetesClient Shipped inKubernetesClient.Basic Shipped in KubernetesClient.Models Shipped in KubernetesClient.Classic
netstandard2.0* x .NET Core 3.1/5.0/6.0 x x x
netstandard2.1 x .NET Core 3.1/5.0/6.0 x
netcoreapp3.1 .NET Core 3.1
net5.0 x .NET Core 5.0 x
net6.0 x .NET Core 6.0 x
net48* x (supported with netstandard2.0) x

Which lib is taken during compilation (closets to target framework) compatibility matrix

Program A compilation framework Lib. version taken by compiler for KubernetesClient Lib. version taken by compiler for KubernetesClient.Basic Lib. version taken by compiler for KubernetesClient.Models Lib. version taken by compiler for KubernetesClient.Classic
>= .NetCore 2.0 NetStandard2.0 NetStandard2.0 NetStandard2.0
>= .NetCore 3.1 netstandard2.1 NetStandard2.0 NetStandard2.0 NetStandard2.0
>= .NetCore 5.0 net5.0 NetStandard2.0 NetStandard2.0 NetStandard2.0
>= .NetCore 6.0 net6.0 NetStandard2.0 NetStandard2.0 NetStandard2.0
>= .NetFramework 4.6.2 NetStandard2.0 NetStandard2.0 NetStandard2.0
>= .NetFramework 4.8.0 NetStandard2.0 NetStandard2.0 net48

Nuget KubernetesClient 9.0.25 content:
image

Nuget KubernetesClient.Basic 9.0.25 content:
image

Nuget KubernetesClient.Classic 9.0.25 content:
image

Nuget KubernetesClient.Models 9.0.25 content:
image

As you can see in the nugets packages netcoreapp3.1 target moniker is not present (missing "netcoreapp3.1" folder).

It is safe for me to remove the .Net Core 3.1 from the pipelines and the two test projects because it is not supported / present in nuget packages / used by projects in the src folder and is not required for compilation.

@m3nax m3nax changed the title Removed dotnet 3.1 sdk from ci Removing of dotnet 3.1 sdk from ci Sep 22, 2022
@tg123
Copy link
Member

tg123 commented Sep 22, 2022

netcore3.1 here is to cover the code path of netstandard2.0/2.1

when you are using net6, it will link the dll in net6 folder.
while netcore3.1 is not net6, the complier will pick the closest dll, netstandard2.1, to run tests

until there is a better way to cover net48 code and netsantdaed2.1 is still supported, netcore3.1 is the best solution i ever know

@m3nax m3nax marked this pull request as draft October 3, 2022 10:16
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 3, 2022
@k8s-ci-robot
Copy link
Contributor

@m3nax: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@m3nax
Copy link
Contributor Author

m3nax commented Oct 4, 2022

Blocked by #1029

@tg123 tg123 mentioned this pull request Dec 11, 2022
@tg123 tg123 closed this Dec 16, 2022
@m3nax m3nax deleted the removed-dotnet-3.1-sdk-from-ci branch May 3, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants