Improve /GET datasources endpoint workflow statuses handling
Current situation
After the most recent data sources refactoring, GET /datasources endpoint 200 response contains an endpoint-specific details.status entry (=workflow status):
-
ONGOINGif the workflow isRUNNINGor the workflow isDONEand has active workers -
COMPLETEif the workflow isDONEand has no active workers,INTERRUPTEDotherwise
This endpoint-specific workflow status handling covers the cases when the workers are stuck on a failed or cancelled workflow. Nevertheless, the hypothetical case with the workers stuck on a successfully completed workflow is not covered and the workflow will remain ONGOING. Currently, it can be problematic for the quality gate plugin and get datasource command.
Desired outcome
Find a way to correctly handle workflows which have DONE status and active workers, maybe adding a new entry in details part of the endpoint response that indicates that the workflow is completed and/or the workflow completion timestamp.