ae2c5fdbbb
* This patch adds the first version of the REST endpoint that can generate a report for a workflow execution. Without any query parameters, GET method of the endpoint returns a tree-like structure that includes information about all execution objects associated with the specified workflow execution. The root object is the workflow execution itself, its children are task executions, each task execution has either action executions or workflow executions and so on. So the structure describes the entire set of execution objects regardless of how deep there are from the root object. This kind of data itself can be used to better understand and visualise the process related with a parent workflow, see what paths were taken while the workflow was running. If additional parameters are provided in a query string, the endpoint can give only a subset of the entire tree. Currently, the filters are: 1. "errors_only" (boolean) to retain only all execution objects with the error state, meaning that only all error paths are present in the report. It is useful when we need to do a root cause analysis of the workflow failure. False by default. 2. "max_depth" (integer) to limit how deep the algorithm can go into nested workflows. If set to 0, only the root workflow execution will be in the report. If set to 1, then the report will have only the root workflow execution and its direct children. And so on. If negative (by default) then no limit is set. Additionally, the report contains statistics about task executions examined while the report was being generated, like the number of tasks in the error state, number of tasks that successfully finished and so on. * Added all main tests for the endpoint. Note that despite the fact that this test verifies a REST API endpoint, unlike the other API tests it runs a Mistral engine to run workflows. This is done to simplify the test implementation so that we don't have to mock everything with huge data structures like we do in other API tests. Possible changes that may be made based on the feedback: * Statistics can contain not only number of tasks in certain states. We can also add things like number of actions, depth of the tree, number of nested workflows, average task/action/workflow execution time etc. * Additional query parameters to configure a generated report. For example, "statistics_only" just to get a general information about the workflow execution tree, not the tree itself. Another example is "running_only" to retain only not finished workflow paths. Implements blueprint: mistral-error-analysis Change-Id: Id3e17821e04b7a1b84dfea5126d223d90ad8e3c2 |
||
---|---|---|
.. | ||
controllers | ||
hooks | ||
__init__.py | ||
access_control.py | ||
app.py | ||
service.py | ||
wsgi.py |