diff --git a/releaseNote.md b/releaseNote.md index f14e31da1..c497aecac 100644 --- a/releaseNote.md +++ b/releaseNote.md @@ -1,11 +1,18 @@ ## Features +- Allow setting default severity to "notice" (#1213) +- Show More Step Information in composite Actions (#1279) + ## Bugs +- Temporary fix for macOS runner upgrade crash loop. (#1304) - Fixed an issue where GHES runners fail to download public docker images (#1199) ## Misc +- Update error to say 'uninstall' not 'unconfigure' (#1179) +- Typo fixed (#1289) + ## Windows x64 We recommend configuring the runner in a root folder of the Windows drive (e.g. "C:\actions-runner"). This will help avoid issues related to service identity folder permissions and long file path restrictions on Windows. diff --git a/src/Misc/layoutbin/update.sh.template b/src/Misc/layoutbin/update.sh.template index ad542cc5c..38b31a546 100755 --- a/src/Misc/layoutbin/update.sh.template +++ b/src/Misc/layoutbin/update.sh.template @@ -118,6 +118,43 @@ then exit 1 fi +# fix upgrade issue with macOS +currentplatform=$(uname | awk '{print tolower($0)}') +if [[ "$currentplatform" == 'darwin' ]]; then + # need a short-term fix for https://github.com/actions/runner/issues/743 + # we will recreate all the ./externals/node12/bin/node of the past 5 versions + # v2.280.3 v2.280.2 v2.280.1 v2.279.0 v2.278.0 + if [[ ! -e "$rootfolder/externals.2.280.3/node12/bin/node" ]] + then + mkdir -p "$rootfolder/externals.2.280.3/node12/bin" + cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.280.3/node12/bin/node" + fi + + if [[ ! -e "$rootfolder/externals.2.280.2/node12/bin/node" ]] + then + mkdir -p "$rootfolder/externals.2.280.2/node12/bin" + cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.280.2/node12/bin/node" + fi + + if [[ ! -e "$rootfolder/externals.2.280.1/node12/bin/node" ]] + then + mkdir -p "$rootfolder/externals.2.280.1/node12/bin" + cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.280.1/node12/bin/node" + fi + + if [[ ! -e "$rootfolder/externals.2.279.0/node12/bin/node" ]] + then + mkdir -p "$rootfolder/externals.2.279.0/node12/bin" + cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.279.0/node12/bin/node" + fi + + if [[ ! -e "$rootfolder/externals.2.278.0/node12/bin/node" ]] + then + mkdir -p "$rootfolder/externals.2.278.0/node12/bin" + cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.278.0/node12/bin/node" + fi +fi + date "+[%F %T-%4N] Update succeed" >> "$logfile" # rename the update log file with %logfile%.succeed/.failed/succeedneedrestart diff --git a/src/Runner.Listener/Configuration/ConfigurationManager.cs b/src/Runner.Listener/Configuration/ConfigurationManager.cs index e50101591..07880240b 100644 --- a/src/Runner.Listener/Configuration/ConfigurationManager.cs +++ b/src/Runner.Listener/Configuration/ConfigurationManager.cs @@ -347,12 +347,9 @@ namespace GitHub.Runner.Listener.Configuration _term.WriteLine(); _term.WriteSuccessMessage("Runner service removed"); -#elif OS_LINUX - // unconfig system D service first - throw new Exception("Unconfigure service first"); -#elif OS_OSX - // unconfig osx service first - throw new Exception("Unconfigure service first"); +#else + // unconfig systemd or osx service first + throw new Exception("Uninstall service first"); #endif } diff --git a/src/Runner.Listener/SelfUpdater.cs b/src/Runner.Listener/SelfUpdater.cs index 92ed0ce73..9aacf336c 100644 --- a/src/Runner.Listener/SelfUpdater.cs +++ b/src/Runner.Listener/SelfUpdater.cs @@ -74,10 +74,12 @@ namespace GitHub.Runner.Listener await jobDispatcher.WaitAsync(token); Trace.Info($"All running job has exited."); + // We need to keep runner backup around for macOS until we fixed https://github.com/actions/runner/issues/743 +#if !OS_OSX // delete runner backup DeletePreviousVersionRunnerBackup(token); Trace.Info($"Delete old version runner backup."); - +#endif // generate update script from template await UpdateRunnerUpdateStateAsync("Generate and execute update script."); @@ -96,7 +98,7 @@ namespace GitHub.Runner.Listener invokeScript.Start(); Trace.Info($"Update script start running"); - await UpdateRunnerUpdateStateAsync("Runner will exit shortly for update, should back online within 10 seconds."); + await UpdateRunnerUpdateStateAsync("Runner will exit shortly for update, should be back online within 10 seconds."); return true; } diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 6df943f5d..dea12711b 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -980,18 +980,6 @@ namespace GitHub.Runner.Worker context.Write(null, message); } - public static void WriteDetails(this IExecutionContext context, string message) - { - if (context.IsEmbedded) - { - context.Debug(message); - } - else - { - context.Output(message); - } - } - // Do not add a format string overload. See comment on ExecutionContext.Write(). public static void Command(this IExecutionContext context, string message) { diff --git a/src/Runner.Worker/Handlers/ContainerActionHandler.cs b/src/Runner.Worker/Handlers/ContainerActionHandler.cs index b226d09e1..a74275ba1 100644 --- a/src/Runner.Worker/Handlers/ContainerActionHandler.cs +++ b/src/Runner.Worker/Handlers/ContainerActionHandler.cs @@ -50,8 +50,8 @@ namespace GitHub.Runner.Worker.Handlers var dockerFile = Path.Combine(ActionDirectory, Data.Image); ArgUtil.File(dockerFile, nameof(Data.Image)); - ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "Building docker image" : $"##[group]Building docker image"); - ExecutionContext.WriteDetails($"Dockerfile for action: '{dockerFile}'."); + ExecutionContext.Output($"##[group]Building docker image"); + ExecutionContext.Output($"Dockerfile for action: '{dockerFile}'."); var imageName = $"{dockerManager.DockerInstanceLabel}:{ExecutionContext.Id.ToString("N")}"; var buildExitCode = await dockerManager.DockerBuild( ExecutionContext, @@ -59,7 +59,7 @@ namespace GitHub.Runner.Worker.Handlers dockerFile, Directory.GetParent(dockerFile).FullName, imageName); - ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "" : "##[endgroup]"); + ExecutionContext.Output("##[endgroup]"); if (buildExitCode != 0) { diff --git a/src/Runner.Worker/Handlers/Handler.cs b/src/Runner.Worker/Handlers/Handler.cs index 08ff037af..bd70c0d8e 100644 --- a/src/Runner.Worker/Handlers/Handler.cs +++ b/src/Runner.Worker/Handlers/Handler.cs @@ -82,7 +82,7 @@ namespace GitHub.Runner.Worker.Handlers if (stage == ActionRunStage.Post) { - ExecutionContext.WriteDetails($"Post job cleanup."); + ExecutionContext.Output($"Post job cleanup."); return; } @@ -118,30 +118,30 @@ namespace GitHub.Runner.Worker.Handlers groupName = "Action details"; } - ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? groupName : $"##[group]{groupName}"); + ExecutionContext.Output($"##[group]{groupName}"); if (this.Inputs?.Count > 0) { - ExecutionContext.WriteDetails("with:"); + ExecutionContext.Output("with:"); foreach (var input in this.Inputs) { if (!string.IsNullOrEmpty(input.Value)) { - ExecutionContext.WriteDetails($" {input.Key}: {input.Value}"); + ExecutionContext.Output($" {input.Key}: {input.Value}"); } } } if (this.Environment?.Count > 0) { - ExecutionContext.WriteDetails("env:"); + ExecutionContext.Output("env:"); foreach (var env in this.Environment) { - ExecutionContext.WriteDetails($" {env.Key}: {env.Value}"); + ExecutionContext.Output($" {env.Key}: {env.Value}"); } } - ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "" : "##[endgroup]"); + ExecutionContext.Output("##[endgroup]"); } public override void Initialize(IHostContext hostContext) diff --git a/src/Runner.Worker/Handlers/ScriptHandler.cs b/src/Runner.Worker/Handlers/ScriptHandler.cs index b5c04ebc0..da395c27a 100644 --- a/src/Runner.Worker/Handlers/ScriptHandler.cs +++ b/src/Runner.Worker/Handlers/ScriptHandler.cs @@ -40,7 +40,7 @@ namespace GitHub.Runner.Worker.Handlers firstLine = firstLine.Substring(0, firstNewLine); } - ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? $"Run {firstLine}" : $"##[group]Run {firstLine}"); + ExecutionContext.Output($"##[group]Run {firstLine}"); } else { @@ -51,7 +51,7 @@ namespace GitHub.Runner.Worker.Handlers foreach (var line in multiLines) { // Bright Cyan color - ExecutionContext.WriteDetails($"\x1b[36;1m{line}\x1b[0m"); + ExecutionContext.Output($"\x1b[36;1m{line}\x1b[0m"); } string argFormat; @@ -110,23 +110,23 @@ namespace GitHub.Runner.Worker.Handlers if (!string.IsNullOrEmpty(shellCommandPath)) { - ExecutionContext.WriteDetails($"shell: {shellCommandPath} {argFormat}"); + ExecutionContext.Output($"shell: {shellCommandPath} {argFormat}"); } else { - ExecutionContext.WriteDetails($"shell: {shellCommand} {argFormat}"); + ExecutionContext.Output($"shell: {shellCommand} {argFormat}"); } if (this.Environment?.Count > 0) { - ExecutionContext.WriteDetails("env:"); + ExecutionContext.Output("env:"); foreach (var env in this.Environment) { - ExecutionContext.WriteDetails($" {env.Key}: {env.Value}"); + ExecutionContext.Output($" {env.Key}: {env.Value}"); } } - ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "" : "##[endgroup]"); + ExecutionContext.Output("##[endgroup]"); } public async Task RunAsync(ActionRunStage stage) diff --git a/src/Runner.Worker/IssueMatcher.cs b/src/Runner.Worker/IssueMatcher.cs index 3b4374226..0a6eb0fc4 100644 --- a/src/Runner.Worker/IssueMatcher.cs +++ b/src/Runner.Worker/IssueMatcher.cs @@ -350,6 +350,7 @@ namespace GitHub.Runner.Worker case "": case "ERROR": case "WARNING": + case "NOTICE": break; default: throw new ArgumentException($"Matcher '{_owner}' contains unexpected default severity '{_severity}'"); diff --git a/src/Test/L0/Worker/IssueMatcherL0.cs b/src/Test/L0/Worker/IssueMatcherL0.cs index bc83bfc9f..aae92f3cc 100644 --- a/src/Test/L0/Worker/IssueMatcherL0.cs +++ b/src/Test/L0/Worker/IssueMatcherL0.cs @@ -392,6 +392,35 @@ namespace GitHub.Runner.Common.Tests.Worker Assert.Equal("not-working", match.Message); } + [Fact] + [Trait("Level", "L0")] + [Trait("Category", "Worker")] + public void Matcher_MultiplePatterns_DefaultSeverityNotice() + { + var config = JsonUtility.FromString(@" +{ + ""problemMatcher"": [ + { + ""owner"": ""myMatcher"", + ""severity"": ""notice"", + ""pattern"": [ + { + ""regexp"": ""^(.+)$"", + ""message"": 1 + } + ] + } + ] +} +"); + config.Validate(); + var matcher = new IssueMatcher(config.Matchers[0], TimeSpan.FromSeconds(1)); + + var match = matcher.Match("just-a-notice"); + Assert.Equal("notice", match.Severity); + Assert.Equal("just-a-notice", match.Message); + } + [Fact] [Trait("Level", "L0")] [Trait("Category", "Worker")] diff --git a/src/runnerversion b/src/runnerversion index d1c6de93d..74a52c279 100644 --- a/src/runnerversion +++ b/src/runnerversion @@ -1 +1 @@ -2.281.0 +2.281.1