From 0dffe9722d2d987ee3480d0948ad94cad8214b78 Mon Sep 17 00:00:00 2001 From: corey Date: Tue, 17 Apr 2018 10:08:12 -0400 Subject: [PATCH 1/3] Fix for bug if an action is unbounded not being able to be executed --- tests/test_action.py | 28 ++++----- walkoff/appgateway/appinstancerepo.py | 14 +++-- walkoff/executiondb/action.py | 13 +++- walkoff/executiondb/workflow.py | 15 ++--- .../multiprocessedexecutor/proto_helpers.py | 3 +- walkoff/multiprocessedexecutor/worker.py | 2 +- walkoff/proto/build/data_pb2.py | 59 +++++++++---------- walkoff/proto/data.proto | 2 +- 8 files changed, 73 insertions(+), 63 deletions(-) diff --git a/tests/test_action.py b/tests/test_action.py index 448e6e5f3..db99e1a5a 100644 --- a/tests/test_action.py +++ b/tests/test_action.py @@ -106,7 +106,7 @@ def test_init_with_triggers(self): def test_execute_no_args(self): action = Action(app_name='HelloWorld', action_name='helloWorld', name='helloWorld') instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - self.assertEqual(action.execute(instance.instance, {}), ActionResult({'message': 'HELLO WORLD'}, 'Success')) + self.assertEqual(action.execute({}, instance.instance), ActionResult({'message': 'HELLO WORLD'}, 'Success')) self.assertEqual(action._output, ActionResult({'message': 'HELLO WORLD'}, 'Success')) def test_execute_return_failure(self): @@ -130,7 +130,7 @@ def callback_is_sent(sender, **kwargs): WalkoffEvent.CommonWorkflowSignal.connect(callback_is_sent) - action.execute(instance.instance, {}) + action.execute({}, instance.instance) self.assertTrue(result['started_triggered']) self.assertTrue(result['result_triggered']) @@ -155,7 +155,7 @@ def callback_is_sent(sender, **kwargs): WalkoffEvent.CommonWorkflowSignal.connect(callback_is_sent) - action.execute(instance.instance, {}) + action.execute({}, instance.instance) self.assertTrue(result['started_triggered']) self.assertTrue(result['result_triggered']) @@ -164,7 +164,7 @@ def test_execute_generates_id(self): action = Action(app_name='HelloWorld', action_name='helloWorld', name='helloWorld') original_execution_id = action.get_execution_id() instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - action.execute(instance.instance, {}) + action.execute({}, instance.instance) self.assertNotEqual(action.get_execution_id(), original_execution_id) def test_execute_with_args(self): @@ -173,7 +173,7 @@ def test_execute_with_args(self): Argument('num2', value='4.3'), Argument('num3', value='10.2')]) instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - result = action.execute(instance.instance, {}) + result = action.execute({}, instance.instance) self.assertAlmostEqual(result.result, 8.9) self.assertEqual(result.status, 'Success') self.assertEqual(action._output, result) @@ -202,7 +202,7 @@ def callback_is_sent(sender, **kwargs): WalkoffEvent.CommonWorkflowSignal.connect(callback_is_sent) - action.execute(instance.instance, {}) + action.execute({}, instance.instance) self.assertTrue(result['started_triggered']) self.assertTrue(result['result_triggered']) @@ -213,7 +213,7 @@ def test_execute_with_accumulator_with_conversion(self): Argument('num3', value='10.2')]) accumulator = {'1': '-5.6', 'action2': '4.3'} instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - result = action.execute(instance.instance, accumulator) + result = action.execute(accumulator, instance.instance) self.assertAlmostEqual(result.result, 8.9) self.assertEqual(result.status, 'Success') self.assertEqual(action._output, result) @@ -225,7 +225,7 @@ def test_execute_with_accumulator_with_extra_actions(self): Argument('num3', value='10.2')]) accumulator = {'1': '-5.6', 'action2': '4.3', '3': '45'} instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - result = action.execute(instance.instance, accumulator) + result = action.execute(accumulator, instance.instance) self.assertAlmostEqual(result.result, 8.9) self.assertEqual(result.status, 'Success') self.assertEqual(action._output, result) @@ -237,7 +237,7 @@ def test_execute_with_accumulator_missing_action(self): Argument('num3', value='10.2')]) accumulator = {'1': '-5.6', 'missing': '4.3', '3': '45'} instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - action.execute(instance.instance, accumulator) + action.execute(accumulator, instance.instance) def test_execute_with_accumulator_missing_action_callbacks(self): action = Action(app_name='HelloWorld', action_name='Add Three', name='helloWorld', @@ -259,7 +259,7 @@ def callback_is_sent(sender, **kwargs): result['result_triggered'] = True WalkoffEvent.CommonWorkflowSignal.connect(callback_is_sent) - action.execute(instance.instance, accumulator) + action.execute(accumulator, instance.instance) self.assertTrue(result['started_triggered']) self.assertTrue(result['result_triggered']) @@ -271,7 +271,7 @@ def test_execute_with_complex_args(self): 'd': [{'a': '', 'b': 3}, {'a': '', 'b': -1.5}, {'a': '', 'b': -0.5}]})]) instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - result = action.execute(instance.instance, {}) + result = action.execute({}, instance.instance) self.assertAlmostEqual(result.result, 11.0) self.assertEqual(result.status, 'Success') self.assertEqual(action._output, result) @@ -279,7 +279,7 @@ def test_execute_with_complex_args(self): def test_execute_action_which_raises_exception(self): action = Action(app_name='HelloWorld', action_name='Buggy', name='helloWorld') instance = AppInstance.create(app_name='HelloWorld', device_name='device1') - action.execute(instance.instance, {}) + action.execute({}, instance.instance) self.assertIsNotNone(action.get_output()) def test_execute_action_which_raises_exception_sends_callbacks(self): @@ -299,7 +299,7 @@ def callback_is_sent(sender, **kwargs): WalkoffEvent.CommonWorkflowSignal.connect(callback_is_sent) - action.execute(instance.instance, {}) + action.execute({}, instance.instance) self.assertTrue(result['started_triggered']) self.assertTrue(result['result_triggered']) @@ -308,7 +308,7 @@ def test_execute_global_action(self): action = Action(app_name='HelloWorld', action_name='global2', name='helloWorld', arguments=[Argument('arg1', value='something')]) instance = AppInstance.create(app_name='HelloWorld', device_name='') - result = action.execute(instance.instance, {}) + result = action.execute({}, instance.instance) self.assertAlmostEqual(result.result, 'something') self.assertEqual(result.status, 'Success') self.assertEqual(action._output, result) diff --git a/walkoff/appgateway/appinstancerepo.py b/walkoff/appgateway/appinstancerepo.py index 929af8a69..01f8d325f 100644 --- a/walkoff/appgateway/appinstancerepo.py +++ b/walkoff/appgateway/appinstancerepo.py @@ -31,12 +31,14 @@ def setup_app_instance(self, action, workflow): Returns: (tuple(app_name, device_id)): A tuple containing the app name for the Action, and the device_id int """ - device_id = (action.app_name, action.device_id.get_value(workflow.get_accumulator())) - if device_id not in self._instances: - self._instances[device_id] = AppInstance.create(action.app_name, action.device_id) - WalkoffEvent.CommonWorkflowSignal.send(workflow, event=WalkoffEvent.AppInstanceCreated) - logger.debug('Created new app instance: App {0}, device {1}'.format(action.app_name, action.device_id)) - return device_id + if action.device_id: + device_id = (action.app_name, action.device_id.get_value(workflow.get_accumulator())) + if device_id not in self._instances: + self._instances[device_id] = AppInstance.create(action.app_name, action.device_id) + WalkoffEvent.CommonWorkflowSignal.send(workflow, event=WalkoffEvent.AppInstanceCreated) + logger.debug('Created new app instance: App {0}, device {1}'.format(action.app_name, action.device_id)) + return device_id + return None def get_app_instance(self, device_id): """Gets the AppInstance given a device ID diff --git a/walkoff/executiondb/action.py b/walkoff/executiondb/action.py index 814212204..f264554b0 100644 --- a/walkoff/executiondb/action.py +++ b/walkoff/executiondb/action.py @@ -71,6 +71,7 @@ def __init__(self, app_name, action_name, name, device_id=None, id=None, argumen self._output = None self._execution_id = 'default' self._action_executable = None + self._resolved_device_id = -1 self.validate() @orm.reconstructor @@ -81,6 +82,7 @@ def init_on_load(self): self._action_executable = get_app_action(self.app_name, self._run) self._output = None self._execution_id = 'default' + self._resolved_device_id = -1 def validate(self): """Validates the object""" @@ -116,12 +118,13 @@ def get_execution_id(self): """ return self._execution_id - def execute(self, instance, accumulator, arguments=None, resume=False): + def execute(self, accumulator, instance=None, arguments=None, resume=False): """Executes an Action by calling the associated app function. Args: - instance (App): The instance of an App object to be used to execute the associated function. accumulator (dict): Dict containing the results of the previous actions + instance (App, optional): The instance of an App object to be used to execute the associated function. + This field is required if the Action is a bounded action. Otherwise, it defaults to None. arguments (list[Argument], optional): List of Arguments to be used if the Action is the starting step of the Workflow. Defaults to None. resume (bool, optional): Optional boolean to resume a previously paused workflow. Defaults to False. @@ -131,6 +134,9 @@ def execute(self, instance, accumulator, arguments=None, resume=False): """ self._execution_id = str(uuid.uuid4()) + if self.device_id: + self._resolved_device_id = self.device_id.get_value(accumulator) + WalkoffEvent.CommonWorkflowSignal.send(self, event=WalkoffEvent.ActionStarted) if self.trigger and not resume: WalkoffEvent.CommonWorkflowSignal.send(self, event=WalkoffEvent.TriggerActionAwaitingData) @@ -192,6 +198,9 @@ def execute_trigger(self, data_in, accumulator): logger.debug('Trigger is not valid for input {0}'.format(data_in)) return False + def get_resolved_device_id(self): + return self._resolved_device_id + @event.listens_for(Action, 'before_update') def validate_before_update(mapper, connection, target): diff --git a/walkoff/executiondb/workflow.py b/walkoff/executiondb/workflow.py index ddd2904f0..6b65cf857 100644 --- a/walkoff/executiondb/workflow.py +++ b/walkoff/executiondb/workflow.py @@ -138,7 +138,6 @@ def execute(self, execution_id, start=None, start_arguments=None, resume=False): def __execute(self, start, start_arguments=None, resume=False): actions = self.__actions(start=start) - first = True for action in (action_ for action_ in actions if action_ is not None): self._executing_action = action logger.debug('Executing action {0} of workflow {1}'.format(action, self.name)) @@ -154,13 +153,15 @@ def __execute(self, start, start_arguments=None, resume=False): device_id = self._instance_repo.setup_app_instance(action, self) - if first: - first = False - result = action.execute(instance=self._instance_repo.get_app_instance(device_id)(), - accumulator=self._accumulator, arguments=start_arguments, resume=resume) + if device_id: + result = action.execute(self._accumulator, instance=self._instance_repo.get_app_instance(device_id)(), + arguments=start_arguments, resume=resume) else: - result = action.execute(instance=self._instance_repo.get_app_instance(device_id)(), - accumulator=self._accumulator, resume=resume) + result = action.execute(self._accumulator, arguments=start_arguments, resume=resume) + + if start_arguments: + start_arguments = None + if result and result.status == "trigger": yield self._accumulator[action.id] = action.get_output().result diff --git a/walkoff/multiprocessedexecutor/proto_helpers.py b/walkoff/multiprocessedexecutor/proto_helpers.py index 98b2ac3f1..20cfe404e 100644 --- a/walkoff/multiprocessedexecutor/proto_helpers.py +++ b/walkoff/multiprocessedexecutor/proto_helpers.py @@ -127,8 +127,7 @@ def add_sender_to_action_packet_proto(action_packet, sender): action_packet.sender.execution_id = sender.get_execution_id() action_packet.sender.app_name = sender.app_name action_packet.sender.action_name = sender.action_name - if sender.device_id is not None: - set_argument_proto(action_packet.sender.device_id, sender.device_id) + action_packet.sender.device_id = sender.get_resolved_device_id() def add_arguments_to_action_proto(action_packet, sender): diff --git a/walkoff/multiprocessedexecutor/worker.py b/walkoff/multiprocessedexecutor/worker.py index 0cae5ab08..e60ce182c 100644 --- a/walkoff/multiprocessedexecutor/worker.py +++ b/walkoff/multiprocessedexecutor/worker.py @@ -36,7 +36,7 @@ class WorkflowResultsHandler(object): def __init__(self, socket_id, client_secret_key, client_public_key, server_public_key, zmq_results_address, execution_db, case_logger): - """Initialize a WorkflowResultsHandler object, which will be executing workflows. + """Initialize a WorkflowResultsHandler object, which will be sending results of workflow execution Args: socket_id (str): The ID for the results socket diff --git a/walkoff/proto/build/data_pb2.py b/walkoff/proto/build/data_pb2.py index 1647d6578..63834d983 100644 --- a/walkoff/proto/build/data_pb2.py +++ b/walkoff/proto/build/data_pb2.py @@ -18,7 +18,7 @@ DESCRIPTOR = _descriptor.FileDescriptor( name='data.proto', package='core', - serialized_pb=_b('\n\ndata.proto\x12\x04\x63ore\"\xc4\x03\n\x07Message\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.core.Message.Type\x12\x12\n\nevent_name\x18\x02 \x01(\t\x12/\n\x0fworkflow_packet\x18\x03 \x01(\x0b\x32\x14.core.WorkflowPacketH\x00\x12+\n\raction_packet\x18\x04 \x01(\x0b\x32\x12.core.ActionPacketH\x00\x12-\n\x0egeneral_packet\x18\x05 \x01(\x0b\x32\x13.core.GeneralPacketH\x00\x12+\n\x0emessage_packet\x18\x06 \x01(\x0b\x32\x11.core.UserMessageH\x00\x12.\n\x0elogging_packet\x18\x07 \x01(\x0b\x32\x14.core.LoggingMessageH\x00\"\x8e\x01\n\x04Type\x12\x12\n\x0eWORKFLOWPACKET\x10\x01\x12\x16\n\x12WORKFLOWPACKETDATA\x10\x02\x12\x10\n\x0c\x41\x43TIONPACKET\x10\x03\x12\x14\n\x10\x41\x43TIONPACKETDATA\x10\x04\x12\x11\n\rGENERALPACKET\x10\x05\x12\x0f\n\x0bUSERMESSAGE\x10\x06\x12\x0e\n\nLOGMESSAGE\x10\x07\x42\x08\n\x06packet\"@\n\x0eWorkflowSender\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x14\n\x0c\x65xecution_id\x18\x03 \x01(\t\"O\n\x0eWorkflowPacket\x12$\n\x06sender\x18\x01 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x17\n\x0f\x61\x64\x64itional_data\x18\x02 \x01(\t\"M\n\x08\x41rgument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x11\n\treference\x18\x03 \x01(\t\x12\x11\n\tselection\x18\x04 \x01(\t\"\xae\x02\n\x0c\x41\x63tionPacket\x12/\n\x06sender\x18\x01 \x01(\x0b\x32\x1f.core.ActionPacket.ActionSender\x12&\n\x08workflow\x18\x02 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x17\n\x0f\x61\x64\x64itional_data\x18\x03 \x01(\t\x1a\xab\x01\n\x0c\x41\x63tionSender\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x14\n\x0c\x65xecution_id\x18\x03 \x01(\t\x12\x10\n\x08\x61pp_name\x18\x04 \x01(\t\x12\x13\n\x0b\x61\x63tion_name\x18\x05 \x01(\t\x12!\n\targuments\x18\x06 \x03(\x0b\x32\x0e.core.Argument\x12!\n\tdevice_id\x18\t \x01(\x0b\x32\x0e.core.Argument\"\x99\x01\n\rGeneralPacket\x12\x31\n\x06sender\x18\x01 \x01(\x0b\x32!.core.GeneralPacket.GeneralSender\x12&\n\x08workflow\x18\x02 \x01(\x0b\x32\x14.core.WorkflowSender\x1a-\n\rGeneralSender\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08\x61pp_name\x18\x02 \x01(\t\"\xe5\x01\n\x13\x43ommunicationPacket\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.core.CommunicationPacket.Type\x12\x39\n\x18workflow_control_message\x18\x02 \x01(\x0b\x32\x15.core.WorkflowControlH\x00\x12\x31\n\x14\x63\x61se_control_message\x18\x03 \x01(\x0b\x32\x11.core.CaseControlH\x00\"(\n\x04Type\x12\x0c\n\x08WORKFLOW\x10\x01\x12\x08\n\x04\x43\x41SE\x10\x02\x12\x08\n\x04\x45XIT\x10\x03\x42\x08\n\x06packet\"x\n\x0fWorkflowControl\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.core.WorkflowControl.Type\x12\x1d\n\x15workflow_execution_id\x18\x02 \x01(\t\"\x1c\n\x04Type\x12\t\n\x05PAUSE\x10\x01\x12\t\n\x05\x41\x42ORT\x10\x02\".\n\x10\x43\x61seSubscription\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06\x65vents\x18\x02 \x03(\t\"\x9a\x01\n\x0b\x43\x61seControl\x12$\n\x04type\x18\x01 \x01(\x0e\x32\x16.core.CaseControl.Type\x12\n\n\x02id\x18\x02 \x01(\x03\x12-\n\rsubscriptions\x18\x03 \x03(\x0b\x32\x16.core.CaseSubscription\"*\n\x04Type\x12\n\n\x06\x43REATE\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\"\xbc\x01\n\x0bUserMessage\x12/\n\x06sender\x18\x01 \x01(\x0b\x32\x1f.core.ActionPacket.ActionSender\x12&\n\x08workflow\x18\x02 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x0f\n\x07subject\x18\x03 \x01(\t\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x17\n\x0frequires_reauth\x18\x05 \x01(\x08\x12\r\n\x05users\x18\x06 \x03(\x05\x12\r\n\x05roles\x18\x07 \x03(\x05\"\x8e\x01\n\x16\x45xecuteWorkflowMessage\x12\x13\n\x0bworkflow_id\x18\x01 \x01(\t\x12\x1d\n\x15workflow_execution_id\x18\x02 \x01(\t\x12\r\n\x05start\x18\x03 \x01(\t\x12!\n\targuments\x18\x04 \x03(\x0b\x32\x0e.core.Argument\x12\x0e\n\x06resume\x18\x05 \x01(\x08\"\x8d\x01\n\x0eLoggingMessage\x12&\n\x08workflow\x18\x01 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08\x61pp_name\x18\x03 \x01(\t\x12\x13\n\x0b\x61\x63tion_name\x18\x04 \x01(\t\x12\r\n\x05level\x18\x05 \x01(\t\x12\x0f\n\x07message\x18\x06 \x01(\t') + serialized_pb=_b('\n\ndata.proto\x12\x04\x63ore\"\xc4\x03\n\x07Message\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.core.Message.Type\x12\x12\n\nevent_name\x18\x02 \x01(\t\x12/\n\x0fworkflow_packet\x18\x03 \x01(\x0b\x32\x14.core.WorkflowPacketH\x00\x12+\n\raction_packet\x18\x04 \x01(\x0b\x32\x12.core.ActionPacketH\x00\x12-\n\x0egeneral_packet\x18\x05 \x01(\x0b\x32\x13.core.GeneralPacketH\x00\x12+\n\x0emessage_packet\x18\x06 \x01(\x0b\x32\x11.core.UserMessageH\x00\x12.\n\x0elogging_packet\x18\x07 \x01(\x0b\x32\x14.core.LoggingMessageH\x00\"\x8e\x01\n\x04Type\x12\x12\n\x0eWORKFLOWPACKET\x10\x01\x12\x16\n\x12WORKFLOWPACKETDATA\x10\x02\x12\x10\n\x0c\x41\x43TIONPACKET\x10\x03\x12\x14\n\x10\x41\x43TIONPACKETDATA\x10\x04\x12\x11\n\rGENERALPACKET\x10\x05\x12\x0f\n\x0bUSERMESSAGE\x10\x06\x12\x0e\n\nLOGMESSAGE\x10\x07\x42\x08\n\x06packet\"@\n\x0eWorkflowSender\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x14\n\x0c\x65xecution_id\x18\x03 \x01(\t\"O\n\x0eWorkflowPacket\x12$\n\x06sender\x18\x01 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x17\n\x0f\x61\x64\x64itional_data\x18\x02 \x01(\t\"M\n\x08\x41rgument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x11\n\treference\x18\x03 \x01(\t\x12\x11\n\tselection\x18\x04 \x01(\t\"\x9e\x02\n\x0c\x41\x63tionPacket\x12/\n\x06sender\x18\x01 \x01(\x0b\x32\x1f.core.ActionPacket.ActionSender\x12&\n\x08workflow\x18\x02 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x17\n\x0f\x61\x64\x64itional_data\x18\x03 \x01(\t\x1a\x9b\x01\n\x0c\x41\x63tionSender\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x14\n\x0c\x65xecution_id\x18\x03 \x01(\t\x12\x10\n\x08\x61pp_name\x18\x04 \x01(\t\x12\x13\n\x0b\x61\x63tion_name\x18\x05 \x01(\t\x12!\n\targuments\x18\x06 \x03(\x0b\x32\x0e.core.Argument\x12\x11\n\tdevice_id\x18\t \x01(\x05\"\x99\x01\n\rGeneralPacket\x12\x31\n\x06sender\x18\x01 \x01(\x0b\x32!.core.GeneralPacket.GeneralSender\x12&\n\x08workflow\x18\x02 \x01(\x0b\x32\x14.core.WorkflowSender\x1a-\n\rGeneralSender\x12\n\n\x02id\x18\x01 \x01(\t\x12\x10\n\x08\x61pp_name\x18\x02 \x01(\t\"\xe5\x01\n\x13\x43ommunicationPacket\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.core.CommunicationPacket.Type\x12\x39\n\x18workflow_control_message\x18\x02 \x01(\x0b\x32\x15.core.WorkflowControlH\x00\x12\x31\n\x14\x63\x61se_control_message\x18\x03 \x01(\x0b\x32\x11.core.CaseControlH\x00\"(\n\x04Type\x12\x0c\n\x08WORKFLOW\x10\x01\x12\x08\n\x04\x43\x41SE\x10\x02\x12\x08\n\x04\x45XIT\x10\x03\x42\x08\n\x06packet\"x\n\x0fWorkflowControl\x12(\n\x04type\x18\x01 \x01(\x0e\x32\x1a.core.WorkflowControl.Type\x12\x1d\n\x15workflow_execution_id\x18\x02 \x01(\t\"\x1c\n\x04Type\x12\t\n\x05PAUSE\x10\x01\x12\t\n\x05\x41\x42ORT\x10\x02\".\n\x10\x43\x61seSubscription\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0e\n\x06\x65vents\x18\x02 \x03(\t\"\x9a\x01\n\x0b\x43\x61seControl\x12$\n\x04type\x18\x01 \x01(\x0e\x32\x16.core.CaseControl.Type\x12\n\n\x02id\x18\x02 \x01(\x03\x12-\n\rsubscriptions\x18\x03 \x03(\x0b\x32\x16.core.CaseSubscription\"*\n\x04Type\x12\n\n\x06\x43REATE\x10\x01\x12\n\n\x06UPDATE\x10\x02\x12\n\n\x06\x44\x45LETE\x10\x03\"\xbc\x01\n\x0bUserMessage\x12/\n\x06sender\x18\x01 \x01(\x0b\x32\x1f.core.ActionPacket.ActionSender\x12&\n\x08workflow\x18\x02 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x0f\n\x07subject\x18\x03 \x01(\t\x12\x0c\n\x04\x62ody\x18\x04 \x01(\t\x12\x17\n\x0frequires_reauth\x18\x05 \x01(\x08\x12\r\n\x05users\x18\x06 \x03(\x05\x12\r\n\x05roles\x18\x07 \x03(\x05\"\x8e\x01\n\x16\x45xecuteWorkflowMessage\x12\x13\n\x0bworkflow_id\x18\x01 \x01(\t\x12\x1d\n\x15workflow_execution_id\x18\x02 \x01(\t\x12\r\n\x05start\x18\x03 \x01(\t\x12!\n\targuments\x18\x04 \x03(\x0b\x32\x0e.core.Argument\x12\x0e\n\x06resume\x18\x05 \x01(\x08\"\x8d\x01\n\x0eLoggingMessage\x12&\n\x08workflow\x18\x01 \x01(\x0b\x32\x14.core.WorkflowSender\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x10\n\x08\x61pp_name\x18\x03 \x01(\t\x12\x13\n\x0b\x61\x63tion_name\x18\x04 \x01(\t\x12\r\n\x05level\x18\x05 \x01(\t\x12\x0f\n\x07message\x18\x06 \x01(\t') ) _sym_db.RegisterFileDescriptor(DESCRIPTOR) @@ -87,8 +87,8 @@ ], containing_type=None, options=None, - serialized_start=1342, - serialized_end=1382, + serialized_start=1326, + serialized_end=1366, ) _sym_db.RegisterEnumDescriptor(_COMMUNICATIONPACKET_TYPE) @@ -109,8 +109,8 @@ ], containing_type=None, options=None, - serialized_start=1486, - serialized_end=1514, + serialized_start=1470, + serialized_end=1498, ) _sym_db.RegisterEnumDescriptor(_WORKFLOWCONTROL_TYPE) @@ -135,8 +135,8 @@ ], containing_type=None, options=None, - serialized_start=1677, - serialized_end=1719, + serialized_start=1661, + serialized_end=1703, ) _sym_db.RegisterEnumDescriptor(_CASECONTROL_TYPE) @@ -400,8 +400,8 @@ options=None), _descriptor.FieldDescriptor( name='device_id', full_name='core.ActionPacket.ActionSender.device_id', index=6, - number=9, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, + number=9, type=5, cpp_type=1, label=1, + has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), @@ -417,7 +417,7 @@ oneofs=[ ], serialized_start=833, - serialized_end=1004, + serialized_end=988, ) _ACTIONPACKET = _descriptor.Descriptor( @@ -460,7 +460,7 @@ oneofs=[ ], serialized_start=702, - serialized_end=1004, + serialized_end=988, ) @@ -496,8 +496,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1115, - serialized_end=1160, + serialized_start=1099, + serialized_end=1144, ) _GENERALPACKET = _descriptor.Descriptor( @@ -532,8 +532,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1007, - serialized_end=1160, + serialized_start=991, + serialized_end=1144, ) @@ -580,8 +580,8 @@ name='packet', full_name='core.CommunicationPacket.packet', index=0, containing_type=None, fields=[]), ], - serialized_start=1163, - serialized_end=1392, + serialized_start=1147, + serialized_end=1376, ) @@ -618,8 +618,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1394, - serialized_end=1514, + serialized_start=1378, + serialized_end=1498, ) @@ -655,8 +655,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1516, - serialized_end=1562, + serialized_start=1500, + serialized_end=1546, ) @@ -700,8 +700,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1565, - serialized_end=1719, + serialized_start=1549, + serialized_end=1703, ) @@ -772,8 +772,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1722, - serialized_end=1910, + serialized_start=1706, + serialized_end=1894, ) @@ -830,8 +830,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1913, - serialized_end=2055, + serialized_start=1897, + serialized_end=2039, ) @@ -895,8 +895,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2058, - serialized_end=2199, + serialized_start=2042, + serialized_end=2183, ) _MESSAGE.fields_by_name['type'].enum_type = _MESSAGE_TYPE @@ -923,7 +923,6 @@ _MESSAGE.fields_by_name['logging_packet'].containing_oneof = _MESSAGE.oneofs_by_name['packet'] _WORKFLOWPACKET.fields_by_name['sender'].message_type = _WORKFLOWSENDER _ACTIONPACKET_ACTIONSENDER.fields_by_name['arguments'].message_type = _ARGUMENT -_ACTIONPACKET_ACTIONSENDER.fields_by_name['device_id'].message_type = _ARGUMENT _ACTIONPACKET_ACTIONSENDER.containing_type = _ACTIONPACKET _ACTIONPACKET.fields_by_name['sender'].message_type = _ACTIONPACKET_ACTIONSENDER _ACTIONPACKET.fields_by_name['workflow'].message_type = _WORKFLOWSENDER diff --git a/walkoff/proto/data.proto b/walkoff/proto/data.proto index 17e2a10a8..816817d08 100644 --- a/walkoff/proto/data.proto +++ b/walkoff/proto/data.proto @@ -55,7 +55,7 @@ message ActionPacket { optional string app_name = 4; optional string action_name = 5; repeated Argument arguments = 6; - optional Argument device_id = 9; + optional int32 device_id = 9; } optional ActionSender sender = 1; From b89e62c63e4426ef3a4e8e1b24b4df9191a11e08 Mon Sep 17 00:00:00 2001 From: corey Date: Tue, 17 Apr 2018 11:21:34 -0400 Subject: [PATCH 2/3] Added small note to walkoff.py to wait when shutting down server --- walkoff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/walkoff.py b/walkoff.py index 1587f9fdb..24fc73dd7 100644 --- a/walkoff.py +++ b/walkoff.py @@ -87,7 +87,7 @@ def convert_host_port(args): try: run(app, *convert_host_port(args)) except KeyboardInterrupt: - logger.info('Caught KeyboardInterrupt!') + logger.info('Caught KeyboardInterrupt! Please wait a few seconds for WALKOFF to shutdown.') except Exception as e: exc_type, exc_value, exc_traceback = sys.exc_info() traceback.print_exc() From 227c44c1892a3a66b97b54a3653a3d5cabaefff5 Mon Sep 17 00:00:00 2001 From: corey Date: Tue, 17 Apr 2018 13:52:46 -0400 Subject: [PATCH 3/3] Bumping version number --- CHANGELOG.md | 6 ++++++ appveyor.yml | 2 +- walkoff/__init__.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7916347e..1177dee39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ +## [0.8.1] +###### 2018-04-17 + +### Fixed +* Bug where Workflows with unbounded Actions were unable to be executed + ## [0.8.0] ###### unreleased diff --git a/appveyor.yml b/appveyor.yml index 1c55c2550..2459e48cf 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.8.0.{build} +version: 0.8.1.{build} branches: only: diff --git a/walkoff/__init__.py b/walkoff/__init__.py index 32a90a3b9..ef72cc0f1 100644 --- a/walkoff/__init__.py +++ b/walkoff/__init__.py @@ -1 +1 @@ -__version__ = '0.8.0' +__version__ = '0.8.1'