Skip to content

Switch to STJ deserialization for PluginCacheEntry - #7421

Merged
Nigusu-Allehu merged 5 commits into
devfrom
dev-nyenework-pluginCacheentry-stj
Jun 2, 2026
Merged

Nigusu-Allehu merged 5 commits into
devfrom
dev-nyenework-pluginCacheentry-stj

Conversation

@Nigusu-Allehu

@Nigusu-Allehu Nigusu-Allehu commented May 27, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes:

Description

Add STJ deserialization path for PluginCacheEntry

remove existing NSJ path is unchanged.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 by NuGetFeatureFlags switch/env var.
  • Introduced a source-generated JsonSerializerContext for IReadOnlyList<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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@Nigusu-Allehu
Nigusu-Allehu marked this pull request as ready for review May 28, 2026 22:40
@Nigusu-Allehu
Nigusu-Allehu requested a review from a team as a code owner May 28, 2026 22:40
@Nigusu-Allehu
Nigusu-Allehu requested review from jebriede and jeffkl May 28, 2026 22:40
jeffkl
jeffkl previously approved these changes Jun 1, 2026
@Nigusu-Allehu Nigusu-Allehu changed the title Add STJ path for PluginCacheEntry Switch to STJ deserialization for PluginCacheEntry Jun 2, 2026
@Nigusu-Allehu
Nigusu-Allehu requested a review from nkolev92 June 2, 2026 21:49
@Nigusu-Allehu
Nigusu-Allehu enabled auto-merge (squash) June 2, 2026 23:25
@Nigusu-Allehu
Nigusu-Allehu merged commit 8883259 into dev Jun 2, 2026
17 of 18 checks passed
@Nigusu-Allehu
Nigusu-Allehu deleted the dev-nyenework-pluginCacheentry-stj branch June 2, 2026 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants