alerting: batch user service calls (#103403)

* update alerting endpoints to batch requests to the user service via ListByIdOrUID
This commit is contained in:
Will Assis
2025-04-07 07:33:15 -04:00
committed by GitHub
parent a05b35a13c
commit 9bc4fbe900
3 changed files with 184 additions and 60 deletions
@@ -40,7 +40,7 @@ func TestExportFromPayload(t *testing.T) {
ruleStore := fakes.NewRuleStore(t)
ruleStore.Folders[orgID] = append(ruleStore.Folders[orgID], folder)
srv := createService(ruleStore)
srv := createService(ruleStore, nil)
requestFile := "post-rulegroup-101.json"
rawBody, err := testData.ReadFile(path.Join("test-data", requestFile))
@@ -253,7 +253,7 @@ func TestExportRules(t *testing.T) {
// overwrite the folders visible to user because PutRule automatically creates folders in the fake store.
ruleStore.Folders[orgID] = []*folder2.Folder{f1, f2}
srv := createService(ruleStore)
srv := createService(ruleStore, nil)
allRules := make([]*ngmodels.AlertRule, 0, len(hasAccess1)+len(hasAccess2)+len(noAccess1))
allRules = append(allRules, hasAccess1...)