From b71ed229f15fb6a0d0d55c23e71466714da77229 Mon Sep 17 00:00:00 2001 From: Steve Simpson Date: Thu, 4 Dec 2025 12:52:24 +0100 Subject: [PATCH] Alerting: Minor refactor to historan app RegisterAppInstaller. (#114828) Splits the function in two so that NewAppInstaller can be used stanalone. --- pkg/registry/apps/alerting/historian/register.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apps/alerting/historian/register.go b/pkg/registry/apps/alerting/historian/register.go index 78312c326aa..6125469ce10 100644 --- a/pkg/registry/apps/alerting/historian/register.go +++ b/pkg/registry/apps/alerting/historian/register.go @@ -26,7 +26,6 @@ func RegisterAppInstaller( cfg *setting.Cfg, ng *ngalert.AlertNG, ) (*AlertingHistorianAppInstaller, error) { - installer := &AlertingHistorianAppInstaller{} appSpecificConfig := historianAppConfig.RuntimeConfig{} // If we're provided an AlertNG, then call back into that for things we need. @@ -43,6 +42,12 @@ func RegisterAppInstaller( appSpecificConfig.GetAlertStateHistoryHandler = handlers.GetAlertStateHistoryHandler } + return NewAppInstaller(appSpecificConfig) +} + +func NewAppInstaller(appSpecificConfig historianAppConfig.RuntimeConfig) (*AlertingHistorianAppInstaller, error) { + installer := &AlertingHistorianAppInstaller{} + provider := simple.NewAppProvider(apis.LocalManifest(), appSpecificConfig, historianApp.New) appConfig := app.Config{