Repository navigation
fix(packages): keep and find the GitHub repository of NuGet and pub.dev packages - #6
Merged
Merged
Conversation
…ev packages 14 of 325 cached packages had no GitHub repository, so "View on GitHub" was missing and their notes were never looked for on GitHub. Three causes: - A metadata refresh overwrote the stored repository with the registry's value. NuGet's metadata never carries one, so a repository found while scraping was wiped on the next refresh (Newtonsoft.Json: source "GitHub", repository empty). - NuGet metadata ignored the nuspec. It now reads <repository url> from the flat container (Newtonsoft.Json, System.Text.Json, uuid) and falls back to a GitHub project URL (Bogus, Duende). - A pub.dev page links no repository when the pubspec names GitHub only as its homepage (hive). The pub.dev API's pubspec repository or homepage is used then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
NuGet and pub.dev packages keep the GitHub repository they already had, and find it in more places: the nuspec, a GitHub project URL, and the pubspec through the pub.dev API.
Why
On production, 14 of 325 cached packages have no GitHub repository, so the package page shows no "View on GitHub" and their release notes are never looked for on GitHub. Several of them clearly have one:
<repository>JamesNK/Newtonsoft.Json<repository>dotnet/dotnet<repository>git://github.com/Taiizor/UUIDChanges
PackageCacheService.SaveFreshMetadataToCache: a metadata refresh no longer replaces a stored repository with null. NuGet metadata never had one, so a repository found while scraping was wiped on every refresh.NugetService.GetPackageMetadataAsync: reads<repository url>from the latest version's nuspec in the flat container (one small CDN request, not nuget.org's rate-limited pages), falling back to a GitHub project URL. URLs are normalized byGitHubUrls.FromRepositoryField(git://,.git).PubDevService.GetPackageExtraInfoAsync: when the page links no repository, the pubspecrepository, thenhomepage, is taken fromhttps://pub.dev/api/packages/{id}if it is on GitHub. pub.dev shows no link at all for a homepage-only pubspec.LiveRegistrySmokeTests: passes the HTTP client factoryNugetServicenow takes.Notes for reviewers
@nestjs/core), LINQPad.Reference, Plugin.Maui.Barkoder and EasyDotnet (no repository in their metadata).Checklist
developand is about one thingfeat(scope): ...,fix(scope): ...)src/frontend/src/app/core/models