Skip to content

[NSJ -> STJ]Migrate AutoComplete#7298

Merged
Nigusu-Allehu merged 6 commits intodevfrom
dev-nyenework-autocomplete-stj
Apr 28, 2026
Merged

[NSJ -> STJ]Migrate AutoComplete#7298
Nigusu-Allehu merged 6 commits intodevfrom
dev-nyenework-autocomplete-stj

Conversation

@Nigusu-Allehu
Copy link
Copy Markdown
Member

@Nigusu-Allehu Nigusu-Allehu commented Apr 17, 2026

Bug

Fixes:
Related: NuGet/Home#14846

Description

Makes use of features introduced in #7313.

Replaces NSJ deserialization with (stj)JsonSerializer.DeserializeAsync into a new AutoCompleteModel POCO. STJ is now the default path. Users can opt back into NSJ by setting NUGET_USE_NSJ_DESERIALIZATION=true or via the NuGet.UseNSJDeserialization AppContext switch.

  • AutoCompleteModel - new internal POCO for STJ deserialization
  • NuGetFeatureFlags - new shared class with AppContext switch + env var opt-in for NSJ
  • AutoCompleteResourceV3 - dispatches to NSJ or STJ based on the flag; NSJ fallback is identical to the previous implementation
  • Tests cover both paths via a [Theory]

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.

Comment thread src/NuGet.Core/NuGet.Protocol/Resources/AutoCompleteResourceV3.cs
Comment thread src/NuGet.Core/NuGet.Protocol/Resources/AutoCompleteResourceV3.cs Outdated
var results = await _client.GetJObjectAsync(
AutoCompleteModel results = await _client.ProcessStreamAsync(
new HttpSourceRequest(queryUri, logger),
async stream =>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't know what the team code style is, if they link lamdas defined ahead of the method call or within it.

@Nigusu-Allehu Nigusu-Allehu self-assigned this Apr 18, 2026
@Nigusu-Allehu Nigusu-Allehu force-pushed the dev-nyenework-autocomplete-stj branch from 01dc4d3 to 6f4e797 Compare April 20, 2026 16:34
@Nigusu-Allehu Nigusu-Allehu marked this pull request as ready for review April 23, 2026 00:15
@Nigusu-Allehu Nigusu-Allehu requested a review from a team as a code owner April 23, 2026 00:15
@Nigusu-Allehu Nigusu-Allehu requested review from donnie-msft and jebriede and removed request for a team April 23, 2026 00:15
@Nigusu-Allehu Nigusu-Allehu changed the base branch from dev-feature-nsj-stj-migration to dev April 23, 2026 00:15
Comment thread test/NuGet.Core.Tests/NuGet.Protocol.Tests/AutoCompleteResourceV3Tests.cs Outdated
Comment thread test/NuGet.Core.Tests/NuGet.Protocol.Tests/AutoCompleteResourceV3Tests.cs Outdated
Comment thread build/Shared/NuGetFeatureFlags.cs Outdated
Comment thread src/NuGet.Core/NuGet.Protocol/Resources/AutoCompleteResourceV3.cs Outdated
Comment thread src/NuGet.Core/NuGet.Protocol/Resources/AutoCompleteResourceV3.cs Outdated
@Nigusu-Allehu Nigusu-Allehu merged commit 1b7845f into dev Apr 28, 2026
17 of 18 checks passed
@Nigusu-Allehu Nigusu-Allehu deleted the dev-nyenework-autocomplete-stj branch April 28, 2026 01:43
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.

4 participants