Skip to content

Report infra_error for action download failures.#4294

Open
TingluoHuang wants to merge 2 commits intomainfrom
users/tihuang/setuptelemtry
Open

Report infra_error for action download failures.#4294
TingluoHuang wants to merge 2 commits intomainfrom
users/tihuang/setuptelemtry

Conversation

@TingluoHuang
Copy link
Member

Make sure we know that download actions are failing for whatever reason, help identify and investigate server-side problem easier.

@TingluoHuang TingluoHuang requested a review from a team as a code owner March 12, 2026 16:13
Copilot AI review requested due to automatic review settings March 12, 2026 16:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds explicit infrastructure error reporting for action download failures so runner logs/telemetry can better distinguish download issues from other action preparation problems.

Changes:

  • Introduces FailedToDownloadActionException in DTWebApi exception set.
  • Wraps non-cancellation download failures in DownloadRepositoryArchive with FailedToDownloadActionException.
  • Catches FailedToDownloadActionException in PrepareActionsAsync and reports an InfrastructureError with a new category.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Sdk/DTWebApi/WebApi/Exceptions.cs Adds a new serializable FailedToDownloadActionException type for propagating download failures with an inner exception.
src/Runner.Worker/ActionManager.cs Wraps download failures and reports them as infrastructure issues during action preparation.
Comments suppressed due to low confidence (1)

src/Runner.Worker/ActionManager.cs:1263

  • DownloadRepositoryArchive now wraps all non-cancellation exceptions in FailedToDownloadActionException. This includes ActionNotFoundException (404) which previously bubbled up as a user/action configuration error (and is covered by existing L0 tests). Wrapping it will reclassify 404s as infrastructure failures (via the PrepareActionsAsync catch) and changes the thrown exception type/behavior.

Consider excluding ActionNotFoundException (and any other intentionally-surfaced exceptions) from this wrapper, e.g. by adding a dedicated catch/rethrow before this catch, or by refining the exception filter to skip those types.

            catch (Exception ex) when (!(ex is OperationCanceledException) && !executionContext.CancellationToken.IsCancellationRequested)
            {
                Trace.Error($"Failed to download archive '{downloadUrl}' after {retryCount + 1} attempts.");
                Trace.Error(ex);
                throw new FailedToDownloadActionException($"Failed to download archive '{downloadUrl}' after {retryCount + 1} attempts.", ex);
            }

You can also share your feedback on Copilot code review. Take the survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants