-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Users should be able to see package repository metadata #4941
Comments
I liked this idea to showing |
Not to rain on this proposal, but here is an argument against adding a repository link. In my opinion repository url was added to eventually get to a Switch PackageReference -> Project from Source feature, which is a common ask. The repository has It should be possible to write a tool to read the nuspec, and if it has type git, it runs I also think that there is minimal value in having 2 project urls, if the repository web site is important, the project url should link to it, or the site it goes to should link to it. I'm not sure how useful it would be, but I would rather see nuget.org read the actual git respository and surface information about whether or not the project is still active. |
I don't have a strong opinion here, but there is definitely needs to be some documentation about what the value means. As it stands today, users are guessing. |
@natemcmaster On our radar for sure. Not up in the backlog yet. We will factor this into NuGet Package Debugging & Symbols Improvements /cc: @diverdan92 |
A customer created a PR: NuGet/docs.microsoft.com-nuget#900 |
Documentation proposed: NuGet/docs.microsoft.com-nuget#930 |
So we would need to push this forward. Here's how the landscape look in terms of package management. NPM does it on the first page and even allow to split between the Homepage and the Repository URL. If we look at Newtonsoft, even thought they had the attribute for a while now... It still does not show up in the project description. It doesn't look like something that is hard to implement since the nuspec doesn't need to be changed. Is it something that can be PR'd? /cc @spboyer |
@MaximRouiller good timing. I was thinking about this last night too and drafted this PR: #6151 |
Pinging this to keep this alive. We have a PR, we don't have any spec... I'd love an estimated timeframe on when we plan on getting this solved/merged. |
I'd also love to get the PR merged. There is an internal email thread going on this one, and it seems like there are two things holding this up:
|
The work we decided to do here:
|
Where is the spec for this? cc: @anangaur, @diverdan92 |
Spec announced at NuGet/Announcements#30 |
Hey @emgarten, just wondering if there's a github issue tracking this? I'm also interested in this feature. Thanks and sorry for hijacking the thread for this. |
On the .NET Core side, we have this issue: dotnet/sdk#1151 |
Mmm, not sure I misunderstood the feature then; I was thinking it's more to do with NuGet rather than .NET Core. (More info: ctaggart/SourceLink#320) |
I think what @emgarten was suggesting was that you could use repository url and commit data from the package nuspec to replace a PackageReference with a source code (i.e a ProjectReference). Implementing this would likely require an SDK change (dotnet/sdk#1151 is about making it possible to swap a PackageRef for a ProjectRef) and some NuGet features to fetch source code based on package metadata. This feature outside the scope of what this particular issue is about. Not sure if an issue exists on the NuGet side to actually build this feature. |
Overview
Since August 2016, the NuGet package manifest (.nuspec) has supported the
<repository>
XML element. This is an optional metadata element with two optional attributes:type
andurl
. Presumably, the purpose of this element is to communicate to package consumers the version control type and location of the source code used to produce the package.Currently, I see no NuGet documentation about this property and no support for it in the various NuGet UIs (Visual Studio and the nuget.org web gallery).
This metadata adds additional valuable information about a package that augments the existing
<projectUrl>
package metadata field. Project URL seems to me like a "product" or "company" specific website and repository URL is where the source code (and maybe even bug tracker) lives. If a project has project site that is different than their GitHub repository, this differentiation is helpful to package consumers.This property is already widely adopted on nuget.org but is not surfaced in any UI or used for any scenario. Let's give an easy win to our package consumers!
History
As far as I can tell, the repository metadata has the following history:
type
is added to the project.json schema (PR)repository
node is added to project.json fordnu sources
(announcement)dnu sources
and therepository
node are removed (announcement)url
is added to the project.json schema (PR)packOptions
(PR)packOptions
is announced (accouncement)<repository>
to the .nuspec and to the .csproj (commit)packOptions
(PR)dev
branch (PR)This is an odd history that indicates decent support and documentation when it was initially implemented by the ASP.NET but has since fallen to the wayside when it was adopted by the NuGet team.
Usage on nuget.org
I walked the entire nuget.org catalog (source) and gathered the following information concerning the real life usage of
<repository>
. This data is up-to-date as of November 1, 2017.Some high level points about packages with
<repository>
metadata:<repository>
metadata.type
attribute.url
attribute. 225 don't have aurl
attribute.System.Uri
. 189 are not parsable.type
attribute havegit
(case insensitive).type
attribute balue isGitHub
(1,977 packages).url
attribute have "https://" URLs.url
attribute have "http://" URLs.url
attribute have "git://" URLs.The top 10 packages that have
<repository>
are:Proposal
Document the thing!
There is a huge variety of
type
andurl
values. We should document:In my opinion we should strongly suggest
http://
orhttps://
URLs that are intended for viewing in web browsers, as opposed to, say,.git
URLs: https://github.com/NuGet/NuGetGallery.git. This allows us to make clickable links in VS or in the browser, after all.git://
links are nice because you can probably rungit clone
directly on them, but this is still achievable withhttp://
orhttps://
links by just navigating there in your browser and find the inevitable "copy clone command" button (e.g. on GitHub).Show the thing!
Let's make the repository URL clickable in the NuGet UIs!
If the repository URL is
http://
orhttps://
, show this link, just like the project URL.An analogous change should be made by the VS client.
Thoughts?
The text was updated successfully, but these errors were encountered: