Skip to content

Commit

Permalink
Adding Consistency to 'Failed To Resolve Action Download Info' Infras…
Browse files Browse the repository at this point in the history
…tructure 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]>
  • Loading branch information
vmjoseph and TingluoHuang authored May 11, 2023
1 parent eeb0cf6 commit 49b0497
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
15 changes: 14 additions & 1 deletion src/Runner.Worker/ActionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using WebApi = GitHub.DistributedTask.WebApi;
using Pipelines = GitHub.DistributedTask.Pipelines;
using PipelineTemplateConstants = GitHub.DistributedTask.Pipelines.ObjectTemplating.PipelineTemplateConstants;
using GitHub.DistributedTask.WebApi;

namespace GitHub.Runner.Worker
{
Expand Down Expand Up @@ -101,7 +102,19 @@ public sealed class ActionManager : RunnerService, IActionManager
}
IEnumerable<Pipelines.ActionStep> actions = steps.OfType<Pipelines.ActionStep>();
executionContext.Output("Prepare all required actions");
var result = await PrepareActionsRecursiveAsync(executionContext, state, actions, depth, rootStepId);
PrepareActionsState result = new PrepareActionsState();
try
{
result = await PrepareActionsRecursiveAsync(executionContext, state, actions, depth, rootStepId);
}
catch (FailedToResolveActionDownloadInfoException ex)
{
// Log the error and fail the PrepareActionsAsync Initialization.
Trace.Error($"Caught exception from PrepareActionsAsync Initialization: {ex}");
executionContext.InfrastructureError(ex.Message);
executionContext.Result = TaskResult.Failed;
throw;
}
if (!FeatureManager.IsContainerHooksEnabled(executionContext.Global.Variables))
{
if (state.ImagesToPull.Count > 0)
Expand Down
8 changes: 0 additions & 8 deletions src/Runner.Worker/JobExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,6 @@ public async Task<List<IStep>> InitializeJob(IExecutionContext jobContext, Pipel
context.Result = TaskResult.Canceled;
throw;
}
catch (FailedToResolveActionDownloadInfoException ex)
{
// Log the error and fail the JobExtension Initialization.
Trace.Error($"Caught exception from JobExtenion Initialization: {ex}");
context.InfrastructureError(ex.Message);
context.Result = TaskResult.Failed;
throw;
}
catch (Exception ex)
{
// Log the error and fail the JobExtension Initialization.
Expand Down

0 comments on commit 49b0497

Please sign in to comment.