From 6717f89de4563e5cf76aceb40ed8ef192d0c0914 Mon Sep 17 00:00:00 2001 From: Liz Kammer Date: Fri, 7 Apr 2023 09:11:30 -0400 Subject: [PATCH] Add variant name to module info Without this, we cannot correctly join action and module graph information as we cannot distinguish variants on action graph. Test: m json-module-graph Change-Id: If7379845fc865d8a150f3995df6bf601456a71c3 --- context.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/context.go b/context.go index 46c4e1a..54f2fd8 100644 --- a/context.go +++ b/context.go @@ -2679,6 +2679,7 @@ type jsonVariations []Variation type jsonModuleName struct { Name string + Variant string Variations jsonVariations DependencyVariations jsonVariations } @@ -2714,6 +2715,7 @@ func toJsonVariationMap(vm variationMap) jsonVariations { func jsonModuleNameFromModuleInfo(m *moduleInfo) *jsonModuleName { return &jsonModuleName{ Name: m.Name(), + Variant: m.variant.name, Variations: toJsonVariationMap(m.variant.variations), DependencyVariations: toJsonVariationMap(m.variant.dependencyVariations), } @@ -2761,7 +2763,8 @@ func jsonModuleFromModuleInfo(m *moduleInfo) *JsonModule { func jsonModuleWithActionsFromModuleInfo(m *moduleInfo) *JsonModule { result := &JsonModule{ jsonModuleName: jsonModuleName{ - Name: m.Name(), + Name: m.Name(), + Variant: m.variant.name, }, Deps: make([]jsonDep, 0), Type: m.typeName,