pipeline: (*PipelineRun).IsDone() is incorrect
The (*PipelineRun).IsDone() function returns true when the Success condition is no longer Unknown. However, as soon as the first task in the PipelineRun fails it sets the PipelineRun’s Success condition to False, and IsDone() immediately returns true, despite several other tasks still Running.
Instead, IsDone() should check Status.CompletionTime or iterate through all tasks and check whether all tasks have finished executing.
Two new HasSucceeded() and HasFailed() functions can take the place of IsDone() if needed.
I’m happy to submit a PR if this sounds sensible.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (21 by maintainers)
/assign pritidesai
I need to get this fix while working on
finally,finallytasks are executed after one of thepipelinetasksfail, pipeline status should not be updated until finally tasks have finished executing.finallyis getting implemented with PR #2661Good to know, thanks. Note that the problem is not that the completion time is incorrect, but that pr.IsDone returns true before completionTime is set.
Sounds reasonable!
That’d be awesome! Thanks 🙏
(Also remove area/api label since this only technically affects a function in the reconciler)