-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(taskrun): ensure status steps are ordered correctly when using StepAction #9039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(taskrun): ensure status steps are ordered correctly when using StepAction #9039
Conversation
The following is the coverage report on the affected files.
|
/retest |
/assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for this fix ! I have one performance fix, a comment suggestion and wanted to point that when not StepActions exist, StepStates won't get created considering that we are returning on lines 202-204 in taskspec.go. we should have StepStates created regardless for consistent behaviour right ?
bb65aa8
to
faa13e8
Compare
Hi @waveywaves 👋 I've taken your feedback into account and made the following changes:
For the third commit, in absolute terms, when inline steps only, we don't have the issue I'm trying to solve; however, populating |
The following is the coverage report on the affected files.
|
/retest |
Thank you @Maximilien-R can you rebase the PR, there seems to be an issue with the CI |
The `TaskRun.Status.Steps` list was not guaranteed to reflect the true execution order when StepActions were involved. Steps populated earlier (from StepAction resolution) were left at the front, with inline steps appended later, causing a mismatch with the pod container order and confusing dashboards. This change fixes the issue by creating a temporary slice aligned with the (already sorted) pod step container sequence and then replace `trs.Steps` in one shot. We still preserve existing `Provenance` for matching steps by name.
…ns are used When at least one StepAction is referenced, `TaskRun.Status.Steps` is pre-populated to capture provenance for remote steps during resolution. However, inline steps were not included at that stage and only appeared later during pod-based status reconciliation. This contributed to confusing ordering and visibility for dashboards relying on `Status.Steps`. In the Tekton Dashboard specifically, StepAction-backed steps showed up first (because they were present in `Status.Steps` right after resolution), while inline steps appeared only after the pod was created and `MakeTaskRunStatus` had run to append them. This resulted in steps "popping" into view and reshuffling, which was confusing. When a `TaskRun` references at least one `StepAction`, in the resolution flow, the inline `Step` should also append an entry in `Status.Steps` even if it has no `Provenance`. add comment for readibility
With this change, TaskRun.Status.Steps are now populated even when there is only inline steps defined.
faa13e8
to
52a30a3
Compare
@waveywaves I did the rebase but the e2e tests still don't pass 😞 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hmm, are those images not available anymore ? |
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