Repository navigation
Switch to STJ deserialization for PluginCacheEntry - #7421
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a System.Text.Json (STJ) serialization/deserialization path for plugin operation-claims cache entries, gated by the existing NuGet feature switch/environment variable, to align PluginCacheEntry with the broader NuGet.Protocol STJ migration.
Changes:
- Added STJ-based read/write logic to
PluginCacheEntry, controlled byNuGetFeatureFlagsswitch/env var. - Introduced a source-generated
JsonSerializerContextforIReadOnlyList<OperationClaim>. - Expanded unit tests to run both Newtonsoft/STJ paths and validate cross-compatibility between the two formats.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/NuGet.Core.Tests/NuGet.Protocol.Tests/Plugins/PluginCacheEntryTests.cs | Parameterizes tests to exercise both serializer paths and adds cross-deserialization compatibility coverage. |
| src/NuGet.Core/NuGet.Protocol/Plugins/PluginCacheJsonContext.cs | Adds STJ source-generation context for plugin cache payload (IReadOnlyList<OperationClaim>). |
| src/NuGet.Core/NuGet.Protocol/Plugins/PluginCacheEntry.cs | Adds STJ-based cache file serialization/deserialization behind existing feature gating and injects env-var reader for tests. |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
jeffkl
previously approved these changes
Jun 1, 2026
nkolev92
reviewed
Jun 1, 2026
jebriede
approved these changes
Jun 2, 2026
nkolev92
approved these changes
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Fixes:
Description
Add STJ deserialization path for
PluginCacheEntryremove existing NSJ path is unchanged.
PR Checklist