Repository navigation
Enable nullable annotations for find/download/dependency/update core resources - #7570
Merged
Merged
Conversation
Annotate IsFileSource() with [MemberNotNullWhen(false, nameof(_httpSource))] and pass the non-null HttpSource into PushPackageToServer, DeletePackageFromServer, and GetSecureApiKey, removing internal null guards. Co-authored-by: Copilot <[email protected]> Copilot-Session: d6ed873c-2b1e-4d4e-9cde-c217bfdc3a73
nkolev92
marked this pull request as ready for review
July 18, 2026 00:36
martinrrm
reviewed
Jul 20, 2026
Route file-vs-server on the source argument's URI (sourceUri.IsFile) instead of IsFileSource(), which reflects the resource's primary source. This preserves correct routing when the symbol source's file-ness differs from the primary push source. Co-authored-by: Copilot <[email protected]> Copilot-Session: 851207a5-650b-47dd-8883-e1b5db685c44
DeletePackage was always called with _source, and IsFileSource() reasons about _httpSource (derived from _source). Referencing _source directly prevents a future caller from passing a different source and reintroducing the file-vs-server routing mismatch just fixed on the push path. Co-authored-by: Copilot <[email protected]> Copilot-Session: 851207a5-650b-47dd-8883-e1b5db685c44
Nigusu-Allehu
approved these changes
Jul 21, 2026
zivkan
approved these changes
Jul 21, 2026
martinrrm
approved these changes
Jul 22, 2026
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Progress: NuGet/Home#14851 (Phase 22)
Description
Phase 22 of the NuGet.Protocol nullable reference type migration, covering the find/download/dependency/update core resources and their providers.
Significant decisions:
PluginFindPackageByIdResource.GetPackageDownloaderAsyncreturnsTask. Override return nullability for nested generics is invariant, so this is forced by the nullable base contract.PackageUpdateResourcetreats a null_httpSourceas thefile sourcesignal.IsFileSource()is annotated with[MemberNotNullWhen(false, nameof(_httpSource))]and is used where the primary source''s null-state is what matters.PushPackageCorestill routes on the suppliedsourceargument (sourceUri.IsFile) so symbol pushes (-SymbolSource) whose file-ness differs from the primary source keep routing correctly; the non-nullHttpSourceis passed intoPushPackageToServer,DeletePackageFromServer, andGetSecureApiKey.DownloadResourceV3passesRegistrationResourceV3as a non-null parameter to its URL helpers rather than dereferencing a nullable field.PublicAPI.Shipped.txt(net472 + net8.0) oblivious~entries were annotated in place rather than moved to Unshipped, per the nullable migration conventions.PR Checklist