From e3fabd46506a8fd0a093a1bf502039aeb4e21cd5 Mon Sep 17 00:00:00 2001 From: mitchell Date: Wed, 25 Sep 2024 14:24:59 -0400 Subject: [PATCH 1/2] Fixed config.Get for enum types. --- internal/config/instance.go | 2 +- internal/mediators/config/registry.go | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/config/instance.go b/internal/config/instance.go index 00a2cb3ea0..fd6d68fe48 100644 --- a/internal/config/instance.go +++ b/internal/config/instance.go @@ -185,7 +185,7 @@ func (i *Instance) Get(key string) interface{} { return result } if opt := mediator.GetOption(key); mediator.KnownOption(opt) { - return opt.Default + return mediator.GetDefault(opt) } return nil } diff --git a/internal/mediators/config/registry.go b/internal/mediators/config/registry.go index d2af1f32d3..526a641c88 100644 --- a/internal/mediators/config/registry.go +++ b/internal/mediators/config/registry.go @@ -67,3 +67,10 @@ func RegisterOptionWithEvents(key string, t Type, defaultValue interface{}, get, func KnownOption(rule Option) bool { return rule.isRegistered } + +func GetDefault(opt Option) interface{} { + if enum, ok := opt.Default.(*Enums); ok { + return enum.Default + } + return opt.Default +} From 49d2ea017b5a015877de7d88213527e1fb534aec Mon Sep 17 00:00:00 2001 From: mitchell Date: Wed, 25 Sep 2024 14:33:01 -0400 Subject: [PATCH 2/2] Fix build failure. --- internal/runners/export/deptree/artifacts.go | 2 +- internal/runners/export/deptree/ingredients.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/runners/export/deptree/artifacts.go b/internal/runners/export/deptree/artifacts.go index 26184a1b2c..f750bb4eb1 100644 --- a/internal/runners/export/deptree/artifacts.go +++ b/internal/runners/export/deptree/artifacts.go @@ -58,7 +58,7 @@ func (d *DeptreeByArtifacts) Run(params ArtifactParams) error { return errs.Wrap(err, "Could not resolve namespace") } - bpm := buildplanner.NewBuildPlannerModel(d.prime.Auth()) + bpm := buildplanner.NewBuildPlannerModel(d.prime.Auth(), d.prime.SvcModel()) commit, err := bpm.FetchCommit(*ns.CommitID, ns.Owner, ns.Project, nil) if err != nil { return errs.Wrap(err, "Could not get remote build expr and time for provided commit") diff --git a/internal/runners/export/deptree/ingredients.go b/internal/runners/export/deptree/ingredients.go index f116a00c07..1003f25abc 100644 --- a/internal/runners/export/deptree/ingredients.go +++ b/internal/runners/export/deptree/ingredients.go @@ -46,7 +46,7 @@ func (d *DeptreeByIngredients) Run(params IngredientParams) error { return errs.Wrap(err, "Could not resolve namespace") } - bpm := buildplanner.NewBuildPlannerModel(d.prime.Auth()) + bpm := buildplanner.NewBuildPlannerModel(d.prime.Auth(), d.prime.SvcModel()) commit, err := bpm.FetchCommit(*ns.CommitID, ns.Owner, ns.Project, nil) if err != nil { return errs.Wrap(err, "Could not get remote build expr and time for provided commit")