Skip to content

[NSJ -> STJ]Migrate AutoComplete - #7298

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

Nigusu-Allehu merged 6 commits into
devfrom
dev-nyenework-autocomplete-stj

Conversation

@Nigusu-Allehu

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

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#14889
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.

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
@Nigusu-Allehu Nigusu-Allehu mentioned this pull request Apr 23, 2026
2 of 3 tasks
Comment thread build/Shared/NuGetFeatureFlags.cs Resolved
@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
var searchUrl = _serviceIndex.GetServiceEntryUri(ServiceTypes.SearchAutocompleteService);

if (searchUrl == null)
if (NuGetFeatureFlags.UseSystemTextJsonDeserializationFeatureSwitch || NuGetFeatureFlags.IsSystemTextJsonDeserializationEnabledByEnvironment(_environmentVariableReader))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

commenting for ref

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.

Migrate AutoComplete resource deserialization to System.Text.Json

4 participants