Skip to content

[release/10.0.4xx] Source code updates from nuget/nuget.client - #6927

Merged
dotnet-maestro[bot] merged 3 commits into
release/10.0.4xxfrom
darc-release/10.0.4xx-c7dd046e-bbe6-4cb5-90ed-c9cb13cda670
Jun 1, 2026
Merged

dotnet-maestro[bot] merged 3 commits into
release/10.0.4xxfrom
darc-release/10.0.4xx-c7dd046e-bbe6-4cb5-90ed-c9cb13cda670

Conversation

@dotnet-maestro

@dotnet-maestro dotnet-maestro Bot commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Note

This is a codeflow update. It may contain both source code changes from
the source repo
as well as dependency updates. Learn more here.

This pull request brings the following source code changes

From https://github.com/nuget/nuget.client

Diff the source with this PR branch
darc vmr diff --name-only https://github.com/nuget/nuget.client:515c04139c0ac8c31aef7943d667f015a052f7d2..https://github.com/dotnet/dotnet:darc-release/10.0.4xx-c7dd046e-bbe6-4cb5-90ed-c9cb13cda670

@dotnet-maestro

Copy link
Copy Markdown
Contributor Author

Note

PRs from original repository included in this codeflow update:

💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance.

@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team May 30, 2026 17:15
@dotnet-maestro

Copy link
Copy Markdown
Contributor Author

Note

PRs from original repository included in this codeflow update:

💡 You may consult the FAQ for more information or tag @dotnet/prodconsvcs for assistance.

…7406

NuGet/NuGet.Client PR #7406 ("Enable nullable for NuGet.Protocol
repository abstractions") changed SourceRepository.GetResourceAsync<T>
to return Task<T?>, matching the long-standing XML doc contract
("Null if the resource does not exist"). Consumers in sdk's
TemplateEngine NuGet helpers were storing the result in non-nullable
locals and dereferencing immediately, producing CS8600/CS8602 under
nullable-enabled compilation with TreatWarningsAsErrors=true.

Mirror the same pattern nuget.client now uses internally
(SourceRepository.GetFeedType): throw InvalidOperationException if a
provider cannot produce the requested resource, then proceed with a
non-null value.

Fixed 4 call sites across 2 files:
  src/Cli/Microsoft.TemplateEngine.Cli/NuGet/NugetApiManager.cs
    - GetResourceAsync<PackageMetadataResource>
    - GetResourceAsync<PackageSearchResource>
  test/TemplateEngine/Microsoft.TemplateEngine.TestHelper/PackageManager.cs
    - GetResourceAsync<FindPackageByIdResource>
    - GetResourceAsync<PackageMetadataResource>

Co-authored-by: Copilot <[email protected]>
@lewing

lewing commented May 31, 2026

Copy link
Copy Markdown
Member

Pushed a fix for the nullability errors caused by nuget/nuget.client#7406, which flipped SourceRepository.GetResourceAsync<T> to Task<T?>. The 4 affected sites in src/Cli/Microsoft.TemplateEngine.Cli/NuGet/NugetApiManager.cs and test/TemplateEngine/Microsoft.TemplateEngine.TestHelper/PackageManager.cs now throw InvalidOperationException when a provider can't produce the requested resource (mirroring the pattern nuget.client adopted internally in SourceRepository.GetFeedType). The same commit was applied to the sibling [main] / [10.0.4xx] / [preview5] codeflow PRs. Will backflow into dotnet/sdk after merge. cc @dotnet/dotnet-cli

@dotnet-policy-service
dotnet-policy-service Bot requested review from a team May 31, 2026 16:23

@lewing lewing 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.

QB daily: All CI checks green, approving code flow PR.

@dotnet-maestro
dotnet-maestro Bot merged commit e03b113 into release/10.0.4xx Jun 1, 2026
13 checks passed
@dotnet-maestro
dotnet-maestro Bot deleted the darc-release/10.0.4xx-c7dd046e-bbe6-4cb5-90ed-c9cb13cda670 branch June 1, 2026 15:27
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team June 1, 2026 15:28
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.

2 participants