From: Matthias Kruk Date: Sun, 18 Jul 2021 00:50:14 +0000 (+0900) Subject: include/msg/*: Change name of "tid" field to "context" X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=685d47d97d86ee857bd95f809beafdf983c27a63;p=foundry include/msg/*: Change name of "tid" field to "context" The "tid" field was renamed to "context" in the specifications of all message types, but the implementations still refer to the old name. This commit changes the implementations of all message types to use the correct field name. --- diff --git a/include/msg/build.sh b/include/msg/build.sh index 1c8c601..068e120 100644 --- a/include/msg/build.sh +++ b/include/msg/build.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_build_new() { - local tid="$1" + local context="$1" local repository="$2" local branch="$3" local commit="$4" @@ -32,7 +32,7 @@ foundry_msg_build_new() { return 1 fi - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "branch" "$branch" \ "commit" "$commit" \ @@ -50,16 +50,16 @@ foundry_msg_build_new() { return 0 } -foundry_msg_build_get_tid() { +foundry_msg_build_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/buildrequest.sh b/include/msg/buildrequest.sh index dc27d19..c392f15 100644 --- a/include/msg/buildrequest.sh +++ b/include/msg/buildrequest.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_buildrequest_new() { - local tid="$1" + local context="$1" local repository="$2" local branch="$3" local commit="$4" @@ -19,7 +19,7 @@ foundry_msg_buildrequest_new() { local json local msg - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "branch" "$branch" \ "commit" "$commit"); then @@ -34,16 +34,16 @@ foundry_msg_buildrequest_new() { return 0 } -foundry_msg_buildrequest_get_tid() { +foundry_msg_buildrequest_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/dist.sh b/include/msg/dist.sh index b018b30..5352916 100644 --- a/include/msg/dist.sh +++ b/include/msg/dist.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_dist_new() { - local tid="$1" + local context="$1" local repository="$2" local artifacts=("${@:3}") @@ -23,7 +23,7 @@ foundry_msg_dist_new() { return 1 fi - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "artifacts" "$artifacts_json"); then return 1 @@ -37,16 +37,16 @@ foundry_msg_dist_new() { return 0 } -foundry_msg_dist_get_tid() { +foundry_msg_dist_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/distrequest.sh b/include/msg/distrequest.sh index 823c1d0..9a5cbfa 100644 --- a/include/msg/distrequest.sh +++ b/include/msg/distrequest.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_distrequest_new() { - local tid="$1" + local context="$1" local artifacts=("${@:2}") local artifacts_json @@ -22,7 +22,7 @@ foundry_msg_distrequest_new() { return 1 fi - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "artifacts" "$artifacts_json"); then return 1 fi @@ -35,16 +35,16 @@ foundry_msg_distrequest_new() { return 0 } -foundry_msg_distrequest_get_tid() { +foundry_msg_distrequest_get_context() { local distrequest="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$distrequest" "tid"); then + if ! context=$(foundry_msg_get_data_field "$distrequest" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/merge.sh b/include/msg/merge.sh index 412a5bc..39b0d8d 100644 --- a/include/msg/merge.sh +++ b/include/msg/merge.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_merge_new() { - local tid="$1" + local context="$1" local repository="$2" local srcbranch="$3" local dstbranch="$4" @@ -21,7 +21,7 @@ foundry_msg_merge_new() { local json local msg - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "srcbranch" "$srcbranch" \ "dstbranch" "$dstbranch" \ @@ -38,16 +38,16 @@ foundry_msg_merge_new() { return 0 } -foundry_msg_merge_get_tid() { +foundry_msg_merge_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/mergerequest.sh b/include/msg/mergerequest.sh index ad70eff..697f32c 100644 --- a/include/msg/mergerequest.sh +++ b/include/msg/mergerequest.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_mergerequest_new() { - local tid="$1" + local context="$1" local repository="$2" local srcbranch="$3" local dstbranch="$4" @@ -19,9 +19,9 @@ foundry_msg_mergerequest_new() { local json local msg - if ! json=$(json_object "tid" "$tid" \ - "repository" "$repository" \ - "source_branch" "$srcbranch" \ + if ! json=$(json_object "context" "$context" \ + "repository" "$repository" \ + "source_branch" "$srcbranch" \ "destination_branch" "$dstbranch"); then return 1 fi @@ -35,16 +35,16 @@ foundry_msg_mergerequest_new() { return 0 } -foundry_msg_mergerequest_get_tid() { +foundry_msg_mergerequest_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/sign.sh b/include/msg/sign.sh index 7fb3e70..c25001e 100644 --- a/include/msg/sign.sh +++ b/include/msg/sign.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_sign_new() { - local tid="$1" + local context="$1" local key="$2" local artifacts=("${@:3}") @@ -23,7 +23,7 @@ foundry_msg_sign_new() { return 1 fi - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "key" "$key" \ "artifacts" "$artifacts_json"); then return 1 @@ -37,16 +37,16 @@ foundry_msg_sign_new() { return 0 } -foundry_msg_sign_get_tid() { +foundry_msg_sign_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/signrequest.sh b/include/msg/signrequest.sh index bc162e0..93c5260 100644 --- a/include/msg/signrequest.sh +++ b/include/msg/signrequest.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_signrequest_new() { - local tid="$1" + local context="$1" local artifacts=("${@:2}") local artifacts_json @@ -22,7 +22,7 @@ foundry_msg_signrequest_new() { return 1 fi - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "artifacts" "$artifacts_json"); then return 1 fi @@ -35,16 +35,16 @@ foundry_msg_signrequest_new() { return 0 } -foundry_msg_signrequest_get_tid() { +foundry_msg_signrequest_get_context() { local signrequest="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$signrequest" "tid"); then + if ! context=$(foundry_msg_get_data_field "$signrequest" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/test.sh b/include/msg/test.sh index f5ceea9..b013266 100644 --- a/include/msg/test.sh +++ b/include/msg/test.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_test_new() { - local tid="$1" + local context="$1" local repository="$2" local branch="$3" local commit="$4" @@ -26,7 +26,7 @@ foundry_msg_test_new() { return 1 fi - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ "branch" "$branch" \ "commit" "$commit" \ @@ -43,16 +43,16 @@ foundry_msg_test_new() { return 0 } -foundry_msg_test_get_tid() { +foundry_msg_test_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 } diff --git a/include/msg/testrequest.sh b/include/msg/testrequest.sh index d353a19..356eda9 100644 --- a/include/msg/testrequest.sh +++ b/include/msg/testrequest.sh @@ -11,7 +11,7 @@ __init() { } foundry_msg_testrequest_new() { - local tid="$1" + local context="$1" local repository="$2" local branch="$3" local commit="$4" @@ -19,10 +19,10 @@ foundry_msg_testrequest_new() { local json local msg - if ! json=$(json_object "tid" "$tid" \ + if ! json=$(json_object "context" "$context" \ "repository" "$repository" \ - "branch" "$branch" \ - "commit" "$commit"); then + "branch" "$branch" \ + "commit" "$commit"); then return 1 fi @@ -34,16 +34,16 @@ foundry_msg_testrequest_new() { return 0 } -foundry_msg_testrequest_get_tid() { +foundry_msg_testrequest_get_context() { local msg="$1" - local tid + local context - if ! tid=$(foundry_msg_get_data_field "$msg" "tid"); then + if ! context=$(foundry_msg_get_data_field "$msg" "context"); then return 1 fi - echo "$tid" + echo "$context" return 0 }