Skip to content

Commit

Permalink
added missing watchRecipients field for watch
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Ohnesorge committed May 16, 2024
1 parent 3a0b600 commit 99233be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion xray/services/utils/watchbody.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
}

Expand All @@ -61,6 +62,8 @@ type WatchParams struct {

Builds WatchBuildsParams
Policies []AssignedPolicy

WatchRecipients []string
}

// WatchRepositoriesParams is a struct that stores the repository configuration for watch
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -175,6 +179,7 @@ func CreateBody(params WatchParams) (*WatchBody, error) {
Resources: []watchProjectResourcesElement{},
},
AssignedPolicies: params.Policies,
WatchRecipients: params.WatchRecipients,
}

err := configureRepositories(&payloadBody, params)
Expand Down
1 change: 1 addition & 0 deletions xray/services/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 99233be

Please sign in to comment.