Commit Graph

12 Commits

Author SHA1 Message Date
Oleg Ovcharuk e72a4e9a70 Task skipping feature
This patch adds an ability to rerun failed workflow by
skipping failed tasks. Workflow behavior in skip case could
be configured by new fields in task definition:
* on-skip
* publish-on-skip

Change-Id: Ib802a1b54e69c29b4d0361f048c2b9c076a4c176
Implements: blueprint mistral-task-skipping-feature
Signed-off-by: Oleg Ovcharuk <vgvoleg@gmail.com>
2022-12-01 01:47:30 +03:00
wu.shiming 0d3509e28c Import HTTPStatus instead of http_client
We don't need an HTTP client for this, we only
need status codes.  Just load that instead.

https://docs.python.org/3/library/http.html

Change-Id: Iaccc059aad4d31a413844bfc252d544a591dfc95
2020-11-11 15:44:33 +08:00
Q.hongtao da5ac25415 Remove six.moves
Remove six.moves Replace the following items with Python 3 style code.
- six.moves.urllib
- six.moves.queue
- six.moves.range
- six.moves.http_client

Subsequent patches will replace other six usages.

Change-Id: I80c713546fcc97391c64e95ef708830632e1ef32
2020-09-22 08:34:20 +08:00
Q.hongtao aba14934e7 Remove usage of six.add_metaclass
With python 3.x, classes can use the metaclass= logic
to not require usage of the six library.

Subsequent patches will replace other six usages.

Change-Id: Iefdc99c338c7aaea18d535426c4676dbedb44f32
2020-09-19 11:37:24 +08:00
Renat Akhmerov 90d1f1ba8e Refactor workflow notifications
* Moved all notification management for workflows into the method
  Workflow.set_state(). It's now in one place. Workflow events are
  now also identified in one method similar to how it works for
  tasks based on state transitions.
* Other style changes.

Change-Id: I40941ecca3eb4b46a06a2f7dc2fd5d909d5d087a
2020-06-03 18:44:18 +07:00
ali 7e7f1cb92b moved generic util functions from mistral to mistral-lib
Depends-On: I780c270e4b1a184d7d4dcc580d23697ba75edab1
Closes-bug: #1815183
Change-Id: I5a1d402baa3f69c37f9347c8b3d02a83b8f60423
2019-09-13 04:06:27 +00:00
Andras Kovi 5eb2a21607 Improve workflow notifications and webhook data
The task_execution_id is required to be able to restore the hierarchy
of tasks and workflows on the notification receiver side. Also, including
the event in the notification is very useful.

Also fix the documentation as multiline strings are not supported in
ini files.

Change-Id: I714fd5c32b0f31f85ac5a4d22d161e662bf18687
2019-09-04 07:12:20 +02:00
Vitalii Solodilov aed90bab7e New rerun events
Currently, all workflow actions, for example, start, pause, resume,
stop have own events except rerun. Even when we rerun a task, event
"TASK_LAUNCHED" doesn't propagate to a parent workflow and task.

Add new WORKFLOW_RERUN and TASK_RERUN events. These events propagate
to a parent workflow and task. You can find a example of new events in
the following tests:
* test_notify_rerun_task
* test_notify_rerun_nested_workflow

The recursive parameter was removed in the workflow set_state method
because it only is used in the rerun method. Recursive rerun was
extracted in the separate function.

Change-Id: Ib8bd3cf5c314ab4529260736cc0b7d792ce53171
Closes-Bug: #1790441
Signed-off-by: Vitalii Solodilov <mcdkr@yandex.ru>
Co-Authored-By: Oleg Ovcharuk <vgvoleg@gmail.com>
2019-07-11 23:29:47 +00:00
Winson Chan 1df722d90d Pass auth context to the event publishers
Pass the auth context to the event publishers for integration with other OpenStack services.

Change-Id: Id0ee6780386f28e44e354ca36e4bacab87e96beb
Implements: blueprint mistral-execution-event-subscription
2019-05-03 17:38:10 +00:00
Vitalii Solodilov 219ffa6074 Minor improvement of the NoopPublisher
A name is more human readable. Workflow and task always have a name.
It's convenient when you play with notifications.

Change-Id: I6fda6ea688a720605819545d2f86a1534bf1d480
Signed-off-by: Vitalii Solodilov <mcdkr@yandex.ru>
2018-09-03 11:45:57 +00:00
Dougal Matthews 9f03835d0b Add a debug log for the webhook publisher
Without this, it is hard to tell from the logging if the notifier was
ever called.

Change-Id: I76c0259aee3ad65c1009730636da6d06e719548c
2018-07-30 10:05:47 +01:00
Winson Chan 3f48e24dc4 Implement notification of execution events
Introduce execution events and notification server and plugins for
publishing these events for consumers. Event notification is defined per
workflow execution and can be configured to notify on all the events or
only for specific events.

Change-Id: I9820bdc4792a374dad9ad5310f84cd7aaddab8ca
Implements: blueprint mistral-execution-event-subscription
2018-02-24 07:25:55 +00:00