Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

Maximilien-R
Copy link
Contributor

Context

When a TaskRun references StepActions, TaskRun.Status.Steps is partially populated during resolution (to capture provenance). Later, pod-based status processing appends inline steps, which can result in StepAction 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:

  • Incorrect ordering: StepAction steps appear first and inline steps are appended, regardless of their real execution order in the pod.
  • UI "popping": In the Tekton Dashboard, StepAction-backed steps show up immediately (post-resolution) while inline steps only appear later (after pod creation and status reconciliation). This causes steps to "pop" into view and reshuffle, which is confusing.

Fixes #9037

Changes

This PR includes two complementary commits that address both completeness and ordering of Status.Steps.

  • Commit n°1:
    • setTaskRunStatusBasedOnStepStatus now constructs a new ordered slice the size of the step container list and replaces trs.Steps in one shot.
    • The input stepStatuses were already sorted to match pod.Spec.Containers; we leverage that to ensure strict pod-order.
    • Provenance for matching steps (by name) is preserved.
  • Commit n°2:
    • During GetStepActionsData, if at least one StepAction is present in the Task, create a StepState for every step:
      • StepAction steps get Provenance.RefSource when available.
      • Inline steps get nil provenance.
    • This makes Status.Steps complete earlier in the lifecycle, removing the Dashboard "popping" effect where StepAction steps appear first and inline steps arrive later.

Release Notes

- `TaskRun.Status.Steps` now strictly follows the pod’s step container order.
- When `StepActions` are used, inline steps are also included in `TaskRun.Status.Steps` (with nil provenance) early, preventing steps from "popping" into view later and improving dashboard stability.

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`.
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 19, 2025
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign dibyom after the PR has been reviewed.
You can assign the PR to them by writing /assign @dibyom in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 19, 2025
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/status.go 92.2% 92.4% 0.1

@waveywaves
Copy link
Member

/retest

@waveywaves waveywaves requested review from vdemeester and waveywaves and removed request for jerop September 23, 2025 17:26
@waveywaves
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

TaskRun Status.Steps order incorrect when using StepAction
3 participants