-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
.Net: Add multitargeting to .NET libraries #4421
.Net: Add multitargeting to .NET libraries #4421
Conversation
What benefit does net8.0 targeting give us if we won't be able to use all the new APIs to maintain compatibility with net standard 2.0? |
When running on .NET 8+, apps will use the net8.0 binaries rather than the netstandard2.0 binaries. That means it can use newer APIs. So, for example, it can use SocketsHttpHandler and its finer-grained control when on .NET 8+. It can use overloads that take a CancellationToken that don't exist in netstandard in order to improve cancellation and responsiveness. It can use built-in collections like PriorityQueue rather than being to ship its own version. It can use the regex source generator. And so on. It also implicitly benefits from new APIs in places the compiler targets them, eg interpolated strings will compile with the more efficient implementation introduced in C# 10 / .NET 6. It further has deployment benefits, eg System.Text.Json doesn't need to be deployed as part of the app because it's built-in to netcoreapp8. Etc. |
Depends on #5802 |
Depends on #5819 |
bd2d171
to
360b458
Compare
Still need to figure out why code coverage is unhappy, but other than that, this should be ready for review @markwallace-microsoft |
a5440e7
to
42f05f7
Compare
@dmytrostruk, I think you set up the code coverage checking? Can you make a recommendation for what to do here? |
There aren't any meaningful changes. I think the problem is that the library is already razor-thin above the code coverage line (main is sitting at 81% branch coverage for the OpenAI connector, and at < 80% CI fails), so anything that perturbs it even slightly could cause CI to totally fail. There's nothing related to my changes that wasn't covered, so I went and added unrelated tests to boost the coverage back above 80%, but that's not really a sustainable position. I suggest someone take some time to bump the coverage number up above 90% so there's much more wiggle room. |
4914509
to
2081f06
Compare
Finally green. @markwallace-microsoft, please review when you get a chance. |
@stephentoub That's true. When I was improving code coverage, I spent some time to hit 80% threshold by adding a lot of tests and back then I couldn't afford even more time to make it 90% or higher. On the other hand, I haven't noticed this problem recurring often, but maybe it's just me.
Thank you! Yes, I agree, we should add more tests to give us some space before it breaks CI pipeline. |
I think it got worse for this particular library when all the various audio, image, etc. services were added, as well as the update function calling abstractions, as they don't have as good coverage in the tests. |
dotnet/src/Connectors/Connectors.OpenAI/TextToAudio/TextToAudioRequest.cs
Show resolved
Hide resolved
dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelFunctionHelpers.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelSystemHelpers.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Functions/Functions.OpenApi.Extensions/Extensions/ApiManifestKernelExtensions.cs
Show resolved
Hide resolved
dotnet/src/Plugins/Plugins.MsGraph/Connectors/Client/MsGraphClientLoggingHandler.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes. LGTM
dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Github.cs
Outdated
Show resolved
Hide resolved
dotnet/samples/Concepts/Plugins/CreatePluginFromOpenApiSpec_Github.cs
Outdated
Show resolved
Hide resolved
...src/Planners/Planners.Handlebars/Handlebars/Extensions/HandlebarsPromptTemplateExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Planners/Planners.Handlebars/Handlebars/Extensions/HandlebarsPlannerExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Planners/Planners.Handlebars/Handlebars/HandlebarsPlanner.cs
Outdated
Show resolved
Hide resolved
dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/ChatPromptParser.cs
Outdated
Show resolved
Hide resolved
Adds net8.0 targets and updates various code to take advantage of newer APIs and also fix analyzers. Fixes microsoft#4308
Adds net8.0 targets and updates various code to take advantage of newer APIs and also fix analyzers. Fixes microsoft#4308
Adds net8.0 targets and updates various code to take advantage of newer APIs and also fix analyzers.
Fixes #4308