From 43bfe54383dfe04dc269b715c68b51b65a11b244 Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Thu, 24 Oct 2019 16:44:53 -0400 Subject: [PATCH 1/3] Update to Version 2.160.0 (#144) --- releaseNote.md | 7 +++---- src/runnerversion | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/releaseNote.md b/releaseNote.md index 723e30b7fa3..93eeb6d081e 100644 --- a/releaseNote.md +++ b/releaseNote.md @@ -1,12 +1,11 @@ ## Features - - Set Default shell to powershell for windows runners (#135) - - Use Powershell as fallback if Powershell Core is not available for default shell on windows (#142) + - N/A ## Bugs - - Removed unintended additional fields on error and warning commands (#137) + - N/A ## Misc - - N/A + - Updated to .NET Core 3.0 (#127) ## Agent Downloads diff --git a/src/runnerversion b/src/runnerversion index 4db89d31fae..fef351cca58 100644 --- a/src/runnerversion +++ b/src/runnerversion @@ -1 +1 @@ -2.159.2 \ No newline at end of file +2.160.0 \ No newline at end of file From 757d899847fabe33a0211d0c0dc0daa74558cd1e Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Mon, 28 Oct 2019 11:12:31 -0400 Subject: [PATCH 2/3] Revert "remove issue generation on warning/error commands (#137)" (#147) * Revert "remove issue generation on warning/error commands (#137)" This reverts commit 53da19886768e053ff15beec406709571e091feb. * Updated Release notes --- releaseNote.md | 2 +- src/Runner.Worker/ActionCommandManager.cs | 50 +++++++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/releaseNote.md b/releaseNote.md index 93eeb6d081e..6c57e00259d 100644 --- a/releaseNote.md +++ b/releaseNote.md @@ -2,7 +2,7 @@ - N/A ## Bugs - - N/A + - Reverted removal of additional fields error and warning fields (#147) ## Misc - Updated to .NET Core 3.0 (#127) diff --git a/src/Runner.Worker/ActionCommandManager.cs b/src/Runner.Worker/ActionCommandManager.cs index e3b07840e6b..a1a268d60c2 100644 --- a/src/Runner.Worker/ActionCommandManager.cs +++ b/src/Runner.Worker/ActionCommandManager.cs @@ -436,6 +436,10 @@ public abstract class IssueCommandExtension : RunnerService, IActionCommandExten public void ProcessCommand(IExecutionContext context, string inputLine, ActionCommand command) { + command.Properties.TryGetValue(IssueCommandProperties.File, out string file); + command.Properties.TryGetValue(IssueCommandProperties.Line, out string line); + command.Properties.TryGetValue(IssueCommandProperties.Column, out string column); + Issue issue = new Issue() { Category = "General", @@ -443,8 +447,54 @@ public void ProcessCommand(IExecutionContext context, string inputLine, ActionCo Message = command.Data }; + if (!string.IsNullOrEmpty(file)) + { + issue.Category = "Code"; + + if (context.Container != null) + { + // Translate file path back from container path + file = context.Container.TranslateToHostPath(file); + command.Properties[IssueCommandProperties.File] = file; + } + + // Get the values that represent the server path given a local path + string repoName = context.GetGitHubContext("repository"); + var repoPath = context.GetGitHubContext("workspace"); + + string relativeSourcePath = IOUtil.MakeRelative(file, repoPath); + if (!string.Equals(relativeSourcePath, file, IOUtil.FilePathStringComparison)) + { + // add repo info + if (!string.IsNullOrEmpty(repoName)) + { + command.Properties["repo"] = repoName; + } + + if (!string.IsNullOrEmpty(relativeSourcePath)) + { + // replace sourcePath with the new relative path + // prefer `/` on all platforms + command.Properties[IssueCommandProperties.File] = relativeSourcePath.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); + } + } + } + + foreach (var property in command.Properties) + { + issue.Data[property.Key] = property.Value; + } + context.AddIssue(issue); } + + private static class IssueCommandProperties + { + public const String File = "file"; + public const String Line = "line"; + public const String Column = "col"; + } + } public sealed class GroupCommandExtension : GroupingCommandExtension From 875d17285b1964b2d5a28ac354504b5a4ce6cbbc Mon Sep 17 00:00:00 2001 From: Thomas Boop <52323235+thboop@users.noreply.github.com> Date: Mon, 28 Oct 2019 13:44:09 -0400 Subject: [PATCH 3/3] Users/thboop/port directory changes (#152) * Clear action cache for local runner * update release notes for actions directory cache changes --- releaseNote.md | 1 + 1 file changed, 1 insertion(+) diff --git a/releaseNote.md b/releaseNote.md index 6c57e00259d..34f3aa6a898 100644 --- a/releaseNote.md +++ b/releaseNote.md @@ -3,6 +3,7 @@ ## Bugs - Reverted removal of additional fields error and warning fields (#147) + - Actions cache would incorrectly cache the action if the tag was updated (#148) ## Misc - Updated to .NET Core 3.0 (#127)