-
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 |
faa13e8
to
52a30a3
Compare
@waveywaves I did the rebase but the e2e tests still don't pass 😞 |
Hmm, are those images not available anymore ? |
/retest |
52a30a3
to
b0f2db3
Compare
/kind bug |
d5b6c91
to
4197b8f
Compare
05d36d5
to
4d6af0b
Compare
/retest |
2 similar comments
/retest |
/retest |
9d70974
to
1bbe20a
Compare
@waveywaves if you are satisfied with the changes, could you remove the "requested change" from the PR? |
/retest |
1 similar comment
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vdemeester, waveywaves 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 |
…tion order The TaskRun.Status.Steps list was not guaranteed to reflect the true execution order when StepActions were involved, causing confusing behavior in dashboards like Tekton Dashboard where steps would appear to "pop" into view and reshuffle. This change addresses three related issues: 1. Steps populated from StepAction resolution appeared first in Status.Steps, while inline steps were only added later during pod-based status reconciliation, creating a mismatch with actual execution order. 2. When TaskRuns used StepActions, inline steps were missing from Status.Steps during the resolution phase, contributing to the ordering confusion. 3. The final Status.Steps ordering didn't match the pod container sequence, making it difficult for dashboards to display accurate step progression. The fix ensures that: - Status.Steps are populated for both StepAction-backed and inline steps during resolution, even when there is no StepActions involved - The final Status.Steps ordering is aligned with the pod step container sequence by creating a temporary slice and replacing trs.Steps in one shot - Existing Provenance information is preserved for matching steps by name
1bbe20a
to
73ff66e
Compare
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