Skip to content

Feat: Allow dynamic nuget package source#1660

Closed
IdsTeepe wants to merge 6 commits intoGitTools:mainfrom
IdsTeepe:feat/dynamic-package-source
Closed

Feat: Allow dynamic nuget package source#1660
IdsTeepe wants to merge 6 commits intoGitTools:mainfrom
IdsTeepe:feat/dynamic-package-source

Conversation

@IdsTeepe
Copy link

@IdsTeepe IdsTeepe commented Jun 25, 2025

Removes the static reference to https://azuresearch-usnc.nuget.org and replaces it with a parameter (still with https://azuresearch-usnc.nuget.org as default value)

Fixes #1659, closes #1658

@IdsTeepe IdsTeepe requested a review from arturcic June 25, 2025 13:11
@IdsTeepe
Copy link
Author

Another option would be not to add a parameter for this, but to use dotnet nuget list source [--format short], take the first enabled source, parse the NuGet index.json, and fetch the first SearchQueryService.
The default scenario would look like:

  1. dotnet nuget list sourcehttps://api.nuget.org/v3/index.json
  2. fetch('https://api.nuget.org/v3/index.json')
    { 
      "resources": [
        {
          "@id": "https://azuresearch-usnc.nuget.org/query",
          "@type": "SearchQueryService",
          "comment": "Query endpoint of NuGet Search service (primary)"
        },
        ...
      ],
      ...
    }
  3. Use https://azuresearch-usnc.nuget.org/query

Let me know if you prefer this. If so, I'll make another PR.

@arturcic
Copy link
Member

please use rebase onto main instead of merging main into your branch, ew keep the linear history for PRs

@arturcic
Copy link
Member

Another option would be not to add a parameter for this, but to use dotnet nuget list source [--format short], take the first enabled source, parse the NuGet index.json, and fetch the first SearchQueryService. The default scenario would look like:

  1. dotnet nuget list sourcehttps://api.nuget.org/v3/index.json
  2. fetch('https://api.nuget.org/v3/index.json')
    { 
      "resources": [
        {
          "@id": "https://azuresearch-usnc.nuget.org/query",
          "@type": "SearchQueryService",
          "comment": "Query endpoint of NuGet Search service (primary)"
        },
        ...
      ],
      ...
    }
  3. Use https://azuresearch-usnc.nuget.org/query

Let me know if you prefer this. If so, I'll make another PR.

that seems like and idea, meaning we do not add a new parameter which we need to maintain, but do this internally. Give it a try and let's see how this ends up

@IdsTeepe
Copy link
Author

Another option would be not to add a parameter for this, but to use dotnet nuget list source [--format short], take the first enabled source, parse the NuGet index.json, and fetch the first SearchQueryService. The default scenario would look like:

  1. dotnet nuget list sourcehttps://api.nuget.org/v3/index.json
  2. fetch('https://api.nuget.org/v3/index.json')
    { 
      "resources": [
        {
          "@id": "https://azuresearch-usnc.nuget.org/query",
          "@type": "SearchQueryService",
          "comment": "Query endpoint of NuGet Search service (primary)"
        },
        ...
      ],
      ...
    }
  3. Use https://azuresearch-usnc.nuget.org/query

Let me know if you prefer this. If so, I'll make another PR.

that seems like and idea, meaning we do not add a new parameter which we need to maintain, but do this internally. Give it a try and let's see how this ends up

I've created #1664 as an alternative to this PR, which turned out a lot cleaner in my opinion. I'll treat this one as superseded and close it for now.

@IdsTeepe IdsTeepe closed this Jun 25, 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.

[ISSUE]: Unable to fetch GitVersion.Tool

2 participants