Repository navigation
fix(task): preserve error chain with TaskError and record task errors in TaskRunStatus - #1050
Merged
Merged
Conversation
… in TaskRunStatus
kyasbal
requested review from
K53,
jyane,
kkuchima and
renamoo
as code owners
September 28, 2026 03:48
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a structured TaskError type to wrap errors occurring during task execution with their corresponding task IDs, enabling proper error unwrapping. It also adds an Error field to TaskRunStatus to capture the error for each task execution. Test suites in both task and inspection packages are updated and expanded to verify the error wrapping, unwrapping, and status reporting behavior. I have no feedback to provide as the changes are well-implemented and thoroughly tested.
Merged
via the queue into
GoogleCloudPlatform:main
with commit Sep 28, 2026
761586d
17 checks passed
8 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TaskErrorinpkg/core/taskholdingTaskIDandErrthat implementsError()(preserving the existing formatted message) andUnwrap()so callers ofLocalRunner.Result(),InspectionTaskRunner.Result(), andInspectionTaskRunner.DryRun()can inspect the underlying error cause witherrors.Isanderrors.As.Error errortoTaskRunStatusand populate it inLocalRunner.markTaskFinishedso callers can inspect per-task failure causes fromTaskRunStatuses().cancel()beforereturn errinsidecurrentErrGrp.GoinLocalRunner.Runand the unsynchronizedr.resultErrorwrite inLocalRunner.runTasksoerrgroup.WithContextrecords the root task error before cancelling dependent tasks.TaskErrorunwrapping andTaskRunStatus.Errorinpkg/core/task/runner_test.goandpkg/core/inspection/runner_test.go.