Skip to content

Add package staging protocol - #7703

Merged
Nigusu-Allehu merged 5 commits into
devfrom
dev-nyenework-stage-protocol
Sep 15, 2026
Merged

Nigusu-Allehu merged 5 commits into
devfrom
dev-nyenework-stage-protocol

Conversation

@Nigusu-Allehu

@Nigusu-Allehu Nigusu-Allehu commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Bug

Fixes: NuGet/Home#15084
First PR for : NuGet/Home#15015

Description

design spec: NuGet/Home#15048

It adds the NuGet.Protocol APIs required to publish packages to a staging service:

  • Discovers the PackageStaging/1.0.0 endpoint from the V3 service index.
  • Adds PushPackageAsync for uploading a package to the staging service's package route.
  • Adds PushSymbolsAsync for uploading a symbol package to the staging service's symbols route.

These APIs are the protocol layer that a follow-up PR will use to implement the dotnet nuget stage push command. This PR does not add the command-line experience itself.

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Critical build-analysis and query-string routing findings remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds NuGet.Protocol support for discovering PackageStaging/1.0.0 endpoints and uploading package and symbol files.

Changes:

  • Adds staging service discovery, provider registration, and public API entries.
  • Implements authenticated multipart package and symbol uploads.
  • Adds provider, upload, service type, and repository tests.
File summaries
File Summary
test/NuGet.Core.Tests/NuGet.Protocol.Tests/ServiceTypesTests.cs Tests the staging service type.
test/NuGet.Core.Tests/NuGet.Protocol.Tests/Resources/PackageStagingResourceV3Tests.cs Tests uploads and HTTP security behavior.
test/NuGet.Core.Tests/NuGet.Protocol.Tests/RepositoryTests.cs Updates provider count coverage.
test/NuGet.Core.Tests/NuGet.Protocol.Tests/Providers/PackageStagingResourceV3ProviderTests.cs Tests staging endpoint discovery.
src/NuGet.Core/NuGet.Protocol/SourceRepository.cs Updates provider cache capacity.
src/NuGet.Core/NuGet.Protocol/ServiceTypes.cs Defines the staging service type.
src/NuGet.Core/NuGet.Protocol/Resources/PackageStagingResourceV3.cs Implements uploads; unresolved routing, CA2000, and diagnostic-format findings remain.
src/NuGet.Core/NuGet.Protocol/Repository.cs Registers the staging provider.
src/NuGet.Core/NuGet.Protocol/PublicAPI/net472/PublicAPI.Unshipped.txt Tracks new public APIs.
src/NuGet.Core/NuGet.Protocol/PublicAPI/net10.0/PublicAPI.Unshipped.txt Tracks new public APIs.
src/NuGet.Core/NuGet.Protocol/Providers/PackageStagingResourceV3Provider.cs Discovers resources; unresolved CA1062 handling remains.
Review details

Suppressed comments (1)

src/NuGet.Core/NuGet.Protocol/Resources/PackageStagingResourceV3.cs:121

  • Error_Insecure_HTTP documents its first placeholder as the package source URL, but passing PackageSource here invokes PackageSource.ToString() and renders Name [Source]. This makes the new diagnostic inconsistent with the existing HTTP checks; pass the source URL (_httpSource.PackageSource.Source) instead.
                    _httpSource.PackageSource,
  • Files reviewed: 11/11 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Nigusu-Allehu
Nigusu-Allehu marked this pull request as ready for review September 15, 2026 00:28
@Nigusu-Allehu
Nigusu-Allehu requested a review from a team as a code owner September 15, 2026 00:28
@Nigusu-Allehu
Nigusu-Allehu merged commit af6ebf6 into dev Sep 15, 2026
18 checks passed
@Nigusu-Allehu
Nigusu-Allehu deleted the dev-nyenework-stage-protocol branch September 15, 2026 20:30
string? apiKey,
string? groupId,
TimeSpan requestTimeout,
bool allowInsecureConnections,

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.

There's 2 push symbols methods, can we just have 1?

We should favor simpler APIs until proven absolutely necessary to need mroe.

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.

I will remove one of the overloads.

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.

Add NuGet.Protocol APIs to interact with package staging resources

5 participants