Skip to content

Commit 21cb8b2

Browse files
authored
Merge pull request #19638 from martincostello/dotnet-branding
Fix user-facing casing of NuGet
2 parents 9fe031d + 77a6a2d commit 21cb8b2

File tree

19 files changed

+63
-63
lines changed

19 files changed

+63
-63
lines changed

csharp/autobuilder/Semmle.Autobuild.CSharp/CSharpAutobuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private BuildScript AddBuildlessStartedDiagnostic()
113113
"buildless/mode-active",
114114
"C# was extracted with build-mode set to 'none'",
115115
visibility: new DiagnosticMessage.TspVisibility(statusPage: true, cliSummaryTable: true, telemetry: true),
116-
markdownMessage: "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.",
116+
markdownMessage: "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as NuGet and dotnet CLIs, only contributing information about external dependencies.",
117117
severity: DiagnosticMessage.TspSeverity.Note
118118
));
119119

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ public bool Exec(string execArgs)
127127

128128
public IList<string> GetNugetFeeds(string nugetConfig)
129129
{
130-
logger.LogInfo($"Getting Nuget feeds from '{nugetConfig}'...");
130+
logger.LogInfo($"Getting NuGet feeds from '{nugetConfig}'...");
131131
return GetResultList($"{nugetListSourceCommand} --configfile \"{nugetConfig}\"");
132132
}
133133

134134
public IList<string> GetNugetFeedsFromFolder(string folderPath)
135135
{
136-
logger.LogInfo($"Getting Nuget feeds in folder '{folderPath}'...");
136+
logger.LogInfo($"Getting NuGet feeds in folder '{folderPath}'...");
137137
return GetResultList(nugetListSourceCommand, folderPath);
138138
}
139139

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/EnvironmentVariableNames.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ internal static class EnvironmentVariableNames
5555
internal const string NugetFeedResponsivenessRequestCountForFallback = "CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_CHECK_FALLBACK_LIMIT";
5656

5757
/// <summary>
58-
/// Specifies the NuGet feeds to use for fallback Nuget dependency fetching. The value is a space-separated list of feed URLs.
58+
/// Specifies the NuGet feeds to use for fallback NuGet dependency fetching. The value is a space-separated list of feed URLs.
5959
/// The default value is `https://api.nuget.org/v3/index.json`.
6060
/// </summary>
6161
public const string FallbackNugetFeeds = "CODEQL_EXTRACTOR_CSHARP_BUILDLESS_NUGET_FEEDS_FALLBACK";

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/NugetPackageRestorer.cs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,24 @@ public HashSet<AssemblyLookupLocation> Restore()
135135

136136
if (nugetPackageDllPaths.Count > 0)
137137
{
138-
logger.LogInfo($"Restored {nugetPackageDllPaths.Count} Nuget DLLs.");
138+
logger.LogInfo($"Restored {nugetPackageDllPaths.Count} NuGet DLLs.");
139139
}
140140
if (excludedPaths.Count > 0)
141141
{
142-
logger.LogInfo($"Excluding {excludedPaths.Count} Nuget DLLs.");
142+
logger.LogInfo($"Excluding {excludedPaths.Count} NuGet DLLs.");
143143
}
144144

145145
foreach (var excludedPath in excludedPaths)
146146
{
147-
logger.LogInfo($"Excluded Nuget DLL: {excludedPath}");
147+
logger.LogInfo($"Excluded NuGet DLL: {excludedPath}");
148148
}
149149

150150
nugetPackageDllPaths.ExceptWith(excludedPaths);
151151
assemblyLookupLocations.UnionWith(nugetPackageDllPaths.Select(p => new AssemblyLookupLocation(p)));
152152
}
153153
catch (Exception exc)
154154
{
155-
logger.LogError($"Failed to restore Nuget packages with nuget.exe: {exc.Message}");
155+
logger.LogError($"Failed to restore NuGet packages with nuget.exe: {exc.Message}");
156156
}
157157

158158
var restoredProjects = RestoreSolutions(out var container);
@@ -186,7 +186,7 @@ private List<string> GetReachableFallbackNugetFeeds(HashSet<string>? feedsFromNu
186186
if (fallbackFeeds.Count == 0)
187187
{
188188
fallbackFeeds.Add(PublicNugetOrgFeed);
189-
logger.LogInfo($"No fallback Nuget feeds specified. Adding default feed: {PublicNugetOrgFeed}");
189+
logger.LogInfo($"No fallback NuGet feeds specified. Adding default feed: {PublicNugetOrgFeed}");
190190

191191
var shouldAddNugetConfigFeeds = EnvironmentVariables.GetBooleanOptOut(EnvironmentVariableNames.AddNugetConfigFeedsToFallback);
192192
logger.LogInfo($"Adding feeds from nuget.config to fallback restore: {shouldAddNugetConfigFeeds}");
@@ -196,23 +196,23 @@ private List<string> GetReachableFallbackNugetFeeds(HashSet<string>? feedsFromNu
196196
// There are some feeds in `feedsFromNugetConfigs` that have already been checked for reachability, we could skip those.
197197
// But we might use different responsiveness testing settings when we try them in the fallback logic, so checking them again is safer.
198198
fallbackFeeds.UnionWith(feedsFromNugetConfigs);
199-
logger.LogInfo($"Using Nuget feeds from nuget.config files as fallback feeds: {string.Join(", ", feedsFromNugetConfigs.OrderBy(f => f))}");
199+
logger.LogInfo($"Using NuGet feeds from nuget.config files as fallback feeds: {string.Join(", ", feedsFromNugetConfigs.OrderBy(f => f))}");
200200
}
201201
}
202202

203-
logger.LogInfo($"Checking fallback Nuget feed reachability on feeds: {string.Join(", ", fallbackFeeds.OrderBy(f => f))}");
203+
logger.LogInfo($"Checking fallback NuGet feed reachability on feeds: {string.Join(", ", fallbackFeeds.OrderBy(f => f))}");
204204
var (initialTimeout, tryCount) = GetFeedRequestSettings(isFallback: true);
205205
var reachableFallbackFeeds = fallbackFeeds.Where(feed => IsFeedReachable(feed, initialTimeout, tryCount, allowExceptions: false)).ToList();
206206
if (reachableFallbackFeeds.Count == 0)
207207
{
208-
logger.LogWarning("No fallback Nuget feeds are reachable.");
208+
logger.LogWarning("No fallback NuGet feeds are reachable.");
209209
}
210210
else
211211
{
212-
logger.LogInfo($"Reachable fallback Nuget feeds: {string.Join(", ", reachableFallbackFeeds.OrderBy(f => f))}");
212+
logger.LogInfo($"Reachable fallback NuGet feeds: {string.Join(", ", reachableFallbackFeeds.OrderBy(f => f))}");
213213
}
214214

215-
compilationInfoContainer.CompilationInfos.Add(("Reachable fallback Nuget feed count", reachableFallbackFeeds.Count.ToString()));
215+
compilationInfoContainer.CompilationInfos.Add(("Reachable fallback NuGet feed count", reachableFallbackFeeds.Count.ToString()));
216216

217217
return reachableFallbackFeeds;
218218
}
@@ -331,7 +331,7 @@ private void RestoreProjects(IEnumerable<string> projects, HashSet<string>? conf
331331
return DownloadMissingPackages(usedPackageNames, fallbackNugetFeeds: reachableFallbackFeeds);
332332
}
333333

334-
logger.LogWarning("Skipping download of missing packages from specific feeds as no fallback Nuget feeds are reachable.");
334+
logger.LogWarning("Skipping download of missing packages from specific feeds as no fallback NuGet feeds are reachable.");
335335
return null;
336336
}
337337

@@ -624,7 +624,7 @@ private static async Task ExecuteGetRequest(string address, HttpClient httpClien
624624

625625
private bool IsFeedReachable(string feed, int timeoutMilliSeconds, int tryCount, bool allowExceptions = true)
626626
{
627-
logger.LogInfo($"Checking if Nuget feed '{feed}' is reachable...");
627+
logger.LogInfo($"Checking if NuGet feed '{feed}' is reachable...");
628628

629629
// Configure the HttpClient to be aware of the Dependabot Proxy, if used.
630630
HttpClientHandler httpClientHandler = new();
@@ -662,7 +662,7 @@ private bool IsFeedReachable(string feed, int timeoutMilliSeconds, int tryCount,
662662
try
663663
{
664664
ExecuteGetRequest(feed, client, cts.Token).GetAwaiter().GetResult();
665-
logger.LogInfo($"Querying Nuget feed '{feed}' succeeded.");
665+
logger.LogInfo($"Querying NuGet feed '{feed}' succeeded.");
666666
return true;
667667
}
668668
catch (Exception exc)
@@ -671,19 +671,19 @@ private bool IsFeedReachable(string feed, int timeoutMilliSeconds, int tryCount,
671671
tce.CancellationToken == cts.Token &&
672672
cts.Token.IsCancellationRequested)
673673
{
674-
logger.LogInfo($"Didn't receive answer from Nuget feed '{feed}' in {timeoutMilliSeconds}ms.");
674+
logger.LogInfo($"Didn't receive answer from NuGet feed '{feed}' in {timeoutMilliSeconds}ms.");
675675
timeoutMilliSeconds *= 2;
676676
continue;
677677
}
678678

679679
// We're only interested in timeouts.
680680
var start = allowExceptions ? "Considering" : "Not considering";
681-
logger.LogInfo($"Querying Nuget feed '{feed}' failed in a timely manner. {start} the feed for use. The reason for the failure: {exc.Message}");
681+
logger.LogInfo($"Querying NuGet feed '{feed}' failed in a timely manner. {start} the feed for use. The reason for the failure: {exc.Message}");
682682
return allowExceptions;
683683
}
684684
}
685685

686-
logger.LogWarning($"Didn't receive answer from Nuget feed '{feed}'. Tried it {tryCount} times.");
686+
logger.LogWarning($"Didn't receive answer from NuGet feed '{feed}'. Tried it {tryCount} times.");
687687
return false;
688688
}
689689

@@ -694,20 +694,20 @@ private bool IsFeedReachable(string feed, int timeoutMilliSeconds, int tryCount,
694694
: int.TryParse(Environment.GetEnvironmentVariable(EnvironmentVariableNames.NugetFeedResponsivenessInitialTimeout), out timeoutMilliSeconds)
695695
? timeoutMilliSeconds
696696
: 1000;
697-
logger.LogDebug($"Initial timeout for Nuget feed reachability check is {timeoutMilliSeconds}ms.");
697+
logger.LogDebug($"Initial timeout for NuGet feed reachability check is {timeoutMilliSeconds}ms.");
698698

699699
int tryCount = isFallback && int.TryParse(Environment.GetEnvironmentVariable(EnvironmentVariableNames.NugetFeedResponsivenessRequestCountForFallback), out tryCount)
700700
? tryCount
701701
: int.TryParse(Environment.GetEnvironmentVariable(EnvironmentVariableNames.NugetFeedResponsivenessRequestCount), out tryCount)
702702
? tryCount
703703
: 4;
704-
logger.LogDebug($"Number of tries for Nuget feed reachability check is {tryCount}.");
704+
logger.LogDebug($"Number of tries for NuGet feed reachability check is {tryCount}.");
705705

706706
return (timeoutMilliSeconds, tryCount);
707707
}
708708

709709
/// <summary>
710-
/// Checks that we can connect to all Nuget feeds that are explicitly configured in configuration files
710+
/// Checks that we can connect to all NuGet feeds that are explicitly configured in configuration files
711711
/// as well as any private package registry feeds that are configured.
712712
/// </summary>
713713
/// <param name="explicitFeeds">Outputs the set of explicit feeds.</param>
@@ -727,46 +727,46 @@ private bool CheckFeeds(out HashSet<string> explicitFeeds, out HashSet<string> a
727727
var inheritedFeeds = allFeeds.Except(explicitFeeds).ToHashSet();
728728
if (inheritedFeeds.Count > 0)
729729
{
730-
logger.LogInfo($"Inherited Nuget feeds (not checked for reachability): {string.Join(", ", inheritedFeeds.OrderBy(f => f))}");
731-
compilationInfoContainer.CompilationInfos.Add(("Inherited Nuget feed count", inheritedFeeds.Count.ToString()));
730+
logger.LogInfo($"Inherited NuGet feeds (not checked for reachability): {string.Join(", ", inheritedFeeds.OrderBy(f => f))}");
731+
compilationInfoContainer.CompilationInfos.Add(("Inherited NuGet feed count", inheritedFeeds.Count.ToString()));
732732
}
733733

734734
return allFeedsReachable;
735735
}
736736

737737
/// <summary>
738-
/// Checks that we can connect to the specified Nuget feeds.
738+
/// Checks that we can connect to the specified NuGet feeds.
739739
/// </summary>
740740
/// <param name="feeds">The set of package feeds to check.</param>
741741
/// <returns>True if all feeds are reachable or false otherwise.</returns>
742742
private bool CheckSpecifiedFeeds(HashSet<string> feeds)
743743
{
744-
logger.LogInfo("Checking that Nuget feeds are reachable...");
744+
logger.LogInfo("Checking that NuGet feeds are reachable...");
745745

746746
var excludedFeeds = EnvironmentVariables.GetURLs(EnvironmentVariableNames.ExcludedNugetFeedsFromResponsivenessCheck)
747747
.ToHashSet();
748748

749749
if (excludedFeeds.Count > 0)
750750
{
751-
logger.LogInfo($"Excluded Nuget feeds from responsiveness check: {string.Join(", ", excludedFeeds.OrderBy(f => f))}");
751+
logger.LogInfo($"Excluded NuGet feeds from responsiveness check: {string.Join(", ", excludedFeeds.OrderBy(f => f))}");
752752
}
753753

754754
var (initialTimeout, tryCount) = GetFeedRequestSettings(isFallback: false);
755755

756756
var allFeedsReachable = feeds.All(feed => excludedFeeds.Contains(feed) || IsFeedReachable(feed, initialTimeout, tryCount));
757757
if (!allFeedsReachable)
758758
{
759-
logger.LogWarning("Found unreachable Nuget feed in C# analysis with build-mode 'none'. This may cause missing dependencies in the analysis.");
759+
logger.LogWarning("Found unreachable NuGet feed in C# analysis with build-mode 'none'. This may cause missing dependencies in the analysis.");
760760
diagnosticsWriter.AddEntry(new DiagnosticMessage(
761761
Language.CSharp,
762762
"buildless/unreachable-feed",
763-
"Found unreachable Nuget feed in C# analysis with build-mode 'none'",
763+
"Found unreachable NuGet feed in C# analysis with build-mode 'none'",
764764
visibility: new DiagnosticMessage.TspVisibility(statusPage: true, cliSummaryTable: true, telemetry: true),
765-
markdownMessage: "Found unreachable Nuget feed in C# analysis with build-mode 'none'. This may cause missing dependencies in the analysis.",
765+
markdownMessage: "Found unreachable NuGet feed in C# analysis with build-mode 'none'. This may cause missing dependencies in the analysis.",
766766
severity: DiagnosticMessage.TspSeverity.Note
767767
));
768768
}
769-
compilationInfoContainer.CompilationInfos.Add(("All Nuget feeds reachable", allFeedsReachable ? "1" : "0"));
769+
compilationInfoContainer.CompilationInfos.Add(("All NuGet feeds reachable", allFeedsReachable ? "1" : "0"));
770770

771771
return allFeedsReachable;
772772
}
@@ -808,11 +808,11 @@ private IEnumerable<string> GetFeeds(Func<IList<string>> getNugetFeeds)
808808

809809
if (explicitFeeds.Count > 0)
810810
{
811-
logger.LogInfo($"Found {explicitFeeds.Count} Nuget feeds in nuget.config files: {string.Join(", ", explicitFeeds.OrderBy(f => f))}");
811+
logger.LogInfo($"Found {explicitFeeds.Count} NuGet feeds in nuget.config files: {string.Join(", ", explicitFeeds.OrderBy(f => f))}");
812812
}
813813
else
814814
{
815-
logger.LogDebug("No Nuget feeds found in nuget.config files.");
815+
logger.LogDebug("No NuGet feeds found in nuget.config files.");
816816
}
817817

818818
// todo: this could be improved.
@@ -844,7 +844,7 @@ private IEnumerable<string> GetFeeds(Func<IList<string>> getNugetFeeds)
844844
allFeeds = GetFeeds(() => dotnet.GetNugetFeedsFromFolder(this.fileProvider.SourceDir.FullName)).ToHashSet();
845845
}
846846

847-
logger.LogInfo($"Found {allFeeds.Count} Nuget feeds (with inherited ones) in nuget.config files: {string.Join(", ", allFeeds.OrderBy(f => f))}");
847+
logger.LogInfo($"Found {allFeeds.Count} NuGet feeds (with inherited ones) in nuget.config files: {string.Join(", ", allFeeds.OrderBy(f => f))}");
848848

849849
return (explicitFeeds, allFeeds);
850850
}

csharp/ql/integration-tests/all-platforms/binlog/diagnostics.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
}
1515
{
16-
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.",
16+
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as NuGet and dotnet CLIs, only contributing information about external dependencies.",
1717
"severity": "note",
1818
"source": {
1919
"extractorName": "csharp",

csharp/ql/integration-tests/all-platforms/binlog_multiple/diagnostics.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
}
1515
{
16-
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.",
16+
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as NuGet and dotnet CLIs, only contributing information about external dependencies.",
1717
"severity": "note",
1818
"source": {
1919
"extractorName": "csharp",

csharp/ql/integration-tests/all-platforms/standalone/diagnostics.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
}
1515
{
16-
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.",
16+
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as NuGet and dotnet CLIs, only contributing information about external dependencies.",
1717
"severity": "note",
1818
"source": {
1919
"extractorName": "csharp",

csharp/ql/integration-tests/all-platforms/standalone_buildless_option/diagnostics.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
}
1515
{
16-
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.",
16+
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as NuGet and dotnet CLIs, only contributing information about external dependencies.",
1717
"severity": "note",
1818
"source": {
1919
"extractorName": "csharp",

csharp/ql/integration-tests/all-platforms/standalone_failed/diagnostics.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
}
1414
}
1515
{
16-
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as Nuget and Dotnet CLIs, only contributing information about external dependencies.",
16+
"markdownMessage": "C# was extracted with build-mode set to 'none'. This means that all C# source in the working directory will be scanned, with build tools, such as NuGet and dotnet CLIs, only contributing information about external dependencies.",
1717
"severity": "note",
1818
"source": {
1919
"extractorName": "csharp",

csharp/ql/integration-tests/all-platforms/standalone_resx/CompilationInfo.expected

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
| All Nuget feeds reachable | 1.0 |
1+
| All NuGet feeds reachable | 1.0 |
22
| Failed project restore with package source error | 0.0 |
33
| Failed solution restore with package source error | 0.0 |
4-
| Inherited Nuget feed count | 1.0 |
4+
| Inherited NuGet feed count | 1.0 |
55
| NuGet feed responsiveness checked | 1.0 |
66
| Project files on filesystem | 1.0 |
7-
| Reachable fallback Nuget feed count | 1.0 |
7+
| Reachable fallback NuGet feed count | 1.0 |
88
| Resource extraction enabled | 1.0 |
99
| Restored .NET framework variants | 1.0 |
1010
| Restored projects through solution files | 0.0 |

0 commit comments

Comments
 (0)