fix(actions): show "Complete job" logs when the last step is skipped - #38939
Open
bircni wants to merge 3 commits into
Open
fix(actions): show "Complete job" logs when the last step is skipped#38939bircni wants to merge 3 commits into
bircni wants to merge 3 commits into
Conversation
The synthetic post step only claimed the remaining log range when the last step that had run was the final step in the list. A skipped step is not counted as having run, so a job ending in a skipped step left the post step with an empty range, hiding its logs and reporting 0s.
lunny
approved these changes
Aug 15, 2026
wxiaoguang
reviewed
Aug 16, 2026
| // If the lastHasRunStep is the last step, or it has failed, postStep has started. | ||
| if lastHasRunStep.Status.IsFailure() || lastHasRunStep == task.Steps[len(task.Steps)-1] { | ||
| // If no step is left to run, or the lastHasRunStep has failed, postStep has started. | ||
| if lastHasRunStep.Status.IsFailure() || task.Steps[len(task.Steps)-1].Status.IsDone() { |
Contributor
There was a problem hiding this comment.
Update the comments above?
// For example,
// 1. preStep(Success) -> step1(Success) -> step2(Running) -> step3(Waiting) -> postStep(Waiting): lastHasRunStep is step1.
// 2. preStep(Success) -> step1(Success) -> step2(Success) -> step3(Success) -> postStep(Success): lastHasRunStep is step3.
// 3. preStep(Success) -> step1(Success) -> step2(Failure) -> step3 -> postStep(Waiting): lastHasRunStep is step2.
// So its Stopped is the Started of postStep when there are no more steps to run.
Contributor
Signed-off-by: bircni <bircni@icloud.com>
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.

FullStepsonly gave the synthetic "Complete job" step the remaining log range when the last step that had run was also the final step of the job. A skipped step does not count as having run, so any job ending in a skipped step left the post step with an empty range: its logs were stored but never rendered, and the duration showed as0s.Reproducible with any job whose last step is skipped, which is common for failure notifications:
The gate now checks whether the final step is done, which preserves the behaviour from #29926 of showing the post step as waiting while steps are still pending.
--> Regression from #29926