Skip to content

Commit 893f900

Browse files
authored
Updated the error code when exiting without any issues found. (#44)
Changed it from 1 to 0 as in the end this is not an error. Also when running several templates the first which will not find any issues, will stop the whole CI pipeline/container. Which is not desirable. Signed-off-by: Martin Curlej <[email protected]>
1 parent 77f23be commit 893f900

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

joft/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def execute_template(template_file_path: str, jira_session: jira.JIRA) -> int:
6565
f"'{jira_template.jira_search.jql}'!"
6666
)
6767
)
68-
return 1
68+
return 0
6969

7070
# when the jira query is successfull the actions of template will be then executed
7171
# for each ticket in the query

tests/test_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def test_execute_template_exit_no_tickets(
326326

327327
ret_code = joft.base.execute_template(yaml_file_path, mock_jira_session)
328328

329-
assert ret_code == 1
329+
assert ret_code == 0
330330

331331
assert mock_execute_actions_per_trigger_ticket.call_count == 0
332332
assert mock_execute_actions.call_count == 0

0 commit comments

Comments
 (0)