fix(taskrun): ensure status steps are ordered correctly when using StepAction #9039
+365
−24
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.
Context
When a
TaskRun
referencesStepActions
,TaskRun.Status.Steps
is partially populated during resolution (to capture provenance). Later, pod-based status processing appends inline steps, which can result inStepAction
steps being shown first and inline steps last, regardless of the real pod order.This breaks dashboards and tools that assume
Status.Steps
reflects the true execution order:StepAction
steps appear first and inline steps are appended, regardless of their real execution order in the pod.Fixes #9037
Changes
This PR includes two complementary commits that address both completeness and ordering of Status.Steps.
setTaskRunStatusBasedOnStepStatus
now constructs a new ordered slice the size of the step container list and replacestrs.Steps
in one shot.stepStatuses
were already sorted to matchpod.Spec.Containers
; we leverage that to ensure strict pod-order.GetStepActionsData
, if at least oneStepAction
is present in theTask
, create aStepState
for every step:StepAction
steps getProvenance.RefSource
when available.nil
provenance.Status.Steps
complete earlier in the lifecycle, removing the Dashboard "popping" effect whereStepAction
steps appear first and inline steps arrive later.Release Notes