Repository navigation
Enable nullable for NuGet.Protocol HttpSource types - #7370
Merged
Merged
Conversation
nkolev92
force-pushed
the
dev-nkolev92-protocolNullablePhase7-v2
branch
from
May 7, 2026 01:07
4093185 to
8669189
Compare
nkolev92
marked this pull request as ready for review
May 7, 2026 21:49
donnie-msft
reviewed
May 7, 2026
Nigusu-Allehu
previously approved these changes
May 8, 2026
donnie-msft
previously approved these changes
May 9, 2026
zivkan
previously approved these changes
May 9, 2026
zivkan
left a comment
Member
There was a problem hiding this comment.
When I did the annotations for NuGet.Versioning, NuGet.Frameworks, and NuGet.Common, I very intentionally tried to avoid making product changes, and just annotating APIs as they were used.
But I'm wondering if now that we're using copilot to automate a lot of the work, and doing it in smaller pull requests, if it's worthwhile trying to set up some good patterns?
I'm concerned about the amount of ! we're going to end up with suppressing issues. If AI keeps being used to write code in this repo, we don't want the AI to learn that it's ok to use ! in new code.
But I'd like to keep annotating our existing code quickly, to avoid taking too much time fixing code to avoid !.
Remove #nullable disable from 11 HttpSource leaf-level files: DownloadTimeoutStreamContent, HttpCacheResult, HttpHandlerResourceV3, HttpRequestMessageConfiguration, HttpSourceCredentials, HttpSourceException, HttpStreamValidation, IThrottle, ProxyAuthenticationHandler, ServerWarningLogHandler, TokenStore. Key changes: - HttpHandlerResourceV3.CredentialService: Lazy<ICredentialService>? - HttpHandlerResourceV3.CredentialsSuccessfullyUsed: Action<Uri, ICredentials>? - HttpSourceCredentials.Credentials: ICredentials? - ProxyAuthenticationHandler: pass IWebProxy and ICredentialService as non-null params to AcquireCredentialsAsync/PromptForProxyCredentialsAsync (removing redundant null checks, method now static) - TokenStore: ConcurrentDictionary values are nullable - HttpStreamValidation: null checks for stream parameters - Update PublicAPI.Shipped.txt for net472 and net8.0 - Remove stale GlobalSuppressions entry, update CA1031 target Co-authored-by: Copilot <[email protected]>
Remove #nullable disable from 10 HttpSource mid-level files: HttpRetryHandlerRequest, IHttpRetryHandler, HttpCacheUtility, HttpRequestMessageExtensions, HttpRequestMessageFactory, HttpSourceResult, NullThrottle, SemaphoreSlimThrottle, StsAuthenticationHandler, HttpSourceResource. Co-authored-by: Copilot <[email protected]>
nkolev92
dismissed stale reviews from zivkan, donnie-msft, and Nigusu-Allehu
via
May 13, 2026 00:06
4a66339
nkolev92
force-pushed
the
dev-nkolev92-protocolNullablePhase7-v2
branch
from
May 13, 2026 00:06
8669189 to
4a66339
Compare
Nigusu-Allehu
approved these changes
May 13, 2026
zivkan
approved these changes
May 13, 2026
This was referenced May 14, 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
Description
Enable nullable annotations for NuGet.Protocol HttpSource types (Phases 7-9 of the NuGet.Protocol nullable enablement effort).
Phase 7 - HttpSource leaf types (11 files)
ProxyAuthenticationHandler.AcquireCredentialsAsyncandPromptForProxyCredentialsAsyncto acceptIWebProxyandICredentialServiceas parameters from guarded call sites, removing redundant null checks.PromptForProxyCredentialsAsyncis now static (no longer accesses instance state).Phase 8 - HttpSource mid-level types (10 files)
HttpSourceResultsecond constructor accepts nullablecacheFileName(callers already pass null for direct network downloads).Phase 9 - HttpSource core (3 files)
PR Checklist