Skip to content

Commit 49b0497

Browse files
Adding Consistency to 'Failed To Resolve Action Download Info' Infrastructure Error Flagging (#2488)
* adding extra catch for download failure in composite actions * Adding infra error * Adding error handling centralizing * updating try catch bubbling * cleaning up commits * cleaning up commits * cleaning up commits * updating bubbler * cleaning up test files * Fixing linting errors * updating exception bubble * reverting composite * updating catch to not exclude other exceptions * removing uneeded import * Update src/Runner.Worker/ActionRunner.cs Co-authored-by: Tingluo Huang <[email protected]> * Update src/Runner.Worker/ActionManager.cs Co-authored-by: Tingluo Huang <[email protected]> * Update src/Runner.Worker/ActionManager.cs Co-authored-by: Tingluo Huang <[email protected]> * Update src/Runner.Worker/ActionManager.cs Co-authored-by: Tingluo Huang <[email protected]> * Update src/Runner.Worker/ActionManager.cs Co-authored-by: Tingluo Huang <[email protected]> * moving download out of for loop; reverting exception wrap * Update src/Runner.Worker/ActionManager.cs Co-authored-by: Tingluo Huang <[email protected]> * Adding blank lines back * Adding blank lines back * removing uneeded catch for download fail * adding var back for consistency * formatting clean --------- Co-authored-by: Tingluo Huang <[email protected]>
1 parent eeb0cf6 commit 49b0497

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/Runner.Worker/ActionManager.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using WebApi = GitHub.DistributedTask.WebApi;
1919
using Pipelines = GitHub.DistributedTask.Pipelines;
2020
using PipelineTemplateConstants = GitHub.DistributedTask.Pipelines.ObjectTemplating.PipelineTemplateConstants;
21+
using GitHub.DistributedTask.WebApi;
2122

2223
namespace GitHub.Runner.Worker
2324
{
@@ -101,7 +102,19 @@ public sealed class ActionManager : RunnerService, IActionManager
101102
}
102103
IEnumerable<Pipelines.ActionStep> actions = steps.OfType<Pipelines.ActionStep>();
103104
executionContext.Output("Prepare all required actions");
104-
var result = await PrepareActionsRecursiveAsync(executionContext, state, actions, depth, rootStepId);
105+
PrepareActionsState result = new PrepareActionsState();
106+
try
107+
{
108+
result = await PrepareActionsRecursiveAsync(executionContext, state, actions, depth, rootStepId);
109+
}
110+
catch (FailedToResolveActionDownloadInfoException ex)
111+
{
112+
// Log the error and fail the PrepareActionsAsync Initialization.
113+
Trace.Error($"Caught exception from PrepareActionsAsync Initialization: {ex}");
114+
executionContext.InfrastructureError(ex.Message);
115+
executionContext.Result = TaskResult.Failed;
116+
throw;
117+
}
105118
if (!FeatureManager.IsContainerHooksEnabled(executionContext.Global.Variables))
106119
{
107120
if (state.ImagesToPull.Count > 0)

src/Runner.Worker/JobExtension.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -431,14 +431,6 @@ public async Task<List<IStep>> InitializeJob(IExecutionContext jobContext, Pipel
431431
context.Result = TaskResult.Canceled;
432432
throw;
433433
}
434-
catch (FailedToResolveActionDownloadInfoException ex)
435-
{
436-
// Log the error and fail the JobExtension Initialization.
437-
Trace.Error($"Caught exception from JobExtenion Initialization: {ex}");
438-
context.InfrastructureError(ex.Message);
439-
context.Result = TaskResult.Failed;
440-
throw;
441-
}
442434
catch (Exception ex)
443435
{
444436
// Log the error and fail the JobExtension Initialization.

0 commit comments

Comments
 (0)