Skip to content

Commit 77c5a66

Browse files
TingluoHuangasztalosdaninick-invisionfhammerlCyberShadow
authored
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 <[email protected]> * 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 <[email protected]> Co-authored-by: Nick Fields <[email protected]> Co-authored-by: Ferenc Hammerl <[email protected]> Co-authored-by: Vladimir Panteleev <[email protected]> Co-authored-by: Thomas Boop <[email protected]>
1 parent b6aa01f commit 77c5a66

File tree

11 files changed

+99
-38
lines changed

11 files changed

+99
-38
lines changed

releaseNote.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
## Features
22

3+
- Allow setting default severity to "notice" (#1213)
4+
- Show More Step Information in composite Actions (#1279)
5+
36
## Bugs
47

8+
- Temporary fix for macOS runner upgrade crash loop. (#1304)
59
- Fixed an issue where GHES runners fail to download public docker images (#1199)
610

711
## Misc
812

13+
- Update error to say 'uninstall' not 'unconfigure' (#1179)
14+
- Typo fixed (#1289)
15+
916
## Windows x64
1017
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.
1118

src/Misc/layoutbin/update.sh.template

+37
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,43 @@ then
118118
exit 1
119119
fi
120120

121+
# fix upgrade issue with macOS
122+
currentplatform=$(uname | awk '{print tolower($0)}')
123+
if [[ "$currentplatform" == 'darwin' ]]; then
124+
# need a short-term fix for https://github.com/actions/runner/issues/743
125+
# we will recreate all the ./externals/node12/bin/node of the past 5 versions
126+
# v2.280.3 v2.280.2 v2.280.1 v2.279.0 v2.278.0
127+
if [[ ! -e "$rootfolder/externals.2.280.3/node12/bin/node" ]]
128+
then
129+
mkdir -p "$rootfolder/externals.2.280.3/node12/bin"
130+
cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.280.3/node12/bin/node"
131+
fi
132+
133+
if [[ ! -e "$rootfolder/externals.2.280.2/node12/bin/node" ]]
134+
then
135+
mkdir -p "$rootfolder/externals.2.280.2/node12/bin"
136+
cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.280.2/node12/bin/node"
137+
fi
138+
139+
if [[ ! -e "$rootfolder/externals.2.280.1/node12/bin/node" ]]
140+
then
141+
mkdir -p "$rootfolder/externals.2.280.1/node12/bin"
142+
cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.280.1/node12/bin/node"
143+
fi
144+
145+
if [[ ! -e "$rootfolder/externals.2.279.0/node12/bin/node" ]]
146+
then
147+
mkdir -p "$rootfolder/externals.2.279.0/node12/bin"
148+
cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.279.0/node12/bin/node"
149+
fi
150+
151+
if [[ ! -e "$rootfolder/externals.2.278.0/node12/bin/node" ]]
152+
then
153+
mkdir -p "$rootfolder/externals.2.278.0/node12/bin"
154+
cp "$rootfolder/externals/node12/bin/node" "$rootfolder/externals.2.278.0/node12/bin/node"
155+
fi
156+
fi
157+
121158
date "+[%F %T-%4N] Update succeed" >> "$logfile"
122159

123160
# rename the update log file with %logfile%.succeed/.failed/succeedneedrestart

src/Runner.Listener/Configuration/ConfigurationManager.cs

+3-6
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,9 @@ public async Task UnconfigureAsync(CommandSettings command)
347347

348348
_term.WriteLine();
349349
_term.WriteSuccessMessage("Runner service removed");
350-
#elif OS_LINUX
351-
// unconfig system D service first
352-
throw new Exception("Unconfigure service first");
353-
#elif OS_OSX
354-
// unconfig osx service first
355-
throw new Exception("Unconfigure service first");
350+
#else
351+
// unconfig systemd or osx service first
352+
throw new Exception("Uninstall service first");
356353
#endif
357354
}
358355

src/Runner.Listener/SelfUpdater.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,12 @@ public async Task<bool> SelfUpdate(AgentRefreshMessage updateMessage, IJobDispat
7474
await jobDispatcher.WaitAsync(token);
7575
Trace.Info($"All running job has exited.");
7676

77+
// We need to keep runner backup around for macOS until we fixed https://github.com/actions/runner/issues/743
78+
#if !OS_OSX
7779
// delete runner backup
7880
DeletePreviousVersionRunnerBackup(token);
7981
Trace.Info($"Delete old version runner backup.");
80-
82+
#endif
8183
// generate update script from template
8284
await UpdateRunnerUpdateStateAsync("Generate and execute update script.");
8385

@@ -96,7 +98,7 @@ public async Task<bool> SelfUpdate(AgentRefreshMessage updateMessage, IJobDispat
9698
invokeScript.Start();
9799
Trace.Info($"Update script start running");
98100

99-
await UpdateRunnerUpdateStateAsync("Runner will exit shortly for update, should back online within 10 seconds.");
101+
await UpdateRunnerUpdateStateAsync("Runner will exit shortly for update, should be back online within 10 seconds.");
100102

101103
return true;
102104
}

src/Runner.Worker/ExecutionContext.cs

-12
Original file line numberDiff line numberDiff line change
@@ -980,18 +980,6 @@ public static void Output(this IExecutionContext context, string message)
980980
context.Write(null, message);
981981
}
982982

983-
public static void WriteDetails(this IExecutionContext context, string message)
984-
{
985-
if (context.IsEmbedded)
986-
{
987-
context.Debug(message);
988-
}
989-
else
990-
{
991-
context.Output(message);
992-
}
993-
}
994-
995983
// Do not add a format string overload. See comment on ExecutionContext.Write().
996984
public static void Command(this IExecutionContext context, string message)
997985
{

src/Runner.Worker/Handlers/ContainerActionHandler.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ public async Task RunAsync(ActionRunStage stage)
5050
var dockerFile = Path.Combine(ActionDirectory, Data.Image);
5151
ArgUtil.File(dockerFile, nameof(Data.Image));
5252

53-
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "Building docker image" : $"##[group]Building docker image");
54-
ExecutionContext.WriteDetails($"Dockerfile for action: '{dockerFile}'.");
53+
ExecutionContext.Output($"##[group]Building docker image");
54+
ExecutionContext.Output($"Dockerfile for action: '{dockerFile}'.");
5555
var imageName = $"{dockerManager.DockerInstanceLabel}:{ExecutionContext.Id.ToString("N")}";
5656
var buildExitCode = await dockerManager.DockerBuild(
5757
ExecutionContext,
5858
ExecutionContext.GetGitHubContext("workspace"),
5959
dockerFile,
6060
Directory.GetParent(dockerFile).FullName,
6161
imageName);
62-
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "" : "##[endgroup]");
62+
ExecutionContext.Output("##[endgroup]");
6363

6464
if (buildExitCode != 0)
6565
{

src/Runner.Worker/Handlers/Handler.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public virtual void PrintActionDetails(ActionRunStage stage)
8282

8383
if (stage == ActionRunStage.Post)
8484
{
85-
ExecutionContext.WriteDetails($"Post job cleanup.");
85+
ExecutionContext.Output($"Post job cleanup.");
8686
return;
8787
}
8888

@@ -118,30 +118,30 @@ public virtual void PrintActionDetails(ActionRunStage stage)
118118
groupName = "Action details";
119119
}
120120

121-
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? groupName : $"##[group]{groupName}");
121+
ExecutionContext.Output($"##[group]{groupName}");
122122

123123
if (this.Inputs?.Count > 0)
124124
{
125-
ExecutionContext.WriteDetails("with:");
125+
ExecutionContext.Output("with:");
126126
foreach (var input in this.Inputs)
127127
{
128128
if (!string.IsNullOrEmpty(input.Value))
129129
{
130-
ExecutionContext.WriteDetails($" {input.Key}: {input.Value}");
130+
ExecutionContext.Output($" {input.Key}: {input.Value}");
131131
}
132132
}
133133
}
134134

135135
if (this.Environment?.Count > 0)
136136
{
137-
ExecutionContext.WriteDetails("env:");
137+
ExecutionContext.Output("env:");
138138
foreach (var env in this.Environment)
139139
{
140-
ExecutionContext.WriteDetails($" {env.Key}: {env.Value}");
140+
ExecutionContext.Output($" {env.Key}: {env.Value}");
141141
}
142142
}
143143

144-
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "" : "##[endgroup]");
144+
ExecutionContext.Output("##[endgroup]");
145145
}
146146

147147
public override void Initialize(IHostContext hostContext)

src/Runner.Worker/Handlers/ScriptHandler.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public override void PrintActionDetails(ActionRunStage stage)
4040
firstLine = firstLine.Substring(0, firstNewLine);
4141
}
4242

43-
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? $"Run {firstLine}" : $"##[group]Run {firstLine}");
43+
ExecutionContext.Output($"##[group]Run {firstLine}");
4444
}
4545
else
4646
{
@@ -51,7 +51,7 @@ public override void PrintActionDetails(ActionRunStage stage)
5151
foreach (var line in multiLines)
5252
{
5353
// Bright Cyan color
54-
ExecutionContext.WriteDetails($"\x1b[36;1m{line}\x1b[0m");
54+
ExecutionContext.Output($"\x1b[36;1m{line}\x1b[0m");
5555
}
5656

5757
string argFormat;
@@ -110,23 +110,23 @@ public override void PrintActionDetails(ActionRunStage stage)
110110

111111
if (!string.IsNullOrEmpty(shellCommandPath))
112112
{
113-
ExecutionContext.WriteDetails($"shell: {shellCommandPath} {argFormat}");
113+
ExecutionContext.Output($"shell: {shellCommandPath} {argFormat}");
114114
}
115115
else
116116
{
117-
ExecutionContext.WriteDetails($"shell: {shellCommand} {argFormat}");
117+
ExecutionContext.Output($"shell: {shellCommand} {argFormat}");
118118
}
119119

120120
if (this.Environment?.Count > 0)
121121
{
122-
ExecutionContext.WriteDetails("env:");
122+
ExecutionContext.Output("env:");
123123
foreach (var env in this.Environment)
124124
{
125-
ExecutionContext.WriteDetails($" {env.Key}: {env.Value}");
125+
ExecutionContext.Output($" {env.Key}: {env.Value}");
126126
}
127127
}
128128

129-
ExecutionContext.WriteDetails(ExecutionContext.IsEmbedded ? "" : "##[endgroup]");
129+
ExecutionContext.Output("##[endgroup]");
130130
}
131131

132132
public async Task RunAsync(ActionRunStage stage)

src/Runner.Worker/IssueMatcher.cs

+1
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ public void Validate()
350350
case "":
351351
case "ERROR":
352352
case "WARNING":
353+
case "NOTICE":
353354
break;
354355
default:
355356
throw new ArgumentException($"Matcher '{_owner}' contains unexpected default severity '{_severity}'");

src/Test/L0/Worker/IssueMatcherL0.cs

+29
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,35 @@ public void Matcher_MultiplePatterns_DefaultSeverity()
392392
Assert.Equal("not-working", match.Message);
393393
}
394394

395+
[Fact]
396+
[Trait("Level", "L0")]
397+
[Trait("Category", "Worker")]
398+
public void Matcher_MultiplePatterns_DefaultSeverityNotice()
399+
{
400+
var config = JsonUtility.FromString<IssueMatchersConfig>(@"
401+
{
402+
""problemMatcher"": [
403+
{
404+
""owner"": ""myMatcher"",
405+
""severity"": ""notice"",
406+
""pattern"": [
407+
{
408+
""regexp"": ""^(.+)$"",
409+
""message"": 1
410+
}
411+
]
412+
}
413+
]
414+
}
415+
");
416+
config.Validate();
417+
var matcher = new IssueMatcher(config.Matchers[0], TimeSpan.FromSeconds(1));
418+
419+
var match = matcher.Match("just-a-notice");
420+
Assert.Equal("notice", match.Severity);
421+
Assert.Equal("just-a-notice", match.Message);
422+
}
423+
395424
[Fact]
396425
[Trait("Level", "L0")]
397426
[Trait("Category", "Worker")]

src/runnerversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.281.0
1+
2.281.1

0 commit comments

Comments
 (0)