From 4eea15ddc13f7ec50d4539d21e946e71b8dcba5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= Date: Mon, 3 Jun 2024 14:27:07 +0200 Subject: [PATCH 1/2] fix(automate): make sure we exit with code 0 if execution completes --- src/speckle_automate/runner.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/speckle_automate/runner.py b/src/speckle_automate/runner.py index d85b2160..7593687d 100644 --- a/src/speckle_automate/runner.py +++ b/src/speckle_automate/runner.py @@ -3,6 +3,7 @@ Provides mechanisms to execute any function, that conforms to the AutomateFunction "interface" """ + import json import sys import traceback @@ -65,7 +66,9 @@ def execute_automate_function( @overload -def execute_automate_function(automate_function: AutomateFunctionWithoutInputs) -> None: +def execute_automate_function( + automate_function: AutomateFunctionWithoutInputs, +) -> None: ... @@ -127,10 +130,8 @@ def execute_automate_function( automate_function, # type: ignore ) - exit_code = ( - 0 if automation_context.run_status == AutomationStatus.SUCCEEDED else 1 - ) - exit(exit_code) + # if we've gotten this far, the + exit(0) else: raise NotImplementedError(f"Command: '{command}' is not supported.") From 239bc4b5b9d85e6e97d6ba9edd2bc0c99987a961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= Date: Mon, 3 Jun 2024 14:29:29 +0200 Subject: [PATCH 2/2] docs(automate): finish comment block thoughts --- src/speckle_automate/runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/speckle_automate/runner.py b/src/speckle_automate/runner.py index 7593687d..417393c4 100644 --- a/src/speckle_automate/runner.py +++ b/src/speckle_automate/runner.py @@ -130,7 +130,8 @@ def execute_automate_function( automate_function, # type: ignore ) - # if we've gotten this far, the + # if we've gotten this far, the execution should technically be completed as expected + # thus exiting with 0 is the schemantically correct thing to do exit(0) else: