Closed jgangemi closed 1 month ago
digging a little bit deeper, it looks like only
"channel": null,
"notify_only_broken_pipelines": false,
"branches_to_be_notified": "all",
have moved to properties
, so would the non-breaking change for this to be to do something like this:
type SetSlackApplicationOptions struct {
AlertEvents *bool `url:"alert_events,omitempty" json:"alert_events,omitempty"`
IssuesEvents *bool `url:"issues_events,omitempty" json:"issues_events,omitempty"`
ConfidentialIssuesEvents *bool `url:"confidential_issues_events,omitempty" json:"confidential_issues_events,omitempty"`
MergeRequestsEvents *bool `url:"merge_requests_events,omitempty" json:"merge_requests_events,omitempty"`
NoteEvents *bool `url:"note_events,omitempty" json:"note_events,omitempty"`
ConfidentialNoteEvents *bool `url:"confidential_note_events,omitempty" json:"confidential_note_events,omitempty"`
DeploymentEvents *bool `url:"deployment_events,omitempty" json:"deployment_events,omitempty"`
IncidentsEvents *bool `url:"incidents_events,omitempty" json:"incidents_events,omitempty"`
PipelineEvents *bool `url:"pipeline_events,omitempty" json:"pipeline_events,omitempty"`
PushEvents *bool `url:"push_events,omitempty" json:"push_events,omitempty"`
TagPushEvents *bool `url:"tag_push_events,omitempty" json:"tag_push_events,omitempty"`
VulnerabilityEvents *bool `url:"vulnerability_events,omitempty" json:"vulnerability_events,omitempty"`
WikiPageEvents *bool `url:"wiki_page_events,omitempty" json:"wiki_page_events,omitempty"`
Properties struct {
Channel *string `url:"channel,omitempty" json:"channel,omitempty"`
<other property fields>
}, `json:properties`
// Deprecated: Moved to 'Properties' struct
Channel *string `url:"channel,omitempty" json:"channel,omitempty"`
// Deprecated: Moved to 'Properties' struct
NotifyOnlyBrokenPipelines *bool `url:"notify_only_broken_pipelines,omitempty" json:"notify_only_broken_pipelines,omitempty"`
// Deprecated: Moved to 'Properties' struct
BranchesToBeNotified *string `url:"branches_to_be_notified,omitempty" json:"branches_to_be_notified,omitempty"`
// Deprecated: This parameter has been replaced with BranchesToBeNotified.
NotifyOnlyDefaultBranch *bool `url:"notify_only_default_branch,omitempty" json:"notify_only_default_branch,omitempty"`
}
ok - i figured this out. the slack structs are incorrect as all but the notify_only_broken_pipelines
attribute are defined in the Service
struct. instead those *Event
fields should be *Channel
and strings.
i'm looking through
services.go
and theSetSlackApplicationOptions
struct doesn't seem to align w/ the the response i get from the following:sample json response
am i missing something obvious (or not so obvious as i am new to
go
) or do the two just not align?if they do no align, what would be the proper way to go about adding support for this as altering the struct to support the following json would be a breaking change?