]> git.corax.cc Git - foundry/commitdiff
include/msg/*: Change name of "tid" field to "context"
authorMatthias Kruk <m@m10k.eu>
Sun, 18 Jul 2021 00:50:14 +0000 (09:50 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 18 Jul 2021 00:50:14 +0000 (09:50 +0900)
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.

include/msg/build.sh
include/msg/buildrequest.sh
include/msg/dist.sh
include/msg/distrequest.sh
include/msg/merge.sh
include/msg/mergerequest.sh
include/msg/sign.sh
include/msg/signrequest.sh
include/msg/test.sh
include/msg/testrequest.sh

index 1c8c601f8481647eb368ca989b510bd77054c4d1..068e1207fcf9088ac6d07bd96fbc19e68374df3f 100644 (file)
@@ -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
 }
 
index dc27d19c1988fb3545f78a16169265d345396228..c392f159a2d004f765926c5085c1ce3d593d5644 100644 (file)
@@ -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
 }
 
index b018b30e8c1a749b1a36be6b6c545b4f4b7e86cb..535291672a3abecc8368ec190e79d189eeedeb22 100644 (file)
@@ -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
 }
 
index 823c1d03a6721bcb19271368d9b822c78a5bdffe..9a5cbfacd6b601d70f865c608e538f0a14aa264a 100644 (file)
@@ -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
 }
 
index 412a5bc35ab08aca57b7b659e9294e22deb52cdc..39b0d8d237cdb48a8ca07f264021f464674fb6cd 100644 (file)
@@ -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
 }
 
index ad70eff09e00635928e1987b02fe30567a1f3e78..697f32c58f55e6b8aca0494bad09f2ace6416adb 100644 (file)
@@ -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
 }
 
index 7fb3e706f6c432d66239dd74e627c1a7a1a31429..c25001eff1e6ea4e5f94893b58d29c05007e76de 100644 (file)
@@ -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
 }
 
index bc162e0420d8e6aabf4f0df100ec2c958efd01c1..93c526067a5631d4454aa372d98b0feada28c5d7 100644 (file)
@@ -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
 }
 
index f5ceea945f503c642b408665610a9aa9146779da..b013266ea0cae26a52a4994fce6f17956d3a57f3 100644 (file)
@@ -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
 }
 
index d353a19f522cfc00c69b7bccd5c5f51477482f01..356eda9f54e50f08d76e4ed4bb9126a24b91e2ba 100644 (file)
@@ -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
 }