From: Matthias Kruk Date: Sun, 1 Aug 2021 05:44:31 +0000 (+0900) Subject: include/msg: Remove log-related functions from test and build modules X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=5217bea3b18bed96490a6a9a535dfdde2ed9e229;p=foundry include/msg: Remove log-related functions from test and build modules The "logs" property has been removed from the specification of the test and build messages, so the functions in the respective modules that access these properties must be removed as well. This commit removes the foundry_msg_build_get_logs() and foundry_msg_test_get_logs() functions and removes the logs parameter from the foundry_msg_test_new() and foundry_msg_build_new() functions. --- diff --git a/include/msg/build.sh b/include/msg/build.sh index 068e120..2d0f30e 100644 --- a/include/msg/build.sh +++ b/include/msg/build.sh @@ -16,11 +16,9 @@ foundry_msg_build_new() { local branch="$3" local commit="$4" local result="$5" - local -n __foundry_msg_build_new_logs="$6" - local -n __foundry_msg_build_new_artifacts="$7" + local -n __foundry_msg_build_new_artifacts="$6" local artifact_array - local log_array local json local msg @@ -28,16 +26,11 @@ foundry_msg_build_new() { return 1 fi - if ! log_array=$(json_array "${__foundry_msg_build_new_logs[@]}"); then - return 1 - fi - if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "branch" "$branch" \ "commit" "$commit" \ "result" "$result" \ - "logs" "$log_array" \ "artifacts" "$artifact_array"); then return 1 fi @@ -115,19 +108,6 @@ foundry_msg_build_get_result() { return 0 } -foundry_msg_build_get_logs() { - local msg="$1" - - local logs - - if ! logs=$(foundry_msg_get_data_field "$msg" "logs[]"); then - return 1 - fi - - echo "$logs" - return 0 -} - foundry_msg_build_get_artifacts() { local msg="$1" diff --git a/include/msg/test.sh b/include/msg/test.sh index b013266..271a1c6 100644 --- a/include/msg/test.sh +++ b/include/msg/test.sh @@ -16,22 +16,15 @@ foundry_msg_test_new() { local branch="$3" local commit="$4" local result="$5" - local logs=("${@:6}") - local logs_json local json local msg - if ! logs_json=$(json_array "${logs[@]}"); then - return 1 - fi - if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "branch" "$branch" \ "commit" "$commit" \ - "result" "$result" \ - "logs" "$logs_json"); then + "result" "$result"); then return 1 fi @@ -107,16 +100,3 @@ foundry_msg_test_get_result() { echo "$result" return 0 } - -foundry_msg_test_get_logs() { - local msg="$1" - - local logs - - if ! logs=$(foundry_msg_get_data_field "$msg" "logs[]"); then - return 1 - fi - - echo "$logs" - return 0 -}