Compare commits

..

2 Commits

Author SHA1 Message Date
Tingluo Huang
c8caf59bb7 Update releaseVersion 2021-09-01 16:29:49 -04:00
Tingluo Huang
77c5a664ed Cherry-pick changes for 2.281.1 (#1306)
* Temporary fix for macOS runner upgrade crash loop. (#1304)

* Typo fixed (#1289)

* Update error to say 'uninstall' not 'unconfigure' (#1179)

* Update error to say 'uninstall' not 'unconfigure'

* Say uninstall service in *nix config error msgs

Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>

* Allow setting default severity to "notice" (#1213)

* Show More Step Information in composite Actions (#1279)

* Prepare 2.281.1 runner release. (#1305)

Co-authored-by: Daniel Asztalos <asztalosdani@users.noreply.github.com>
Co-authored-by: Nick Fields <50085412+nick-invision@users.noreply.github.com>
Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>
Co-authored-by: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com>
2021-09-01 16:29:31 -04:00
12 changed files with 100 additions and 39 deletions

View File

@@ -1,11 +1,18 @@
## Features ## Features
- Allow setting default severity to "notice" (#1213)
- Show More Step Information in composite Actions (#1279)
## Bugs ## Bugs
- Temporary fix for macOS runner upgrade crash loop. (#1304)
- Fixed an issue where GHES runners fail to download public docker images (#1199) - Fixed an issue where GHES runners fail to download public docker images (#1199)
## Misc ## Misc
- Update error to say 'uninstall' not 'unconfigure' (#1179)
- Typo fixed (#1289)
## Windows x64 ## 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. 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.

View File

@@ -1 +1 @@
2.281.0 2.281.1

View File

@@ -118,6 +118,43 @@ then
exit 1 exit 1
fi 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" date "+[%F %T-%4N] Update succeed" >> "$logfile"
# rename the update log file with %logfile%.succeed/.failed/succeedneedrestart # rename the update log file with %logfile%.succeed/.failed/succeedneedrestart

View File

@@ -347,12 +347,9 @@ namespace GitHub.Runner.Listener.Configuration
_term.WriteLine(); _term.WriteLine();
_term.WriteSuccessMessage("Runner service removed"); _term.WriteSuccessMessage("Runner service removed");
#elif OS_LINUX #else
// unconfig system D service first // unconfig systemd or osx service first
throw new Exception("Unconfigure service first"); throw new Exception("Uninstall service first");
#elif OS_OSX
// unconfig osx service first
throw new Exception("Unconfigure service first");
#endif #endif
} }

View File

@@ -74,10 +74,12 @@ namespace GitHub.Runner.Listener
await jobDispatcher.WaitAsync(token); await jobDispatcher.WaitAsync(token);
Trace.Info($"All running job has exited."); 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 // delete runner backup
DeletePreviousVersionRunnerBackup(token); DeletePreviousVersionRunnerBackup(token);
Trace.Info($"Delete old version runner backup."); Trace.Info($"Delete old version runner backup.");
#endif
// generate update script from template // generate update script from template
await UpdateRunnerUpdateStateAsync("Generate and execute update script."); await UpdateRunnerUpdateStateAsync("Generate and execute update script.");
@@ -96,7 +98,7 @@ namespace GitHub.Runner.Listener
invokeScript.Start(); invokeScript.Start();
Trace.Info($"Update script start running"); 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; return true;
} }

View File

@@ -980,18 +980,6 @@ namespace GitHub.Runner.Worker
context.Write(null, message); 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(). // Do not add a format string overload. See comment on ExecutionContext.Write().
public static void Command(this IExecutionContext context, string message) public static void Command(this IExecutionContext context, string message)
{ {

View File

@@ -50,8 +50,8 @@ namespace GitHub.Runner.Worker.Handlers
var dockerFile = Path.Combine(ActionDirectory, Data.Image); var dockerFile = Path.Combine(ActionDirectory, Data.Image);
ArgUtil.File(dockerFile, nameof(Data.Image)); ArgUtil.File(dockerFile, nameof(Data.Image));
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "Building docker image" : $"##[group]Building docker image"); ExecutionContext.Output($"##[group]Building docker image");
ExecutionContext.WriteDetails($"Dockerfile for action: '{dockerFile}'."); ExecutionContext.Output($"Dockerfile for action: '{dockerFile}'.");
var imageName = $"{dockerManager.DockerInstanceLabel}:{ExecutionContext.Id.ToString("N")}"; var imageName = $"{dockerManager.DockerInstanceLabel}:{ExecutionContext.Id.ToString("N")}";
var buildExitCode = await dockerManager.DockerBuild( var buildExitCode = await dockerManager.DockerBuild(
ExecutionContext, ExecutionContext,
@@ -59,7 +59,7 @@ namespace GitHub.Runner.Worker.Handlers
dockerFile, dockerFile,
Directory.GetParent(dockerFile).FullName, Directory.GetParent(dockerFile).FullName,
imageName); imageName);
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "" : "##[endgroup]"); ExecutionContext.Output("##[endgroup]");
if (buildExitCode != 0) if (buildExitCode != 0)
{ {

View File

@@ -82,7 +82,7 @@ namespace GitHub.Runner.Worker.Handlers
if (stage == ActionRunStage.Post) if (stage == ActionRunStage.Post)
{ {
ExecutionContext.WriteDetails($"Post job cleanup."); ExecutionContext.Output($"Post job cleanup.");
return; return;
} }
@@ -118,30 +118,30 @@ namespace GitHub.Runner.Worker.Handlers
groupName = "Action details"; groupName = "Action details";
} }
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? groupName : $"##[group]{groupName}"); ExecutionContext.Output($"##[group]{groupName}");
if (this.Inputs?.Count > 0) if (this.Inputs?.Count > 0)
{ {
ExecutionContext.WriteDetails("with:"); ExecutionContext.Output("with:");
foreach (var input in this.Inputs) foreach (var input in this.Inputs)
{ {
if (!string.IsNullOrEmpty(input.Value)) if (!string.IsNullOrEmpty(input.Value))
{ {
ExecutionContext.WriteDetails($" {input.Key}: {input.Value}"); ExecutionContext.Output($" {input.Key}: {input.Value}");
} }
} }
} }
if (this.Environment?.Count > 0) if (this.Environment?.Count > 0)
{ {
ExecutionContext.WriteDetails("env:"); ExecutionContext.Output("env:");
foreach (var env in this.Environment) 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) public override void Initialize(IHostContext hostContext)

View File

@@ -40,7 +40,7 @@ namespace GitHub.Runner.Worker.Handlers
firstLine = firstLine.Substring(0, firstNewLine); firstLine = firstLine.Substring(0, firstNewLine);
} }
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? $"Run {firstLine}" : $"##[group]Run {firstLine}"); ExecutionContext.Output($"##[group]Run {firstLine}");
} }
else else
{ {
@@ -51,7 +51,7 @@ namespace GitHub.Runner.Worker.Handlers
foreach (var line in multiLines) foreach (var line in multiLines)
{ {
// Bright Cyan color // Bright Cyan color
ExecutionContext.WriteDetails($"\x1b[36;1m{line}\x1b[0m"); ExecutionContext.Output($"\x1b[36;1m{line}\x1b[0m");
} }
string argFormat; string argFormat;
@@ -110,23 +110,23 @@ namespace GitHub.Runner.Worker.Handlers
if (!string.IsNullOrEmpty(shellCommandPath)) if (!string.IsNullOrEmpty(shellCommandPath))
{ {
ExecutionContext.WriteDetails($"shell: {shellCommandPath} {argFormat}"); ExecutionContext.Output($"shell: {shellCommandPath} {argFormat}");
} }
else else
{ {
ExecutionContext.WriteDetails($"shell: {shellCommand} {argFormat}"); ExecutionContext.Output($"shell: {shellCommand} {argFormat}");
} }
if (this.Environment?.Count > 0) if (this.Environment?.Count > 0)
{ {
ExecutionContext.WriteDetails("env:"); ExecutionContext.Output("env:");
foreach (var env in this.Environment) 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) public async Task RunAsync(ActionRunStage stage)

View File

@@ -350,6 +350,7 @@ namespace GitHub.Runner.Worker
case "": case "":
case "ERROR": case "ERROR":
case "WARNING": case "WARNING":
case "NOTICE":
break; break;
default: default:
throw new ArgumentException($"Matcher '{_owner}' contains unexpected default severity '{_severity}'"); throw new ArgumentException($"Matcher '{_owner}' contains unexpected default severity '{_severity}'");

View File

@@ -392,6 +392,35 @@ namespace GitHub.Runner.Common.Tests.Worker
Assert.Equal("not-working", match.Message); Assert.Equal("not-working", match.Message);
} }
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
public void Matcher_MultiplePatterns_DefaultSeverityNotice()
{
var config = JsonUtility.FromString<IssueMatchersConfig>(@"
{
""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] [Fact]
[Trait("Level", "L0")] [Trait("Level", "L0")]
[Trait("Category", "Worker")] [Trait("Category", "Worker")]

View File

@@ -1 +1 @@
2.281.0 2.281.1