mirror of
https://github.com/actions/runner.git
synced 2026-07-06 20:55:42 +08:00
Compare commits
3 Commits
dependabot
...
v2.335.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d737449ef | ||
|
|
0d310567ae | ||
|
|
1ccca7c073 |
@@ -1,36 +1,40 @@
|
|||||||
## What's Changed
|
## What's Changed
|
||||||
* Bump flatted from 3.2.7 to 3.4.2 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4307
|
* Bump System.ServiceProcess.ServiceController from 10.0.6 to 10.0.7 by @dependabot[bot] in https://github.com/actions/runner/pull/4370
|
||||||
* Add DAP server by @rentziass in https://github.com/actions/runner/pull/4298
|
* Bump @actions/glob from 0.6.1 to 0.7.0 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4367
|
||||||
* Bump @typescript-eslint/eslint-plugin from 8.57.1 to 8.57.2 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4310
|
* feat: propagate actions dependencies by @nodeselector in https://github.com/actions/runner/pull/4372
|
||||||
* Remove AllowCaseFunction feature flag by @ericsciple in https://github.com/actions/runner/pull/4316
|
* Not retry and report action download 403. by @TingluoHuang in https://github.com/actions/runner/pull/4391
|
||||||
* chore: update Node versions by @github-actions[bot] in https://github.com/actions/runner/pull/4319
|
* Update setup job starting logs by @GitPaulo in https://github.com/actions/runner/pull/4383
|
||||||
* Batch and deduplicate action resolution across composite depths by @stefanpenner in https://github.com/actions/runner/pull/4296
|
* fix: expand commit hash regex to support SHA-256 (64-char) hashes by @yaananth in https://github.com/actions/runner/pull/4347
|
||||||
* Add support for Bearer token in action archive downloads by @TingluoHuang in https://github.com/actions/runner/pull/4321
|
* Move dap setup to setup job step by @rentziass in https://github.com/actions/runner/pull/4403
|
||||||
* Bump brace-expansion in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4318
|
* Add support for Ubuntu 26.04 (liblttng-ust1t64, libicu77-80) by @dvaldivia in https://github.com/actions/runner/pull/4394
|
||||||
* Add devtunnel connection for debugger jobs by @rentziass in https://github.com/actions/runner/pull/4317
|
* Update dotnet sdk to latest version @8.0.421 by @github-actions[bot] in https://github.com/actions/runner/pull/4428
|
||||||
* Update Docker to v29.3.1 and Buildx to v0.33.0 by @github-actions[bot] in https://github.com/actions/runner/pull/4324
|
* Update Docker to v29.5.0 and Buildx to v0.34.0 by @github-actions[bot] in https://github.com/actions/runner/pull/4425
|
||||||
* Bump @typescript-eslint/eslint-plugin from 8.57.2 to 8.58.1 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4327
|
* Execute debugger REPL commands inside job container by @rentziass in https://github.com/actions/runner/pull/4420
|
||||||
* Bump actions/github-script from 8 to 9 by @dependabot[bot] in https://github.com/actions/runner/pull/4331
|
* Send welcome message in debugger console on connect by @rentziass in https://github.com/actions/runner/pull/4419
|
||||||
* Bump typescript from 5.9.3 to 6.0.2 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4329
|
* Update snapshot-if context and functions by @drielenr in https://github.com/actions/runner/pull/4443
|
||||||
* fix: only show changed versions in node upgrade PR description by @salmanmkc in https://github.com/actions/runner/pull/4332
|
* chore: update Node versions by @github-actions[bot] in https://github.com/actions/runner/pull/4452
|
||||||
* Bump System.Formats.Asn1, Cryptography.Pkcs, ProtectedData, ServiceController, CodePages, Threading.Channels, @actions/glob, @typescript-eslint/parser, lint-staged, picomatch by @Copilot in https://github.com/actions/runner/pull/4333
|
* Allow disable node v8 maglev jit compiler on node24. by @TingluoHuang in https://github.com/actions/runner/pull/4447
|
||||||
* feat: add `job.workflow_*` typed accessors to JobContext by @salmanmkc in https://github.com/actions/runner/pull/4335
|
* Update Node 24 default date to June 16th, 2026 by @salmanmkc in https://github.com/actions/runner/pull/4462
|
||||||
* Add WS bridge over DAP TCP server by @rentziass in https://github.com/actions/runner/pull/4328
|
* Populate telemetry for non-action post-job steps by @drielenr in https://github.com/actions/runner/pull/4463
|
||||||
* chore: update Node versions by @github-actions[bot] in https://github.com/actions/runner/pull/4355
|
* Add SDK types and results plumbing for background step control by @lokesh755 in https://github.com/actions/runner/pull/4472
|
||||||
* Bump Docker version to 29.4.0 by @Copilot in https://github.com/actions/runner/pull/4352
|
* Add job execution view model by @rentziass in https://github.com/actions/runner/pull/4470
|
||||||
* Update dotnet sdk to latest version @8.0.420 by @github-actions[bot] in https://github.com/actions/runner/pull/4356
|
* Add thread-safety locks to StepsContext by @lokesh755 in https://github.com/actions/runner/pull/4475
|
||||||
* Bump @typescript-eslint/parser from 8.58.1 to 8.59.0 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4360
|
* Add background step deferral infrastructure and metadata plumbing by @lokesh755 in https://github.com/actions/runner/pull/4479
|
||||||
* Bump System.Formats.Asn1 and System.Security.Cryptography.Pkcs by @dependabot[bot] in https://github.com/actions/runner/pull/4362
|
* Wire job execution view into DAP by @rentziass in https://github.com/actions/runner/pull/4471
|
||||||
* Add vulnerability-alerts permission by @salmanmkc in https://github.com/actions/runner/pull/4350
|
* Background steps execution engine by @lokesh755 in https://github.com/actions/runner/pull/4476
|
||||||
* Bump @typescript-eslint/eslint-plugin from 8.58.1 to 8.59.0 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4359
|
* Update Docker to v29.5.2 and Buildx to v0.34.1 by @github-actions[bot] in https://github.com/actions/runner/pull/4451
|
||||||
* Bump System.ServiceProcess.ServiceController from 10.0.3 to 10.0.6 by @dependabot[bot] in https://github.com/actions/runner/pull/4358
|
* BrokerServer should not retry on 401. by @TingluoHuang in https://github.com/actions/runner/pull/4445
|
||||||
* Bump typescript from 6.0.2 to 6.0.3 in /src/Misc/expressionFunc/hashFiles by @dependabot[bot] in https://github.com/actions/runner/pull/4353
|
* Add new env var to allow single-prefix multiline logs on stdout by @nuclearpidgeon in https://github.com/actions/runner/pull/4424
|
||||||
* Bump Microsoft.DevTunnels.Connections from 1.3.16 to 1.3.39 by @dependabot[bot] in https://github.com/actions/runner/pull/4339
|
* Bump Microsoft.DevTunnels.Connections from 1.3.39 to 1.3.48 by @dependabot[bot] in https://github.com/actions/runner/pull/4441
|
||||||
|
* Bump System.Formats.Asn1 and System.Security.Cryptography.Pkcs by @dependabot[bot] in https://github.com/actions/runner/pull/4369
|
||||||
|
|
||||||
## New Contributors
|
## New Contributors
|
||||||
* @stefanpenner made their first contribution in https://github.com/actions/runner/pull/4296
|
* @GitPaulo made their first contribution in https://github.com/actions/runner/pull/4383
|
||||||
|
* @dvaldivia made their first contribution in https://github.com/actions/runner/pull/4394
|
||||||
|
* @drielenr made their first contribution in https://github.com/actions/runner/pull/4443
|
||||||
|
* @nuclearpidgeon made their first contribution in https://github.com/actions/runner/pull/4424
|
||||||
|
|
||||||
**Full Changelog**: https://github.com/actions/runner/compare/v2.333.1...v2.334.0
|
**Full Changelog**: https://github.com/actions/runner/compare/v2.334.0...v2.335.0
|
||||||
|
|
||||||
_Note: Actions Runner follows a progressive release policy, so the latest release might not be available to your enterprise, organization, or repository yet.
|
_Note: Actions Runner follows a progressive release policy, so the latest release might not be available to your enterprise, organization, or repository yet.
|
||||||
To confirm which version of the Actions Runner you should expect, please view the download instructions for your enterprise, organization, or repository.
|
To confirm which version of the Actions Runner you should expect, please view the download instructions for your enterprise, organization, or repository.
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<Update to ./src/runnerversion when creating release>
|
2.335.1
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ namespace GitHub.Runner.Worker
|
|||||||
// IDs of background steps that have already been completed (waited on or canceled).
|
// IDs of background steps that have already been completed (waited on or canceled).
|
||||||
// Used to avoid waiting on or flushing the same step more than once.
|
// Used to avoid waiting on or flushing the same step more than once.
|
||||||
private readonly HashSet<string> _completedStepIds = new();
|
private readonly HashSet<string> _completedStepIds = new();
|
||||||
|
|
||||||
|
// IDs of background steps that were explicitly canceled via a `cancel` control step.
|
||||||
|
// These steps are expected to be canceled, so their (Canceled) result must not be
|
||||||
|
// merged into the overall job result.
|
||||||
|
private readonly HashSet<string> _explicitlyCanceledStepIds = new();
|
||||||
private SemaphoreSlim _backgroundSlotSemaphore = new SemaphoreSlim(DefaultMaxBackgroundSteps);
|
private SemaphoreSlim _backgroundSlotSemaphore = new SemaphoreSlim(DefaultMaxBackgroundSteps);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -41,6 +46,7 @@ namespace GitHub.Runner.Worker
|
|||||||
{
|
{
|
||||||
_backgroundSteps.Clear();
|
_backgroundSteps.Clear();
|
||||||
_completedStepIds.Clear();
|
_completedStepIds.Clear();
|
||||||
|
_explicitlyCanceledStepIds.Clear();
|
||||||
var max = maxConcurrent > 0 ? maxConcurrent : DefaultMaxBackgroundSteps;
|
var max = maxConcurrent > 0 ? maxConcurrent : DefaultMaxBackgroundSteps;
|
||||||
_backgroundSlotSemaphore = new SemaphoreSlim(max);
|
_backgroundSlotSemaphore = new SemaphoreSlim(max);
|
||||||
}
|
}
|
||||||
@@ -85,6 +91,9 @@ namespace GitHub.Runner.Worker
|
|||||||
// Safety net
|
// Safety net
|
||||||
// -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
|
|
||||||
|
// Drain any background steps that weren't already waited on by an explicit wait/cancel
|
||||||
|
// control step, then merge the final results of all background steps into a single result
|
||||||
|
// for the caller to fold into the job result.
|
||||||
public async Task<TaskResult> WaitForUnwaitedStepsAsync(CancellationToken cancellationToken)
|
public async Task<TaskResult> WaitForUnwaitedStepsAsync(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var unwaitedIds = _backgroundSteps.Keys.Where(id => !_completedStepIds.Contains(id)).ToList();
|
var unwaitedIds = _backgroundSteps.Keys.Where(id => !_completedStepIds.Contains(id)).ToList();
|
||||||
@@ -95,14 +104,26 @@ namespace GitHub.Runner.Worker
|
|||||||
CompleteWaitedSteps(unwaitedIds);
|
CompleteWaitedSteps(unwaitedIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Report the merged result of all background steps; the caller merges this into the job result.
|
|
||||||
var result = TaskResult.Succeeded;
|
var result = TaskResult.Succeeded;
|
||||||
foreach (var (_, (step, _, _)) in _backgroundSteps)
|
foreach (var (stepId, (step, _, _)) in _backgroundSteps)
|
||||||
{
|
{
|
||||||
if (step.ExecutionContext.Result.HasValue)
|
// A step that succeeded does not set a Result by default, so a missing
|
||||||
|
// value means the step succeeded and there is nothing to merge.
|
||||||
|
if (!step.ExecutionContext.Result.HasValue)
|
||||||
{
|
{
|
||||||
result = TaskResultUtil.MergeTaskResults(result, step.ExecutionContext.Result.Value);
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A step explicitly canceled via a `cancel` control step is expected to be canceled,
|
||||||
|
// so a Canceled result must not influence the overall job result. However, if the step
|
||||||
|
// failed (e.g. before the cancellation took effect), that failure should still count.
|
||||||
|
if (_explicitlyCanceledStepIds.Contains(stepId) &&
|
||||||
|
step.ExecutionContext.Result.Value == TaskResult.Canceled)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
result = TaskResultUtil.MergeTaskResults(result, step.ExecutionContext.Result.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != TaskResult.Succeeded)
|
if (result != TaskResult.Succeeded)
|
||||||
@@ -256,6 +277,13 @@ namespace GitHub.Runner.Worker
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Mark these steps as expected-to-be-canceled so their result does not
|
||||||
|
// affect the overall job result.
|
||||||
|
foreach (var id in cancelStepIds)
|
||||||
|
{
|
||||||
|
_explicitlyCanceledStepIds.Add(id);
|
||||||
|
}
|
||||||
|
|
||||||
var idsToCancel = cancelStepIds
|
var idsToCancel = cancelStepIds
|
||||||
.Where(id => _backgroundSteps.ContainsKey(id) && !_backgroundSteps[id].Task.IsCompleted)
|
.Where(id => _backgroundSteps.ContainsKey(id) && !_backgroundSteps[id].Task.IsCompleted)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|||||||
@@ -372,6 +372,88 @@ namespace GitHub.Runner.Common.Tests.Worker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public async Task CanceledBackgroundStepDoesNotAffectJobResult()
|
||||||
|
{
|
||||||
|
using (TestHostContext hc = CreateTestContext())
|
||||||
|
{
|
||||||
|
// Arrange: a background step that runs until explicitly canceled. When canceled it
|
||||||
|
// reports TaskResult.Canceled, but since the cancellation is expected (driven by a
|
||||||
|
// cancel control step), it must not impact the overall job result.
|
||||||
|
using var stepCts = new CancellationTokenSource();
|
||||||
|
|
||||||
|
var bgStep = CreateStep(hc, TaskResult.Succeeded, "success()", name: "server", contextName: "server", isBackground: true);
|
||||||
|
var bgStepContext = Mock.Get(bgStep.Object.ExecutionContext);
|
||||||
|
bgStepContext.Setup(x => x.CancellationToken).Returns(stepCts.Token);
|
||||||
|
bgStepContext.Setup(x => x.CancelToken()).Callback(() => stepCts.Cancel());
|
||||||
|
bgStep.Setup(x => x.RunAsync()).Returns(async () =>
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(2), stepCts.Token);
|
||||||
|
});
|
||||||
|
bgStep.Setup(x => x.Action).Returns(new GitHub.DistributedTask.Pipelines.ActionStep()
|
||||||
|
{
|
||||||
|
Name = "server",
|
||||||
|
Id = Guid.NewGuid(),
|
||||||
|
ContextName = "server",
|
||||||
|
Background = true,
|
||||||
|
});
|
||||||
|
|
||||||
|
var cancelStep = CreateCancelStep(hc, "server");
|
||||||
|
|
||||||
|
_ec.Object.Result = null;
|
||||||
|
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(new IStep[]
|
||||||
|
{
|
||||||
|
bgStep.Object, cancelStep
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await _stepsRunner.RunAsync(jobContext: _ec.Object);
|
||||||
|
|
||||||
|
// Assert: the canceled background step reported Canceled, but the job result is unaffected.
|
||||||
|
Assert.Equal(TaskResult.Canceled, bgStep.Object.ExecutionContext.Result);
|
||||||
|
Assert.Equal(TaskResult.Succeeded, _ec.Object.Result ?? TaskResult.Succeeded);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
[Trait("Level", "L0")]
|
||||||
|
[Trait("Category", "Worker")]
|
||||||
|
public async Task FailedBackgroundStepTargetedByCancelStillAffectsJobResult()
|
||||||
|
{
|
||||||
|
using (TestHostContext hc = CreateTestContext())
|
||||||
|
{
|
||||||
|
// Arrange: a background step that fails (e.g. before the cancel takes effect). Even
|
||||||
|
// though a cancel control step targets it, its Failed result must still propagate to
|
||||||
|
// the overall job result.
|
||||||
|
var bgStep = CreateStep(hc, TaskResult.Failed, "success()", name: "server", contextName: "server", isBackground: true);
|
||||||
|
bgStep.Setup(x => x.RunAsync()).Returns(Task.CompletedTask);
|
||||||
|
bgStep.Setup(x => x.Action).Returns(new GitHub.DistributedTask.Pipelines.ActionStep()
|
||||||
|
{
|
||||||
|
Name = "server",
|
||||||
|
Id = Guid.NewGuid(),
|
||||||
|
ContextName = "server",
|
||||||
|
Background = true,
|
||||||
|
});
|
||||||
|
|
||||||
|
var cancelStep = CreateCancelStep(hc, "server");
|
||||||
|
|
||||||
|
_ec.Object.Result = null;
|
||||||
|
_ec.Setup(x => x.JobSteps).Returns(new Queue<IStep>(new IStep[]
|
||||||
|
{
|
||||||
|
bgStep.Object, cancelStep
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Act
|
||||||
|
await _stepsRunner.RunAsync(jobContext: _ec.Object);
|
||||||
|
|
||||||
|
// Assert: the background step failed, so the job result reflects that failure.
|
||||||
|
Assert.Equal(TaskResult.Failed, bgStep.Object.ExecutionContext.Result);
|
||||||
|
Assert.Equal(TaskResult.Failed, _ec.Object.Result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
[Trait("Level", "L0")]
|
[Trait("Level", "L0")]
|
||||||
[Trait("Category", "Worker")]
|
[Trait("Category", "Worker")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
2.334.0
|
2.335.1
|
||||||
|
|||||||
Reference in New Issue
Block a user