I'm using the latest nuget client libs to get info about packages from a private package feed.
I can't seem to find any way to get the release notes, though.
I'm using this:
var metadata = await _packageStream.FindPackageAsync(RootNamespace, _configuration.NugetFeedUrl);
But neither metadata nor the versions I can get with
var versions = await metadata.GetVersionsAsync();
have any related property.
On the other hand, the private package feed I use (hosted on TFS 2018 on-prem) displays the release notes just fine, so there must a way of getting at them.
Any hint would be very appreciated,
thanks,
Mark
@ModernRonin I changed the issue title when I thought that the NuGet server API contained the information and just needed client SDK changes, however, looking at the docs for the NuGet server API for metadata resources, I don't see release notes listed. It's also not in the search results. However, the server API does document the ability to download a package's .nuspec file. But since the NuGet client doesn't use this, there's a chance that Azure DevOps/TFS doesn't implement this part of the API.
Also, the NuGet.Procol library is currently tailored to how the rest of the NuGet client uses it, particularly for restore and Visual Studio's Package Manager UI. As it's not a generic library, it doesn't support everything that the NuGet HTTP API supports, so even though the server API defined that the nuspec can be downloaded without downloading the whole nupkg, since nuget.exe, dotnet cli and Visual Studio don't use this, it hasn't been implemented in the NuGet Client SDK.
I assume that your TFS server's NuGet feed is private and therefore you can't write some simple code using HttpClient, because you'll need NuGet's authentication code.
My best suggestion is to first validate whether or not your TFS server implements the direct .nuspec download. You could use Fiddler to capture the HTTP packets with your current program (to find the auth headers), then modify the request and reques the nuspec directly from fiddler to see if TFS provides it or not. If not, your only option is to download all the nupkgs and check them one by one.
If TFS does provide the direct nuspec downlods, then you could investigate the PluginManager to see if you can get the plugin discovery and plugin communication, and get the auth header. Once you have the auth header, you can craft your own HTTP request.
Once you have a nuspec file, the PackageArchiveReader is used to read it. I didn't check if it has a specific API to get the release notes from it.
Thank you for the detailed investigation and explanation!
Most helpful comment
@ModernRonin I changed the issue title when I thought that the NuGet server API contained the information and just needed client SDK changes, however, looking at the docs for the NuGet server API for metadata resources, I don't see release notes listed. It's also not in the search results. However, the server API does document the ability to download a package's
.nuspecfile. But since the NuGet client doesn't use this, there's a chance that Azure DevOps/TFS doesn't implement this part of the API.Also, the NuGet.Procol library is currently tailored to how the rest of the NuGet client uses it, particularly for restore and Visual Studio's Package Manager UI. As it's not a generic library, it doesn't support everything that the NuGet HTTP API supports, so even though the server API defined that the nuspec can be downloaded without downloading the whole nupkg, since nuget.exe, dotnet cli and Visual Studio don't use this, it hasn't been implemented in the NuGet Client SDK.
I assume that your TFS server's NuGet feed is private and therefore you can't write some simple code using HttpClient, because you'll need NuGet's authentication code.
My best suggestion is to first validate whether or not your TFS server implements the direct
.nuspecdownload. You could use Fiddler to capture the HTTP packets with your current program (to find the auth headers), then modify the request and reques the nuspec directly from fiddler to see if TFS provides it or not. If not, your only option is to download all thenupkgs and check them one by one.If TFS does provide the direct
nuspecdownlods, then you could investigate thePluginManagerto see if you can get the plugin discovery and plugin communication, and get the auth header. Once you have the auth header, you can craft your own HTTP request.Once you have a
nuspecfile, thePackageArchiveReaderis used to read it. I didn't check if it has a specific API to get the release notes from it.