)]}'
{"specs/ocata/approved/workflow-preconditions.rst":[{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"287c359f32c8a43b65a7743fa391f4a496741bd3","unresolved":false,"context_lines":[{"line_number":47,"context_line":".. code-block:: yaml"},{"line_number":48,"context_line":"    preconditions:"},{"line_number":49,"context_line":"        start-if|not-start-if|pause-workflow|cancel-workflow:"},{"line_number":50,"context_line":"            [expression]: YAQL_expression"},{"line_number":51,"context_line":"            [workflow]: WORKFLOW_NAME"},{"line_number":52,"context_line":"            [is]: running|not-running"},{"line_number":53,"context_line":"            [with-input]:"}],"source_content_type":"text/x-rst","patch_set":1,"id":"fa6399be_29cbd61f","line":50,"range":{"start_line":50,"start_character":25,"end_line":50,"end_character":41},"updated":"2016-10-12 08:40:59.000000000","message":"Jinja too ? Now we support Jinja also along with YAQL","commit_id":"5613a8d7db76dd1c3afcecd387554e401ce89fbd"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"de23430b26f8997d90340e3016aa2b992f4d261b","unresolved":false,"context_lines":[{"line_number":47,"context_line":".. code-block:: yaml"},{"line_number":48,"context_line":"    preconditions:"},{"line_number":49,"context_line":"        start-if|not-start-if|pause-workflow|cancel-workflow:"},{"line_number":50,"context_line":"            [expression]: YAQL_expression"},{"line_number":51,"context_line":"            [workflow]: WORKFLOW_NAME"},{"line_number":52,"context_line":"            [is]: running|not-running"},{"line_number":53,"context_line":"            [with-input]:"}],"source_content_type":"text/x-rst","patch_set":1,"id":"fa6399be_d54ef639","line":50,"range":{"start_line":50,"start_character":25,"end_line":50,"end_character":41},"in_reply_to":"fa6399be_29cbd61f","updated":"2016-10-14 13:06:21.000000000","message":"Jinja too","commit_id":"5613a8d7db76dd1c3afcecd387554e401ce89fbd"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"287c359f32c8a43b65a7743fa391f4a496741bd3","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    preconditions:"},{"line_number":49,"context_line":"        start-if|not-start-if|pause-workflow|cancel-workflow:"},{"line_number":50,"context_line":"            [expression]: YAQL_expression"},{"line_number":51,"context_line":"            [workflow]: WORKFLOW_NAME"},{"line_number":52,"context_line":"            [is]: running|not-running"},{"line_number":53,"context_line":"            [with-input]:"},{"line_number":54,"context_line":"                - key: KEY"}],"source_content_type":"text/x-rst","patch_set":1,"id":"fa6399be_896ea22d","line":51,"range":{"start_line":51,"start_character":12,"end_line":51,"end_character":37},"updated":"2016-10-12 08:40:59.000000000","message":"I think, we should use Workflow_ID here as we can share workflow between tenant and they may have same name.","commit_id":"5613a8d7db76dd1c3afcecd387554e401ce89fbd"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"de23430b26f8997d90340e3016aa2b992f4d261b","unresolved":false,"context_lines":[{"line_number":48,"context_line":"    preconditions:"},{"line_number":49,"context_line":"        start-if|not-start-if|pause-workflow|cancel-workflow:"},{"line_number":50,"context_line":"            [expression]: YAQL_expression"},{"line_number":51,"context_line":"            [workflow]: WORKFLOW_NAME"},{"line_number":52,"context_line":"            [is]: running|not-running"},{"line_number":53,"context_line":"            [with-input]:"},{"line_number":54,"context_line":"                - key: KEY"}],"source_content_type":"text/x-rst","patch_set":1,"id":"fa6399be_f5493a32","line":51,"range":{"start_line":51,"start_character":12,"end_line":51,"end_character":37},"in_reply_to":"fa6399be_896ea22d","updated":"2016-10-14 13:06:21.000000000","message":"Agree","commit_id":"5613a8d7db76dd1c3afcecd387554e401ce89fbd"},{"author":{"_account_id":18238,"name":"Hardik Parekh","email":"hardik.parekh047@gmail.com","username":"hparekh"},"change_message_id":"287c359f32c8a43b65a7743fa391f4a496741bd3","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        input:"},{"line_number":102,"context_line":"            - input-param"},{"line_number":103,"context_line":"        preconditions:"},{"line_number":104,"context_line":"            start-if:"},{"line_number":105,"context_line":"                workflow: another_workflow"},{"line_number":106,"context_line":"                is: running"},{"line_number":107,"context_line":"            start-if:"},{"line_number":108,"context_line":"                expression: \u003c% $.input-param \u003d\u003d 1 %\u003e"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"This workflow would start only if workflow named *another_workflow* is running"},{"line_number":111,"context_line":"regardless the input parameters and if *input-param* has value \"1\"."}],"source_content_type":"text/x-rst","patch_set":1,"id":"fa6399be_ac0ff42c","line":108,"range":{"start_line":104,"start_character":11,"end_line":108,"end_character":52},"updated":"2016-10-12 08:40:59.000000000","message":"This statements will work as \"and\" condition or \"or\" condition ?","commit_id":"5613a8d7db76dd1c3afcecd387554e401ce89fbd"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"de23430b26f8997d90340e3016aa2b992f4d261b","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        input:"},{"line_number":102,"context_line":"            - input-param"},{"line_number":103,"context_line":"        preconditions:"},{"line_number":104,"context_line":"            start-if:"},{"line_number":105,"context_line":"                workflow: another_workflow"},{"line_number":106,"context_line":"                is: running"},{"line_number":107,"context_line":"            start-if:"},{"line_number":108,"context_line":"                expression: \u003c% $.input-param \u003d\u003d 1 %\u003e"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"This workflow would start only if workflow named *another_workflow* is running"},{"line_number":111,"context_line":"regardless the input parameters and if *input-param* has value \"1\"."}],"source_content_type":"text/x-rst","patch_set":1,"id":"fa6399be_556106a8","line":108,"range":{"start_line":104,"start_character":11,"end_line":108,"end_character":52},"in_reply_to":"fa6399be_ac0ff42c","updated":"2016-10-14 13:06:21.000000000","message":"As an \"and\" condition. I\u0027ll make it clearer in next patch.","commit_id":"5613a8d7db76dd1c3afcecd387554e401ce89fbd"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/mistral/+spec/mistral-preconditions"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"We need to be able to define preconditions so that it can be started only"},{"line_number":14,"context_line":"if all configured preconditions are met. It would give ability to wait for"},{"line_number":15,"context_line":"another workflow till it ends, only start workflow if another workflow is"},{"line_number":16,"context_line":"running or even pause/cancel another workflow as a precondition."}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_485f4b75","line":13,"range":{"start_line":13,"start_character":51,"end_line":13,"end_character":53},"updated":"2016-11-30 10:25:48.000000000","message":"a workflow","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":11,"context_line":"https://blueprints.launchpad.net/mistral/+spec/mistral-preconditions"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"We need to be able to define preconditions so that it can be started only"},{"line_number":14,"context_line":"if all configured preconditions are met. It would give ability to wait for"},{"line_number":15,"context_line":"another workflow till it ends, only start workflow if another workflow is"},{"line_number":16,"context_line":"running or even pause/cancel another workflow as a precondition."},{"line_number":17,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_a871bfe2","line":14,"range":{"start_line":14,"start_character":41,"end_line":14,"end_character":42},"updated":"2016-11-30 10:25:48.000000000","message":"I think it makes sense to add in the beginning of this sentence \"As an example,\" to make it clear that we\u0027re providing an example of preconditions.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":19,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Some workflows may not be run in parallel e.g. workflows that manipulate same"},{"line_number":22,"context_line":"heat stacks. For such workflows there is need to check if they can be safely"},{"line_number":23,"context_line":"run before starting them. The goal of this spec is to indroduce new"},{"line_number":24,"context_line":"workflow parameter preconditions that would enable user to specify"},{"line_number":25,"context_line":"what conditions needs to be met before the workflow can be started."}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_e8081730","line":22,"range":{"start_line":22,"start_character":41,"end_line":22,"end_character":45},"updated":"2016-11-30 10:25:48.000000000","message":"need -\u003e a need","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Some workflows may not be run in parallel e.g. workflows that manipulate same"},{"line_number":22,"context_line":"heat stacks. For such workflows there is need to check if they can be safely"},{"line_number":23,"context_line":"run before starting them. The goal of this spec is to indroduce new"},{"line_number":24,"context_line":"workflow parameter preconditions that would enable user to specify"},{"line_number":25,"context_line":"what conditions needs to be met before the workflow can be started."},{"line_number":26,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_b30db439","line":23,"range":{"start_line":23,"start_character":56,"end_line":23,"end_character":57},"updated":"2016-11-30 10:25:48.000000000","message":"d -\u003e t","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":22,"context_line":"heat stacks. For such workflows there is need to check if they can be safely"},{"line_number":23,"context_line":"run before starting them. The goal of this spec is to indroduce new"},{"line_number":24,"context_line":"workflow parameter preconditions that would enable user to specify"},{"line_number":25,"context_line":"what conditions needs to be met before the workflow can be started."},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"Use Cases"},{"line_number":28,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_f30f2c2c","line":25,"range":{"start_line":25,"start_character":20,"end_line":25,"end_character":21},"updated":"2016-11-30 10:25:48.000000000","message":"remove \"s\"","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"c4b29aadf96bbda49df48801423cfb0c98fccc52","unresolved":false,"context_lines":[{"line_number":28,"context_line":"---------"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"* As a user, I want to be able to automatically stop some other workflow(s)"},{"line_number":31,"context_line":"when starting my workflow."},{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_ae11cbae","line":31,"updated":"2016-11-15 12:32:21.000000000","message":"I don\u0027t think this is a precondition. This sounds more like workflow interruption. I would suggest this should be in it\u0027s own spec. I can\u0027t really think of a valid use-case for this.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":28,"context_line":"---------"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"* As a user, I want to be able to automatically stop some other workflow(s)"},{"line_number":31,"context_line":"when starting my workflow."},{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_535f0075","line":31,"in_reply_to":"7a77a97e_41c0d67c","updated":"2016-11-30 10:25:48.000000000","message":"The use case you describe seems OK but I also agree that it\u0027s a different functionality. Also, seems like it can be achieved even now via using mistral actions. So that the WF that works with a group of VMs could call mistral itself to stop a different WF (working with one VM) if it\u0027s running.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"0f9fd861906321a9715d92ae2196256d5bace7e4","unresolved":false,"context_lines":[{"line_number":28,"context_line":"---------"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"* As a user, I want to be able to automatically stop some other workflow(s)"},{"line_number":31,"context_line":"when starting my workflow."},{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_41c0d67c","line":31,"in_reply_to":"7a77a97e_ae11cbae","updated":"2016-11-16 11:03:12.000000000","message":"I agree that this may be treated as workflow interruptions rather than workflow precondition and it can have it\u0027s own spec. Talking about valid use-case, here\u0027s one:\n\nLet\u0027s assume that we have to workflows: one is for rescuing (whatever it means) a particular VM and second for rescuing all VMs from given host. Now, if some VM fails some monitoring tool would start the first WF. If during this workflow execution whole host goes down, same monitoring tool would run a second workflow. It is more important to save the bunch of VMs, then just one of them. But since both workflows would operate on same VM, it may lead to some errors. So it would be best to firstly cancel workflow that rescue only one VM, before starting the one that rescues whole node.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"c4b29aadf96bbda49df48801423cfb0c98fccc52","unresolved":false,"context_lines":[{"line_number":30,"context_line":"* As a user, I want to be able to automatically stop some other workflow(s)"},{"line_number":31,"context_line":"when starting my workflow."},{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_0eab9f1e","line":33,"updated":"2016-11-15 12:32:21.000000000","message":"This one I am not sure about, but I think I could be persuaded.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"0f9fd861906321a9715d92ae2196256d5bace7e4","unresolved":false,"context_lines":[{"line_number":30,"context_line":"* As a user, I want to be able to automatically stop some other workflow(s)"},{"line_number":31,"context_line":"when starting my workflow."},{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_c1b946cd","line":33,"in_reply_to":"7a77a97e_0eab9f1e","updated":"2016-11-16 11:03:12.000000000","message":"Maybe this one also could be in a different spec. We could, for example, send notifications once a workflow has ended and then, using mistral event engine catch it and start some other workflow. It would also satisfy this use case.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":30,"context_line":"* As a user, I want to be able to automatically stop some other workflow(s)"},{"line_number":31,"context_line":"when starting my workflow."},{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_8e57abc9","line":33,"in_reply_to":"7a77a97e_c1b946cd","updated":"2016-11-30 10:25:48.000000000","message":"Or it can be an extra step in the WF that sends a notification to the control system (something that uses mistral) to start a new workflow.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"c4b29aadf96bbda49df48801423cfb0c98fccc52","unresolved":false,"context_lines":[{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"},{"line_number":37,"context_line":"workflow."},{"line_number":38,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_4e9597e2","line":35,"updated":"2016-11-15 12:32:21.000000000","message":"I think this would be very useful. I am not sure \"error\" is the correct name, is it really an error? I don\u0027t think we have a good state at the moment. Something like \"aborted\" would be good I think - but I am not sure we want to add a new workflow state.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"0f9fd861906321a9715d92ae2196256d5bace7e4","unresolved":false,"context_lines":[{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"},{"line_number":37,"context_line":"workflow."},{"line_number":38,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_a1bc4a6d","line":35,"in_reply_to":"7a77a97e_4e9597e2","updated":"2016-11-16 11:03:12.000000000","message":"I think that state \u0027cancelled\u0027 with sufficient state message would be enough.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"550896e86c5f4725b58ed9abb7d42c59f6f4c52f","unresolved":false,"context_lines":[{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"},{"line_number":37,"context_line":"workflow."},{"line_number":38,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_b347414a","line":35,"in_reply_to":"7a77a97e_a1bc4a6d","updated":"2016-11-16 11:07:55.000000000","message":"Yup, I think so. I had forgotten about the cancelled state when I wrote that.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":32,"context_line":"* As a user, I want to automatically postpone start of a workflow till some"},{"line_number":33,"context_line":"other workflow(s) end."},{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"},{"line_number":37,"context_line":"workflow."},{"line_number":38,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_2e1db7bd","line":35,"in_reply_to":"7a77a97e_b347414a","updated":"2016-11-30 10:25:48.000000000","message":"The general problem I see in all similar requirements is that does this kind of check really make sense? Imagine that I\u0027m starting the workflow X with this kind of precondition that says that X must get cancelled if Y is running. We may easily get the following situation. While starting X we checked that there\u0027s an instance of Y which is running, but in the next millisecond Y becomes completed (right after the check). So we\u0027ll have cancelled X and completed Y.\n\n Having that said, it seems to me that actually postponing a workflow X till Y is completed is a more useful and realistic thing. And this is something that Mistral could do because it could provide guarantees that this is atomic, meaning that there will never be a situation when both X and Y are running. From the outside it is impossible to do because by the time when a response from Mistral API is received a real state of objects could have changed. Or, Mistral API should provide some sort of transactions.\n\nAtomicity of such checks is an obvious pro to implementing some of the preconditions (may be the term here is not exactly correct) inside of Mistral. Some of them are simply impossible to implement outside.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":9712,"name":"Dougal Matthews","email":"dougal.matthews@canonical.com","username":"dougal"},"change_message_id":"c4b29aadf96bbda49df48801423cfb0c98fccc52","unresolved":false,"context_lines":[{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"},{"line_number":37,"context_line":"workflow."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"Proposed change"},{"line_number":40,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"7a77a97e_ceb0c78e","line":37,"updated":"2016-11-15 12:32:21.000000000","message":"I also like the idea of this.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":8731,"name":"Renat Akhmerov","email":"renat.akhmerov@gmail.com","username":"rakhmerov"},"change_message_id":"88141a095b31dec18874d89da896057cd3b62ecf","unresolved":false,"context_lines":[{"line_number":34,"context_line":"* As a user, I want to automatically set my workflow into error state if some"},{"line_number":35,"context_line":"other workflow(s) is running."},{"line_number":36,"context_line":"* As a user, I want to check some preconditions using yaql before starting my"},{"line_number":37,"context_line":"workflow."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"Proposed change"},{"line_number":40,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"5a74a57a_025fef0e","line":37,"in_reply_to":"7a77a97e_ceb0c78e","updated":"2016-11-30 10:25:48.000000000","message":"I think this is relatively simple to implement and it would be useful. I see no issues with implementing it inside Mistral.\n\nOne example that just came to my mind is that using this we could control the maximum number of certain workflows, i.e. \"cluster scale up\" workflow can be only one. In order to do that we could have a yaql/jinja expression that gets a number of executions of this workflow and make a comparison. But again, we might have a race condition here if we don\u0027t provide atomicity. We need to make sure that when this precondition is being checked no other workflows are starting. Otherwise, we may have many workflows that will all check this precondition \"simultaneously\" and start, and we\u0027ll violate the invariant . \n\nBut atomicity is doable, internal locking (e.g. DB based) can solve this problem. And again, this is something that can be done reliably only inside of Mistral.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"0a698fc3dfd143e6fdc202e40166e423e9bc7008","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        input:"},{"line_number":135,"context_line":"            - input-param"},{"line_number":136,"context_line":"        preconditions:"},{"line_number":137,"context_line":"            pause-workflow:"},{"line_number":138,"context_line":"                workflow: 123e4567-e89b-12d3-a456-426655440000"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"This workflow would pause workflow *another_workflow* before it starts."}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_5e71ccdf","line":137,"range":{"start_line":137,"start_character":12,"end_line":137,"end_character":26},"updated":"2016-10-18 09:51:58.000000000","message":"i\u0027m concerned with this capability, it\u0027s too powerful for normal mistral users, which means they can pause any executions related to that workflow, even if the executions are created by other users.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":6732,"name":"Lingxian Kong","email":"anlin.kong@gmail.com","username":"kong"},"change_message_id":"fc0fa17023a9f9f2ad52e95b509b09533e275bb0","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        input:"},{"line_number":135,"context_line":"            - input-param"},{"line_number":136,"context_line":"        preconditions:"},{"line_number":137,"context_line":"            pause-workflow:"},{"line_number":138,"context_line":"                workflow: 123e4567-e89b-12d3-a456-426655440000"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"This workflow would pause workflow *another_workflow* before it starts."}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_68206f4a","line":137,"range":{"start_line":137,"start_character":12,"end_line":137,"end_character":26},"in_reply_to":"fa6399be_4493a8fa","updated":"2016-10-18 21:01:00.000000000","message":"Yeah, fair enough. Given mistral now supports shared workflow, we should be careful when giving end user new capability of workflow operations.","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"},{"author":{"_account_id":19206,"name":"Dawid Deja","email":"dawdej@gmail.com","username":"ddeja"},"change_message_id":"40e6d6fbba5f6d889dc282f8d23798de241284fa","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        input:"},{"line_number":135,"context_line":"            - input-param"},{"line_number":136,"context_line":"        preconditions:"},{"line_number":137,"context_line":"            pause-workflow:"},{"line_number":138,"context_line":"                workflow: 123e4567-e89b-12d3-a456-426655440000"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"This workflow would pause workflow *another_workflow* before it starts."}],"source_content_type":"text/x-rst","patch_set":2,"id":"fa6399be_4493a8fa","line":137,"range":{"start_line":137,"start_character":12,"end_line":137,"end_character":26},"in_reply_to":"fa6399be_5e71ccdf","updated":"2016-10-18 13:45:21.000000000","message":"I would imagine that one can only cancel|pause only his own executions (same as he only can see his own workflow specs). Would it be OK this way?","commit_id":"c8bc0e6438b3d180ebef969315d6a4e62a276736"}]}
