From 36bba569692b141dc21392902acf0d2e39044707 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sun, 1 Aug 2021 16:35:26 +0900 Subject: [PATCH] include/msg: Remove "commit" property from message modules The "commit" property has been removed from all but the message specification of "commit" messages, so it must be removed from modules that are used for constructing messages and accessing the properties of messages. This commit removes handling of the "commit" property from all messages that this property has been removed from. --- include/msg/build.sh | 19 ++----------------- include/msg/buildrequest.sh | 17 +---------------- include/msg/test.sh | 17 +---------------- include/msg/testrequest.sh | 17 +---------------- 4 files changed, 5 insertions(+), 65 deletions(-) diff --git a/include/msg/build.sh b/include/msg/build.sh index 2d0f30e..1ca0e2d 100644 --- a/include/msg/build.sh +++ b/include/msg/build.sh @@ -14,9 +14,8 @@ foundry_msg_build_new() { local context="$1" local repository="$2" local branch="$3" - local commit="$4" - local result="$5" - local -n __foundry_msg_build_new_artifacts="$6" + local result="$4" + local -n __foundry_msg_build_new_artifacts="$5" local artifact_array local json @@ -29,7 +28,6 @@ foundry_msg_build_new() { if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "branch" "$branch" \ - "commit" "$commit" \ "result" "$result" \ "artifacts" "$artifact_array"); then return 1 @@ -82,19 +80,6 @@ foundry_msg_build_get_branch() { return 0 } -foundry_msg_build_get_commit() { - local msg="$1" - - local commit - - if ! commit=$(foundry_msg_get_data_field "$msg" "commit"); then - return 1 - fi - - echo "$commit" - return 0 -} - foundry_msg_build_get_result() { local msg="$1" diff --git a/include/msg/buildrequest.sh b/include/msg/buildrequest.sh index c392f15..d3e8e44 100644 --- a/include/msg/buildrequest.sh +++ b/include/msg/buildrequest.sh @@ -14,15 +14,13 @@ foundry_msg_buildrequest_new() { local context="$1" local repository="$2" local branch="$3" - local commit="$4" local json local msg if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ - "branch" "$branch" \ - "commit" "$commit"); then + "branch" "$branch"); then return 1 fi @@ -72,16 +70,3 @@ foundry_msg_buildrequest_get_branch() { echo "$branch" return 0 } - -foundry_msg_buildrequest_get_commit() { - local msg="$1" - - local commit - - if ! commit=$(foundry_msg_get_data_field "$msg" "commit"); then - return 1 - fi - - echo "$commit" - return 0 -} diff --git a/include/msg/test.sh b/include/msg/test.sh index 271a1c6..c382511 100644 --- a/include/msg/test.sh +++ b/include/msg/test.sh @@ -14,8 +14,7 @@ foundry_msg_test_new() { local context="$1" local repository="$2" local branch="$3" - local commit="$4" - local result="$5" + local result="$4" local json local msg @@ -23,7 +22,6 @@ foundry_msg_test_new() { if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "branch" "$branch" \ - "commit" "$commit" \ "result" "$result"); then return 1 fi @@ -75,19 +73,6 @@ foundry_msg_test_get_branch() { return 0 } -foundry_msg_test_get_commit() { - local msg="$1" - - local commit - - if ! commit=$(foundry_msg_get_data_field "$msg" "commit"); then - return 1 - fi - - echo "$commit" - return 0 -} - foundry_msg_test_get_result() { local msg="$1" diff --git a/include/msg/testrequest.sh b/include/msg/testrequest.sh index 356eda9..fb84c7c 100644 --- a/include/msg/testrequest.sh +++ b/include/msg/testrequest.sh @@ -14,15 +14,13 @@ foundry_msg_testrequest_new() { local context="$1" local repository="$2" local branch="$3" - local commit="$4" local json local msg if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ - "branch" "$branch" \ - "commit" "$commit"); then + "branch" "$branch"); then return 1 fi @@ -73,16 +71,3 @@ foundry_msg_testrequest_get_branch() { echo "$branch" return 0 } - -foundry_msg_testrequest_get_commit() { - local msg="$1" - - local commit - - if ! commit=$(foundry_msg_get_data_field "$msg" "commit"); then - return 1 - fi - - echo "$commit" - return 0 -} -- 2.47.3