From 77609bed4fa07cace398aec0e1ebd3e1f0b5fc79 Mon Sep 17 00:00:00 2001 From: Kevin Biju Date: Sat, 6 Jan 2024 17:13:01 +0530 Subject: [PATCH 1/2] make KeysToString sort array since maps.Keys is non-deterministic --- flow/connectors/utils/map.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flow/connectors/utils/map.go b/flow/connectors/utils/map.go index 96cbea450c..62b0d9ae26 100644 --- a/flow/connectors/utils/map.go +++ b/flow/connectors/utils/map.go @@ -1,6 +1,8 @@ package utils import ( + "slices" + "sort" "strings" "golang.org/x/exp/maps" @@ -11,5 +13,8 @@ func KeysToString(m map[string]struct{}) string { return "" } - return strings.Join(maps.Keys(m), ",") + sm := maps.Keys(m) + sort.Strings(sm) + slices.Sort[[]string](sm) + return strings.Join(sm, ",") } From 083b4f578f496b2e64d31233d0f25e9a92d2108b Mon Sep 17 00:00:00 2001 From: Kevin Biju Date: Sat, 6 Jan 2024 17:16:47 +0530 Subject: [PATCH 2/2] remove extra call --- flow/connectors/utils/map.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/flow/connectors/utils/map.go b/flow/connectors/utils/map.go index 62b0d9ae26..09ecaa1ba1 100644 --- a/flow/connectors/utils/map.go +++ b/flow/connectors/utils/map.go @@ -2,7 +2,6 @@ package utils import ( "slices" - "sort" "strings" "golang.org/x/exp/maps" @@ -14,7 +13,6 @@ func KeysToString(m map[string]struct{}) string { } sm := maps.Keys(m) - sort.Strings(sm) slices.Sort[[]string](sm) return strings.Join(sm, ",") }