Skip to content

Commit

Permalink
Merge branch 'hotfix/5.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Jun 18, 2021
2 parents 6ad41c2 + 36cb168 commit a69c742
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [5.2.1] / 2021-06-18
- Fixed telemetry
- Fixed humanized string concatenation

## [5.2.0] / 2021-06-18
- Added telemetry data collection
- Added unified `NukeBuild.Partition` property
Expand Down Expand Up @@ -806,7 +810,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added CLT tasks for Git
- Fixed background color in console output

[vNext]: https://github.com/nuke-build/nuke.git/compare/5.2.0...HEAD
[vNext]: https://github.com/nuke-build/nuke.git/compare/5.2.1...HEAD
[5.2.1]: https://github.com/nuke-build/nuke.git/compare/5.2.0...5.2.1
[5.2.0]: https://github.com/nuke-build/nuke.git/compare/5.1.4...5.2.0
[5.1.4]: https://github.com/nuke-build/nuke.git/compare/5.1.3...5.1.4
[5.1.3]: https://github.com/nuke-build/nuke.git/compare/5.1.2...5.1.3
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ internal static AbsolutePath TryGetRootDirectoryFrom(string startDirectory, bool
predicate: x =>
x.GetDirectories(NukeDirectoryName).Any() ||
includeLegacy && x.GetFiles(NukeFileName).Any());
return rootDirectory != GlobalNukeDirectory ? rootDirectory : null;
return rootDirectory != GlobalNukeDirectory.Parent ? rootDirectory : null;
}

internal static bool IsLegacy(AbsolutePath rootDirectory)
Expand Down
11 changes: 6 additions & 5 deletions source/Nuke.Common/Execution/Telemetry.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,17 @@ public static void AddPackage()
.AddDictionary(GetRepositoryProperties(EnvironmentInfo.WorkingDirectory)));
}

private static void TrackEvent(
string eventName,
IDictionary<string, string> properties)
private static void TrackEvent(string eventName, IDictionary<string, string> properties)
{
if (s_client == null)
return;

Logger.Trace($"Sending '{eventName}' telemetry event...");
var longestPropertyName = properties.Keys.Max(x => x.Length);
properties.OrderBy(x => x.Key).ForEach(x => Logger.Trace($" {x.Key.PadRight(longestPropertyName)} = {x.Value ?? "<null>"}"));

s_client?.TrackEvent(eventName, properties);
s_client?.Flush();
s_client.TrackEvent(eventName, properties);
s_client.Flush();
}
}
}
2 changes: 1 addition & 1 deletion source/Nuke.Common/Execution/Telemetry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static Telemetry()
string GetCookieFile(string name, int version)
=> Constants.GlobalNukeDirectory / "telemetry-awareness" / $"v{version}" / name;

if (NukeBuild.BuildProjectFile == null)
if (SuppressErrors(() => NukeBuild.BuildProjectFile, logWarning: false) == null)
{
var cookieName = Assembly.GetEntryAssembly().NotNull().GetName().Name;
var cookieFile = GetCookieFile(cookieName, CurrentVersion);
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Common/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static void WriteTest()

internal static OutputSink OutputSink = OutputSink.Default;

public static LogLevel LogLevel;
public static LogLevel LogLevel = LogLevel.Normal;

public static IDisposable Block(string text)
{
Expand Down
4 changes: 2 additions & 2 deletions source/Nuke.Common/Utilities/String.Join.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static string JoinCommaOr(this IEnumerable<string> values)
{
var valuesList = values.ToArray();
return valuesList.Length >= 2
? valuesList.Reverse().Skip(1).Reverse().JoinComma() + ", or " + valuesList.Last()
? valuesList.Reverse().Skip(1).Reverse().JoinComma() + $"{(valuesList.Length > 2 ? "," : string.Empty)} or " + valuesList.Last()
: valuesList.JoinComma();
}

Expand All @@ -49,7 +49,7 @@ public static string JoinCommaAnd(this IEnumerable<string> values)
{
var valuesList = values.ToArray();
return valuesList.Length >= 2
? valuesList.Reverse().Skip(1).Reverse().JoinComma() + ", and " + valuesList.Last()
? valuesList.Reverse().Skip(1).Reverse().JoinComma() + $"{(valuesList.Length > 2 ? "," : string.Empty)} and " + valuesList.Last()
: valuesList.JoinComma();
}

Expand Down

0 comments on commit a69c742

Please sign in to comment.