Skip to content

Conversation

@joelverhagen
Copy link
Contributor

@joelverhagen joelverhagen commented Dec 2, 2025

Motivation and Context

This resolves #738. There are two issues with the NuGet.org integration today:

  1. Change the registryBaseUrl for NuGet to https://api.nuget.org/v3/index.json. https://api.nuget.org is not the entry point for our service and is not specific enough. https://api.nuget.org/v3/index.json is the value that users put into their tooling to connect to our public registry (it is installed by default in .NET client tooling).
  2. Use the service index API to get the URL pattern for package READMEs.
    • This URL is not guaranteed to be stable. The service index URL (registryBaseUrl) is, however.

Additionally, I polished up the error messages so various error modes are clearer. When packages are published to NuGet.org, they take 2-5 minutes to become available due to validations we run.

Some possible states that are now handled and described more helpfully are:

  • Version exists, but the package has no README
  • The ID exists, but the version does not
  • The ID does not exist at all

There are only 3 authors (me, another MSFT person, and a community member) explicitly setting the old value. The DB migration will fix the issue. A future publish will fail with the validation error but the error message is clear.

registry type and base URL do not match: 'https://api.nuget.org' is not valid for registry type 'nuget'. Expected: https://api.nuget.org/v3/index.json

How Has This Been Tested?

  • Unit tests, new and existing
  • Manual test locally
  • Set old data in the DB, docker compose up, confirm the migration updates the specific package

Breaking Changes

Yes, but minimal impact expected, unless there is a dependency on the specific https://api.nuget.org value downstream. I am not aware of any such dependency, and the new value is more proper and specific.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

For more information about the NuGet API see: https://learn.microsoft.com/en-us/nuget/api/overview#service-index (I wrote most of the docs).

@joelverhagen joelverhagen changed the title Joelverhagen/service index Improve NuGet API usage for publish validation Dec 2, 2025
@joelverhagen joelverhagen changed the title Improve NuGet API usage for publish validation Fix NuGet.org base URL default, improve API integration Dec 2, 2025
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.

Registry base URL is not the proper entry point for NuGet

1 participant