csharp icon indicating copy to clipboard operation
csharp copied to clipboard

Removing of dotnet 3.1 sdk from ci

Open m3nax opened this issue 3 years ago • 9 comments

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.

m3nax avatar Aug 29 '22 12:08 m3nax

[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

k8s-ci-robot avatar Aug 29 '22 12:08 k8s-ci-robot

cc @tg123

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

brendandburns avatar Aug 29 '22 15:08 brendandburns

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

tg123 avatar Aug 29 '22 18:08 tg123

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?

m3nax avatar Aug 30 '22 09:08 m3nax

.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

tg123 avatar Aug 30 '22 09:08 tg123

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 avatar Sep 22 '22 08:09 m3nax

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

tg123 avatar Sep 22 '22 09:09 tg123

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

k8s-ci-robot avatar Oct 04 '22 12:10 k8s-ci-robot

Blocked by #1029

m3nax avatar Oct 04 '22 21:10 m3nax