From 99233beea850177a5436bf4f896aae0282dec79c Mon Sep 17 00:00:00 2001 From: Felix Ohnesorge Date: Thu, 16 May 2024 10:06:10 +0200 Subject: [PATCH] added missing watchRecipients field for watch --- xray/services/utils/watchbody.go | 7 ++++++- xray/services/watch.go | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/xray/services/utils/watchbody.go b/xray/services/utils/watchbody.go index aee708ff3..2a68a3762 100644 --- a/xray/services/utils/watchbody.go +++ b/xray/services/utils/watchbody.go @@ -47,7 +47,8 @@ func NewWatchParams() WatchParams { Builds: WatchBuildsParams{ ByNames: make(map[string]WatchBuildsByNameParams, 0), }, - Policies: make([]AssignedPolicy, 0), + Policies: make([]AssignedPolicy, 0), + WatchRecipients: make([]string, 0), } } @@ -61,6 +62,8 @@ type WatchParams struct { Builds WatchBuildsParams Policies []AssignedPolicy + + WatchRecipients []string } // WatchRepositoriesParams is a struct that stores the repository configuration for watch @@ -120,6 +123,7 @@ type WatchBody struct { GeneralData watchGeneralParams `json:"general_data"` ProjectResources watchProjectResources `json:"project_resources,omitempty"` AssignedPolicies []AssignedPolicy `json:"assigned_policies,omitempty"` + WatchRecipients []string `json:"watch_recipients"` } // These structs are internal @@ -175,6 +179,7 @@ func CreateBody(params WatchParams) (*WatchBody, error) { Resources: []watchProjectResourcesElement{}, }, AssignedPolicies: params.Policies, + WatchRecipients: params.WatchRecipients, } err := configureRepositories(&payloadBody, params) diff --git a/xray/services/watch.go b/xray/services/watch.go index ae356e0b7..09274ba9d 100644 --- a/xray/services/watch.go +++ b/xray/services/watch.go @@ -182,6 +182,7 @@ func (xws *WatchService) Get(watchName string) (watchResp *utils.WatchParams, er ByNames: map[string]utils.WatchBuildsByNameParams{}, } result.Policies = watch.AssignedPolicies + result.WatchRecipients = watch.WatchRecipients utils.UnpackWatchBody(&result, &watch)