From d293f2893be22f69653355566b41d42dd44e8fb3 Mon Sep 17 00:00:00 2001 From: Per Goncalves da Silva Date: Tue, 2 Sep 2025 13:57:09 +0200 Subject: [PATCH] Add key ordering for mermaid graph output Signed-off-by: Per Goncalves da Silva --- alpha/declcfg/write.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alpha/declcfg/write.go b/alpha/declcfg/write.go index 52b2a67f3..7b1766b4b 100644 --- a/alpha/declcfg/write.go +++ b/alpha/declcfg/write.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "io" + "maps" "os" "path/filepath" "slices" @@ -270,7 +271,8 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer) } // express the decoration classes - for key := range decoratedBundleIDs { + sortedKeys := slices.Sorted(maps.Keys(decoratedBundleIDs)) + for _, key := range sortedKeys { if len(decoratedBundleIDs[key]) > 0 { b := slices.Clone(decoratedBundleIDs[key]) slices.Sort(b)