Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ARG TARGETOS
ARG TARGETARCH
ARG RUNNER_VERSION
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.7.0
ARG DOCKER_VERSION=29.4.0
ARG BUILDX_VERSION=0.33.0
ARG DOCKER_VERSION=29.5.0
ARG BUILDX_VERSION=0.34.0

RUN apt update -y && apt install curl unzip -y

Expand Down
2 changes: 1 addition & 1 deletion patches/last_processed_commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d36839b001e3294e2b6e2663268c63b50d295df5
ae2896c551a708bdc78bee403eb696e3a26ac95d
6 changes: 3 additions & 3 deletions patches/runner-main-sdk8-ppc64le.patch
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ index 14cc6bab..c8ed8b92 100755

if ! [ -x "$(command -v ldconfig)" ]; then
diff --git a/src/Runner.Common/Constants.cs b/src/Runner.Common/Constants.cs
index 7a1f1cbb..dafc3ccf 100644
index b07d60d3..55ed142b 100644
--- a/src/Runner.Common/Constants.cs
+++ b/src/Runner.Common/Constants.cs
@@ -59,7 +59,9 @@ namespace GitHub.Runner.Common
Expand Down Expand Up @@ -216,7 +216,7 @@ index a5a19aea..b2086aa5 100644
<NoWarn>NU1701;NU1603;NU1603;xUnit2013;SYSLIB0050;SYSLIB0051</NoWarn>
</PropertyGroup>
diff --git a/src/dev.sh b/src/dev.sh
index fc732597..0765551f 100755
index fafdbffb..baed6dd2 100755
--- a/src/dev.sh
+++ b/src/dev.sh
@@ -54,6 +54,8 @@ elif [[ "$CURRENT_PLATFORM" == 'linux' ]]; then
Expand Down Expand Up @@ -284,4 +284,4 @@ index 056a312e..3f9a3679 100644
<Exec Command="%22$(DesktopMSBuild)%22 Runner.Service/Windows/RunnerService.csproj /p:Configuration=$(BUILDCONFIG) /p:PackageRuntime=$(PackageRuntime) /p:OutputPath=%22$(MSBuildProjectDirectory)/../_layout/bin%22" ConsoleToMSBuild="true" Condition="'$(PackageRuntime)' == 'win-x64' Or '$(PackageRuntime)' == 'win-x86' Or '$(PackageRuntime)' == 'win-arm64'" />
</Target>

# From upstream commit: d36839b001e3294e2b6e2663268c63b50d295df5
# From upstream commit: ae2896c551a708bdc78bee403eb696e3a26ac95d
6 changes: 3 additions & 3 deletions patches/runner-main-sdk8-s390x.patch
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ index 14cc6bab..c8ed8b92 100755

if ! [ -x "$(command -v ldconfig)" ]; then
diff --git a/src/Runner.Common/Constants.cs b/src/Runner.Common/Constants.cs
index 7a1f1cbb..dafc3ccf 100644
index b07d60d3..55ed142b 100644
--- a/src/Runner.Common/Constants.cs
+++ b/src/Runner.Common/Constants.cs
@@ -59,7 +59,9 @@ namespace GitHub.Runner.Common
Expand Down Expand Up @@ -216,7 +216,7 @@ index a5a19aea..b2086aa5 100644
<NoWarn>NU1701;NU1603;NU1603;xUnit2013;SYSLIB0050;SYSLIB0051</NoWarn>
</PropertyGroup>
diff --git a/src/dev.sh b/src/dev.sh
index fc732597..0765551f 100755
index fafdbffb..baed6dd2 100755
--- a/src/dev.sh
+++ b/src/dev.sh
@@ -54,6 +54,8 @@ elif [[ "$CURRENT_PLATFORM" == 'linux' ]]; then
Expand Down Expand Up @@ -284,4 +284,4 @@ index 056a312e..3f9a3679 100644
<Exec Command="%22$(DesktopMSBuild)%22 Runner.Service/Windows/RunnerService.csproj /p:Configuration=$(BUILDCONFIG) /p:PackageRuntime=$(PackageRuntime) /p:OutputPath=%22$(MSBuildProjectDirectory)/../_layout/bin%22" ConsoleToMSBuild="true" Condition="'$(PackageRuntime)' == 'win-x64' Or '$(PackageRuntime)' == 'win-x86' Or '$(PackageRuntime)' == 'win-arm64'" />
</Target>

# From upstream commit: d36839b001e3294e2b6e2663268c63b50d295df5
# From upstream commit: ae2896c551a708bdc78bee403eb696e3a26ac95d
1 change: 1 addition & 0 deletions src/Runner.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ public static class Features
public static readonly string EmitCompositeMarkers = "actions_runner_emit_composite_markers";
public static readonly string BatchActionResolution = "actions_batch_action_resolution";
public static readonly string UseBearerTokenForCodeload = "actions_use_bearer_token_for_codeload";
public static readonly string OverrideDebuggerWelcomeMessage = "actions_runner_override_debugger_welcome_message";
}

// Node version migration related constants
Expand Down
79 changes: 78 additions & 1 deletion src/Runner.Worker/Dap/DapDebugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public sealed class DapDebugger : RunnerService, IDapDebugger
private volatile DapSessionState _state = DapSessionState.NotStarted;
private CancellationTokenRegistration? _cancellationRegistration;
private bool _isFirstStep = true;
private bool _welcomeMessageSent;

// Dev Tunnel relay host for remote debugging
private TunnelRelayTunnelHost _tunnelRelayHost;
Expand Down Expand Up @@ -490,6 +491,11 @@ internal async Task HandleMessageAsync(string messageJson, CancellationToken can
});
Trace.Info("Sent initialized event");
}

if (request.Command == "configurationDone")
{
SendWelcomeMessage();
}
}
catch (Exception ex)
{
Expand All @@ -508,6 +514,7 @@ internal async Task HandleMessageAsync(string messageJson, CancellationToken can
internal void HandleClientConnected()
{
_isClientConnected = true;
_welcomeMessageSent = false;
Trace.Info("Client connected to debug session");

// If we're paused, re-send the stopped event so the new client
Expand Down Expand Up @@ -818,6 +825,34 @@ private void SendOutput(string category, string text)
});
}

internal void SendWelcomeMessage()
{
if (_welcomeMessageSent)
{
return;
}
_welcomeMessageSent = true;

var debuggerConfig = _jobContext?.Global?.Debugger;
if (debuggerConfig?.OverrideWelcomeMessage == true)
{
if (!string.IsNullOrEmpty(debuggerConfig.WelcomeMessage))
{
SendOutput("console", debuggerConfig.WelcomeMessage);
Trace.Info("Sent custom welcome message");
}
else
{
Trace.Info("Welcome message suppressed by override");
}
}
else
{
SendOutput("console", DapReplParser.GetGeneralHelp());
Trace.Info("Sent default welcome message");
}
}

internal async Task OnStepStartingAsync(IStep step, bool isFirstStep)
{
bool pauseOnNextStep;
Expand Down Expand Up @@ -860,6 +895,9 @@ internal async Task OnStepStartingAsync(IStep step, bool isFirstStep)
// Send stopped event to debugger (only if client is connected)
SendStoppedEvent(reason, description);

// Emit a banner so the user knows where REPL commands will execute
SendExecutionContextBanner();

// Wait for debugger command
await WaitForCommandAsync(cancellationToken);
}
Expand Down Expand Up @@ -1195,7 +1233,12 @@ private async Task<EvaluateResponseBody> DispatchReplCommandAsync(

case RunCommand run:
var context = GetExecutionContextForFrame(frameId);
return await _replExecutor.ExecuteRunCommandAsync(run, context, cancellationToken);
bool isActionStep;
lock (_stateLock)
{
isActionStep = _currentStep is IActionRunner;
}
return await _replExecutor.ExecuteRunCommandAsync(run, context, isActionStep, cancellationToken);

default:
return new EvaluateResponseBody
Expand Down Expand Up @@ -1407,6 +1450,40 @@ private void SendStoppedEvent(string reason, string description)
});
}

/// <summary>
/// Emits a console output banner telling the user whether REPL
/// commands will execute on the host or inside the job container.
/// </summary>
private void SendExecutionContextBanner()
{
if (!_isClientConnected)
{
return;
}

bool isActionStep = _currentStep is IActionRunner;
var container = _jobContext?.Global?.Container;

string target;
if (isActionStep && container != null &&
(!string.IsNullOrEmpty(container.ContainerId) ||
FeatureManager.IsContainerHooksEnabled(_jobContext?.Global?.Variables)))
{
var image = container.ContainerImage ?? "container";
var shortId = !string.IsNullOrEmpty(container.ContainerId) && container.ContainerId.Length >= 12
? container.ContainerId.Substring(0, 12)
: container.ContainerId ?? "";
var idSuffix = !string.IsNullOrEmpty(shortId) ? $" ({shortId})" : "";
target = $"job container: {image}{idSuffix}";
}
else
{
target = "runner host";
}

SendOutput("console", $"\nCommands will run on {target}\n");
}

private string MaskUserVisibleText(string value)
{
if (string.IsNullOrEmpty(value))
Expand Down
Loading
Loading