Skip to content

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):

  • ONGOING if the workflow is RUNNING or the workflow is DONE and has active workers
  • COMPLETE if the workflow is DONE and has no active workers, INTERRUPTED otherwise

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.