feat: Migrate NuGet API from V2 to V3 Registration + Flat Container#13
Merged
Conversation
Replace V2 download URLs and V3 Flat Container version index with: - V3 Registration API (registration5-gz-semver2) for version queries - V3 Flat Container for package downloads (tracked CDN) Key changes: - Add shared/http-client.ts: gzip-aware HTTPS client with User-Agent - Add shared/nuget-registration.ts: Registration API client with pagination - Rewrite nuget-api.ts: semver sorting, unlisted version filtering - Set User-Agent: ALCops-AzureDevOps on all NuGet requests - Update ARCHITECTURE.md and copilot-instructions.md No breaking YAML changes: 'latest' and 'prerelease' inputs unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Summary
Migrates the NuGet integration from V2/Flat Container index to V3 Registration API + V3 Flat Container downloads. This matches the approach already used in the VS Code extension (ALCops/vscode-extension#32).
Why
globalcdn.nuget.orgwhere User-Agent is not tracked. V3 Flat Container serves from the trackedapi.nuget.orgCDN.catalogEntry.listedper version.What changed
shared/http-client.tsshared/nuget-registration.tsPromise.all)shared/types.tsNUGET_REGISTRATION_BASEconstant + Registration API interfacestasks/install-analyzers/src/nuget-api.tstasks/install-analyzers/src/task-runner.tsResolvedVersiontype withpackageContentUrltests/shared/nuget-registration.test.tstests/install-analyzers/nuget-api.test.ts.github/ARCHITECTURE.md.github/copilot-instructions.mdNo breaking changes
The YAML contract is unchanged:
latest,prerelease, and specific version strings work as before. The behavioral improvement is that unlisted versions are now filtered out.Tests
199 tests pass (17 new). Build, lint, and bundle all clean.