NuGetGallery
NuGetGallery copied to clipboard
[NuGet.org Bug]: Source repo is listed as dependent repo
Impact
It's more difficult to complete my work
Describe the bug
If you go to https://www.nuget.org/packages/Enums.NET, you will see that the source repo is listed in Github repo list.
Repro Steps
- Go to https://www.nuget.org/packages/Enums.NET
- Switch to Used By tab
- scroll down to the Github repo list section.
Expected Behavior
The source repo should not be listed as depdenent repo. I don't see this issue in other nuget packages.
Screenshots
Additional Context and logs
No response
The reason this is showing up is because that repository has a PackageReference to the package: https://github.com/TylerBrinkley/Enums.NET/blob/a35664d000fb3e7c4f75ec303b8dc419837ab0d4/Src/Enums.NET.Analyzer.Test/Enums.NET.Analyzer.Test.csproj#L8
Most source repositories don't depend on the package that the repository itself produces (it's a bit of a chicken and egg problem).
This is an interesting edge case we haven't considered. I'm not sure if this is actually a bug per se. It depends on what the package consumer (the viewer of this page) wants from the information. If they want to see samples for the package use, any repository that has the PackageReference is a good source of information. That being said, this link is essentially duplicate information from the repository link higher up on the page.
This should be simple enough to filter out the repository itself when we're rendering the page. Unfortunately we only keep 5 repositories in the data cache meaning this case would show 4 repos. Maybe we cache 6, filter out up to 1 in the package details package, and then take the top 5. https://github.com/NuGet/NuGetGallery/blob/f1833049a093fa2def626d9f29e8d388d947fa07/src/NuGetGallery.Core/GitHub/NuGetPackageGitHubInformation.cs#L12-L28 https://github.com/NuGet/NuGetGallery/blob/f1833049a093fa2def626d9f29e8d388d947fa07/src/NuGetGallery/Views/Packages/DisplayPackage.cshtml#L842 It's a bit hacky but simple enough.
Hi, I am new to open-source contributing and I would love to learn more. May I try taking on this task?
You're welcome to contribute for this issue, after making changes please include the screenshot into PR. Please read https://github.com/NuGet/NuGetGallery/blob/main/CONTRIBUTING.md for how to contribute.
Thanks.