Skip to content

Protocol loads Owners from package sources as an enumerable type - #5751

Merged
donnie-msft merged 7 commits into
devfrom
dev-donnie-msft-ownerAuthorProtocol2
Apr 15, 2024
Merged

donnie-msft merged 7 commits into
devfrom
dev-donnie-msft-ownerAuthorProtocol2

Conversation

@donnie-msft

@donnie-msft donnie-msft commented Apr 12, 2024 •

Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#13186
Fixes: NuGet/Home#13392 (unrelated flaky tests)

Regression? Last working version:

Description

The original PR #5605 was reverted in #5709 was reverted.

This PR's changes to PR 5605:

  • Handle Search response with a string JSON type for owners:.
  • Tests changes are a new JSON with string owner which is deserialized in PackageSearchResourceV3Tests.cs, and direct unit tests for the new converter.
  • Unrelated flaky test fixes in NuGet.PackageManagement.UI.Test.UIActionEngineTests:
    -CreateInstallAction_OnInstallingProject_EmitsPkgWasTransitiveTelemetryAndTabAndIsSolutionPropertiesAsync
    • CreateInstallAction_OnInstallingProject_WithNewSourceMapping_DoesNotLogTelemetry

Original PR 5605 description:

Read Owners collection from package sources into an enumerable type, rather than converting it to a comma-delimited string immediately upon parsing the JSON response.

There's no effective customer change in this PR, just that the enumeration is retained in Protocol types rather than only as a concatenated string. In subsequent PRs, I'll utilize this enumeration of owners for customer benefit.

Test changes:

  • Ensure a package source response that has Owners is converted into a matching enumeration.
  • Ensure a package source response without Owners returns null and doesn't affect other metadata.
  • Update EntityFrameworkSearch.json (from stale 2017 data) with latest package search metadata result response from nuget.org.
  • Update test with fluent assertions for all properties in the updated JSON.
  • Update test/NuGet.Core.Tests/NuGet.CommandLine.Xplat.Tests/PackageSearchRunnerTests.cs which was failing as it attempted to assert that the Table Output contained owners. The registration JSON does not normally contain Owner, so I updated the JSON and the test accordingly.

PR Checklist

@donnie-msft
donnie-msft requested a review from a team as a code owner April 12, 2024 04:32
@donnie-msft
donnie-msft force-pushed the dev-donnie-msft-ownerAuthorProtocol2 branch from 7c6f009 to 6f856f8 Compare April 12, 2024 23:15
@donnie-msft
donnie-msft requested a review from nkolev92 April 12, 2024 23:16
@donnie-msft
donnie-msft enabled auto-merge (squash) April 13, 2024 01:42

@nkolev92 nkolev92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there's an extra change in csproj.

Rest looks great, nice fix, and excellent tests!

@donnie-msft
donnie-msft requested a review from nkolev92 April 15, 2024 19:59
@donnie-msft
donnie-msft merged commit d01e48a into dev Apr 15, 2024
@donnie-msft
donnie-msft deleted the dev-donnie-msft-ownerAuthorProtocol2 branch April 15, 2024 21:19
@jgonz120 jgonz120 mentioned this pull request Mar 21, 2025
2 of 3 tasks
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.

UIActionEngine test assuming task cancellation is flaky Owner package metadata is an array in JSON but a string in Protocol types

2 participants