From 2243d204a4ab76c2a86e4c47e813b3a5f8cd70c3 Mon Sep 17 00:00:00 2001 From: Samir Boulema Date: Mon, 19 Jun 2023 23:31:55 +0200 Subject: [PATCH] fix: #5 "https://api.nuget.org/v3/index.json" must not be hard-coded --- README.md | 6 +- art/Screenshot.png | Bin 7744 -> 7530 bytes art/Screenshot2.png | Bin 0 -> 8321 bytes src/Services/InfoBarService.cs | 2 +- src/Services/NuGetService.cs | 113 ++++++++++++++++++++++++--------- 5 files changed, 89 insertions(+), 32 deletions(-) create mode 100644 art/Screenshot2.png diff --git a/README.md b/README.md index 02107fa..252c68b 100644 --- a/README.md +++ b/README.md @@ -16,11 +16,13 @@ for the installed NuGet packages for the open solution. ## Installing [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=SamirBoulema.NuGetMonitor) [![Visual Studio Marketplace](https://img.shields.io/vscode-marketplace/v/SamirBoulema.NuGetMonitor.svg?style=flat)](https://marketplace.visualstudio.com/items?itemName=SamirBoulema.NuGetMonitor) -[Github Releases](https://github.com/sboulema/NuGetMonitor/releases) +[GitHub Releases](https://github.com/sboulema/NuGetMonitor/releases) [Open VSIX Gallery](https://www.vsixgallery.com/extension/NuGetMonitor.2a6fbffe-f3fd-4bf8-98cc-5ae2c833a1c7) ## Screenshots +[![Screenshot](https://raw.githubusercontent.com/sboulema/NuGetMonitor/main/art/Screenshot2.png)](https://raw.githubusercontent.com/sboulema/NuGetMonitor/main/art/Screenshot2.png) + [![Screenshot](https://raw.githubusercontent.com/sboulema/NuGetMonitor/main/art/Screenshot.png)](https://raw.githubusercontent.com/sboulema/NuGetMonitor/main/art/Screenshot.png) ## Thanks @@ -30,7 +32,7 @@ A big thanks goes to [AnushaG2201](https://github.com/AnushaG2201)! I was playing with the idea for this extension for quite a while but never figured out how I would create this extension. -That is until I saw the [Nuget-updates-notifier](https://marketplace.visualstudio.com/items?itemName=Anusha.NugetPackageUpdateNotifier) ([Github](https://github.com/AnushaG2201/Nuget-updates-notifier)) which gave me the remaining puzzle pieces, so that I could create my own version. +That is until I saw the [Nuget-updates-notifier](https://marketplace.visualstudio.com/items?itemName=Anusha.NugetPackageUpdateNotifier) ([GitHub](https://github.com/AnushaG2201/Nuget-updates-notifier)) which gave me the remaining puzzle pieces, so that I could create my own version. ### tom-englert A big thanks goes to [tom-englert](https://github.com/tom-englert)! diff --git a/art/Screenshot.png b/art/Screenshot.png index c48975d224e02db24204829362c9970378164854..35a5c33c26931c8e444a3449cc41436be07b3aa2 100644 GIT binary patch literal 7530 zcmYLuWmp_dur&}gKp+q#xVr||#U)69;INBZaCdiy1Sdd%;4B0Uu(-Rs+v4udx4G~A zp8I2@`swbendv&G>U5-vvMlCXqPK8xaG3IPQfhE;@P@E^Q&eQwxgq@E1a^UUR+E*0 zs~9EOhZ%?#;!5Iha8>c>Pew>E8_hvZ#~BXpUDv+@zR$kc6b_E$RbEP5-2-%-h34@= zqrUGIo8rBSX(9~`Rc2Imt&z{KyibG@c_wGM#p`J(mxS+k1thc)Mw`V+Es*6BY#k(3 zK6P}6r>Lq(a8Tt@sG>z)lyr?E)-Xh)4pMR4F1OAAS4s{l4qS?a2JU^=o=Z>E{@U5T z3f?X+0b}Dx1pMGJx;PZUQ`)Q_!;I2&d(GfaR}2_&31PReJ|8MDg7K6T_MOV zv(@N9Muc>Vf8e-aHX6PmtP@8E!Y~I0E}aK1t zny-5q2bMI`!cSXmhc&5k(cgKR0<}0gfi@Oz>m;rJa+%qPb4~Jyb(PV)q6P{DnBt!h5c1Jv1s*!(@R0Fqa#I_24mG18KTxtmq zJ;`oE_5<0iOwFg*AdR7#Ld6Vj>9@z_I$Q;3YQJ1R=L?tJox}e~7Q{u79hSWrmr5?A zIOM<7IMSNXqqoARv#lXPbMDWWsXV+q>B=2W_sIDkp;u&hpMS=3So!jvw900IE`4sG z*q7{BMV_JSpuF$TwTwpgGBYy{C;cPY`FB+){YnV9=I5j9+@VHlPW^`F`tz+&RCX8t z)ir}qd%C&0@(ve<2@;O3eHCrlR4G(G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ac1|ac9V+|isw_$ z5B_;*ji9O&?kdZ zd#L&`O(@hlvN!GlNlzH@gE3Q34 zGXtl@`siN~igGrM3Iver;6Dkzf>}c+=&pHV=^>*q@k*7nbsh@25H<8)+CJeI6!%=X zkq-*8Rq~SRxZp1oQP~dKM8&7{#(A5Vq0*GTZ=2xLG;F!^A7#d_xksJwg+SP<-H zl@H2^h;$&vHD^o-{J3Dp8{?`CU&?5Lxxv-yzK7ORqd8ZC9BNF6@?VFX{J-JzfAI4E zZta{t4ZFSCyy#{Pf&>RJB*f>m9h-pG=q22AwtgX|%{4M53CDoRv{83q0yg9VLT literal 0 HcmV?d00001 diff --git a/src/Services/InfoBarService.cs b/src/Services/InfoBarService.cs index 1beec7b..9b21c2a 100644 --- a/src/Services/InfoBarService.cs +++ b/src/Services/InfoBarService.cs @@ -56,7 +56,7 @@ private static List GetTextSpans(int outdatedCount, int depr if (outdatedCount > 0) { - textSpans.Add(new InfoBarTextSpan($"{outdatedCount} {(outdatedCount == 1 ? "update" : "updates")} available")); + textSpans.Add(new InfoBarTextSpan($"{outdatedCount} {(outdatedCount == 1 ? "update" : "updates")}")); } if (deprecatedCount > 0) diff --git a/src/Services/NuGetService.cs b/src/Services/NuGetService.cs index 6edc528..e1701e3 100644 --- a/src/Services/NuGetService.cs +++ b/src/Services/NuGetService.cs @@ -1,5 +1,4 @@ using NuGet.Common; -using NuGet.Protocol; using NuGet.Protocol.Core.Types; using System.Collections.Generic; using System.Linq; @@ -7,60 +6,72 @@ using System.Threading.Tasks; using NuGet.Packaging.Core; using PackageReference = NuGetMonitor.Models.PackageReference; +using NuGet.Configuration; +using System.IO; +using System; +using Community.VisualStudio.Toolkit; +using Settings = NuGet.Configuration.Settings; namespace NuGetMonitor.Services { public static class NuGetService { - public static async Task> CheckPackageReferences(IReadOnlyCollection packageIdentities) + public static async Task> CheckPackageReferences( + IReadOnlyCollection packageIdentities) { using var sourceCacheContext = new SourceCacheContext(); var identitiesById = packageIdentities.GroupBy(item => item.Id); + var sourceRepositories = await GetSourceRepositories().ConfigureAwait(false); + var result = await Task - .WhenAll(identitiesById.Select(identities => CheckPackageReference(identities, sourceCacheContext))) + .WhenAll(identitiesById.Select(identities => CheckPackageReference(identities, sourceCacheContext, sourceRepositories))) .ConfigureAwait(false); return result; } - private static async Task CheckPackageReference(IGrouping packageIdentities, SourceCacheContext sourceCacheContext) + private static async Task CheckPackageReference( + IGrouping packageIdentities, + SourceCacheContext sourceCacheContext, + IEnumerable sourceRepositories) { - // TODO: read source repositories from nuget.config in solution directory and check all repos - //var packageSourceProvider = new PackageSourceProvider(new Settings(_solutionDirectory)); - //var sourceRepositoryProvider = new SourceRepositoryProvider(packageSourceProvider, Repository.Provider.GetCoreV3()); - //var repositories = sourceRepositoryProvider.GetRepositories().ToArray(); - - var packageMetadataResource = await Repository.Factory - .GetCoreV3("https://api.nuget.org/v3/index.json") - .GetResourceAsync() - .ConfigureAwait(false); - // use the oldest reference with the smallest version var identity = packageIdentities.OrderBy(item => item.Version.Version).First(); - var metadata = await packageMetadataResource - .GetMetadataAsync(identity, sourceCacheContext, NullLogger.Instance, CancellationToken.None) - .ConfigureAwait(false); - - if (metadata == null) + foreach (var sourceRepository in sourceRepositories) { - return new PackageReference(identity); + var packageMetadataResource = await sourceRepository + .GetResourceAsync() + .ConfigureAwait(false); + + var metadata = await packageMetadataResource + .GetMetadataAsync(identity, sourceCacheContext, NullLogger.Instance, CancellationToken.None) + .ConfigureAwait(false); + + if (metadata == null) + { + continue; + } + + return new PackageReference(identity) + { + IsVulnerable = metadata.Vulnerabilities != null, + IsDeprecated = await metadata.GetDeprecationMetadataAsync().ConfigureAwait(false) != null, + IsOutdated = await IsOutdated(identity, sourceCacheContext, sourceRepository).ConfigureAwait(false), + }; } - return new PackageReference(identity) - { - IsVulnerable = metadata.Vulnerabilities != null, - IsDeprecated = await metadata.GetDeprecationMetadataAsync().ConfigureAwait(false) != null, - IsOutdated = await IsOutdated(identity, sourceCacheContext).ConfigureAwait(false), - }; + return new PackageReference(identity); } - private static async Task IsOutdated(PackageIdentity packageIdentity, SourceCacheContext sourceCacheContext) + private static async Task IsOutdated( + PackageIdentity packageIdentity, + SourceCacheContext sourceCacheContext, + SourceRepository sourceRepository) { - var packageResource = await Repository.Factory - .GetCoreV3("https://api.nuget.org/v3/index.json") + var packageResource = await sourceRepository .GetResourceAsync() .ConfigureAwait(false); @@ -72,5 +83,49 @@ private static async Task IsOutdated(PackageIdentity packageIdentity, Sour return latestVersion > packageIdentity.Version; } + + // https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses + private static async Task> GetSourceRepositories() + { + var sourceRepositories = new List(); + + var solution = await VS.Solutions.GetCurrentSolutionAsync().ConfigureAwait(false); + var solutionNuGetConfigPath = Path.GetDirectoryName(solution.FullPath); + + sourceRepositories.AddRange(GetSourceRepositories(solutionNuGetConfigPath)); + + var userNuGetConfigPath = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + "NuGet"); + + sourceRepositories.AddRange(GetSourceRepositories(userNuGetConfigPath)); + + var computerNuGetConfigPath = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), + "NuGet", "Config"); + + sourceRepositories.AddRange( + Directory + .EnumerateFiles(computerNuGetConfigPath, "*.Config") + .SelectMany(path => GetSourceRepositories(computerNuGetConfigPath, Path.GetFileName(path), true))); + + return sourceRepositories + .GroupBy(repository => repository.PackageSource.SourceUri) + .Select(group => group.First()); + } + + private static IEnumerable GetSourceRepositories( + string path, string fileName = "NuGet.Config", bool isMachineWide = false) + { + if (!File.Exists(Path.Combine(path, fileName))) + { + return Enumerable.Empty(); + } + + var packageSourceProvider = new PackageSourceProvider(new Settings(path, fileName, isMachineWide)); + var sourceRepositoryProvider = new SourceRepositoryProvider(packageSourceProvider, Repository.Provider.GetCoreV3()); + var repositories = sourceRepositoryProvider.GetRepositories(); + return repositories; + } } }