feat!: update target frameworks to net8.0 and net10.0, drop net5.0 and net6.0#708
Conversation
- Suppress IL2111 in KiotaDeserializationWrapperFactory.Create: passing CreateInternal as a method group to GetOrAdd loses the DynamicallyAccessedMembers annotation on the Type parameter; the suppression is safe because callers annotate the type at public API boundaries. - Suppress IL2075 in WriteNonParsableObjectValue: the catch-all reflection path over arbitrary object types is inherently trim-unsafe; callers requiring AOT/trim compatibility should use the KiotaJsonSerializationContext source-generated path. - Pin PublicApiAnalyzers to net8.0 only: the System.Text.Json source generator emits KiotaJsonSerializationContext properties without nullable annotations on net10.0, causing false RS0016/RS0041 errors against the declared public API. API surface is identical across TFMs so running the analyzer on the net8.0 target is sufficient.
Introduces Directory.Packages.props at the repo root and removes Version attributes from all PackageReference elements across source and test projects. All 18 package versions are now managed in a single place, eliminating the risk of version drift between projects. System.Diagnostics.DiagnosticSource consolidated from two minimum floors ([6.0,) and [8.0.1,)) to [8.0.1,) across all references. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
baywet
left a comment
There was a problem hiding this comment.
As we're making a new major revision, we should also take this opportunity to cleanup the interfaces.
There is the async parse node interface to merge into the regular one and get rid of the sync method.
There is also a cleanup to do with the static serialization methods and overloads for optional parameters.
And generally check for additional to-dos
Update Microsoft.Extensions.DependencyInjection.Abstractions and System.Text.Json version ranges from [6.0,) to [8.0,) to align with the minimum supported runtime (net8.0) after dropping net5.0/net6.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
I created another PR for:
|
…Factory (#709) * refactor(abstractions)!: merge IAsyncParseNodeFactory into IParseNodeFactory Remove IAsyncParseNodeFactory interface and move GetRootParseNodeAsync into IParseNodeFactory. Remove the obsolete sync GetRootParseNode method from the interface. Simplify ParseNodeProxyFactory and ParseNodeFactoryRegistry to use the unified interface directly. BREAKING CHANGE: IAsyncParseNodeFactory has been removed. Implement IParseNodeFactory.GetRootParseNodeAsync directly instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(abstractions)!: remove obsolete sync deserialization methods Remove KiotaSerializer.Deserialize, KiotaSerializer.DeserializeCollection, and their KiotaJsonSerializer counterparts. Only the async variants (DeserializeAsync, DeserializeCollectionAsync) remain. BREAKING CHANGE: Sync Deserialize/DeserializeCollection methods have been removed. Use DeserializeAsync/DeserializeCollectionAsync instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(serialization): update factory implementations for unified interface Remove obsolete sync GetRootParseNode from JsonParseNodeFactory, FormParseNodeFactory, and TextParseNodeFactory. Simplify HttpClientRequestAdapter to call GetRootParseNodeAsync directly without runtime type checking. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * docs(abstractions): update PublicAPI.Shipped.txt for removed APIs Remove entries for IAsyncParseNodeFactory, sync GetRootParseNode, sync Deserialize/DeserializeCollection methods, and the generic GetFactory<T> method. Add entries for the new GetRootParseNodeAsync on IParseNodeFactory and the non-generic GetFactory method. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test: update tests for IParseNodeFactory interface merge Replace IAsyncParseNodeFactory mocks with IParseNodeFactory. Convert sync GetRootParseNode calls to async GetRootParseNodeAsync. Update deserialization tests to use async DeserializeAsync/DeserializeCollectionAsync. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(ci): use glob pattern for coverlet coverage report paths Coverlet.MTP generates coverage files with a timestamp suffix (e.g., coverage.opencover.040526233344598.xml) rather than a fixed filename. Update the SonarCloud workflow to use a glob pattern that matches the timestamped files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(abstractions): add tests for ParseNodeProxyFactory.GetRootParseNodeAsync Verify that the proxy factory: - Delegates to the concrete factory - Invokes onBefore/onAfter callbacks - Preserves original node callbacks alongside proxy callbacks - Throws ArgumentNullException when concrete is null Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor(abstractions)!: remove deprecated single-param MultipartBody methods Remove GetPartValue<T>(string) and RemovePart(string) overloads that were marked with 'TODO: Remove with next major release'. Callers should use the overloads that accept (partName, fileName) instead. BREAKING CHANGE: GetPartValue<T>(string) and RemovePart(string) removed Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * chore: fix method order --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
This pull request has conflicting changes, the author must resolve the conflicts before this pull request can be merged. |
|
@copilot resolve the merge conflicts in this pull request |
- Add CLSCompliant assembly attribute to abstractions and http projects - Retain central package management (no explicit versions) - Retain updated TFM conditions without net5.0 - Pick up CLSCompliant changes from main (fix: Set CLSCompliant attribute where possible #705) Co-authored-by: MIchaelMainer <8527305+MIchaelMainer@users.noreply.github.com>
Merge conflicts resolved in c6176f0. The two conflicting files were:
|
|
Conflicts have been resolved. A maintainer will take a look shortly. |
Same change as in #705 |
Covers all breaking changes including: - Target framework updates (dropped net5.0/net6.0) - IAsyncParseNodeFactory merged into IParseNodeFactory - Sync deserialization methods removed from KiotaSerializer - MultipartBody single-param overloads removed - Dependency version bumps - ParseNodeFactoryRegistry API changes Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
PR Summary
Update target frameworks to net8.0 and net10.0, drop net5.0 and net6.0. Updates target frameworks across the solution to align with currently supported .NET runtimes; net10.0 is the current LTS release. Target framework management for the seven common source libraries is consolidated into src/Directory.Build.props to prevent future drift.
Remove obsolete APIs and provided upgrade guide.
Target Framework Changes (includes breaking change to target frameworks)
netstandard2.0;netstandard2.1;net8.0;net10.0(droppednet5.0andnet6.0)net10.0onlynet10.0Breaking API Changes
1.
IAsyncParseNodeFactorydeletedMerged into
IParseNodeFactory, which now has a single async method:The old synchronous
GetRootParseNode()method is removed entirely.2. Synchronous deserialization methods removed
All synchronous
Deserialize/DeserializeCollectionmethods removed fromKiotaSerializerandKiotaJsonSerializer— only async variants remain.3.
MultipartBodyoverloads removedGetPartValue<T>(string)andRemovePart(string)removed — the overloads requiring bothpartNameandcontentTypeare kept.4.
ParseNodeFactoryRegistrysimplifiedNow implements
IParseNodeFactory(notIAsyncParseNodeFactory), andGetFactory<T>()simplified to non-genericGetFactory(string contentType).5.
ParseNodeProxyFactoryupdatedNow implements
IParseNodeFactorydirectly, with only the asyncGetRootParseNodeAsyncmethod.6. Serialization library factories updated
JsonParseNodeFactory,FormParseNodeFactory,TextParseNodeFactorynow implementIParseNodeFactoryinstead ofIAsyncParseNodeFactory, with only the async method.Build & Infrastructure
8.0forSystem.Text.Json,System.Diagnostics.DiagnosticSource, etc.Microsoft.CodeAnalysis.PublicApiAnalyzersrestricted to run onnet8.0only (avoids false positives from net10.0 source generator differences)#pragma warning disable CS3001/CS3002aroundsbytemembers in interfaces, and[CLSCompliant]attributesTrim/AOT Safety
KiotaDeserializationWrapperFactory.Create(method group losesDynamicallyAccessedMembersannotation)JsonSerializationWriter.WriteNonParsableObjectValue(inherently trim-unsafe reflection path)Documentation