Incident Service Integration with monitoring service client for Houston-Krakatoa integration (#302)
Incident Service Integration with monitoring service client for Houston-Krakatoa integration (#302)
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"houston/model/severity"
|
||||
"houston/model/team"
|
||||
"houston/pkg/slackbot"
|
||||
incidentV2 "houston/service/incident"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
@@ -22,15 +23,17 @@ type IncidentUpdateTypeAction struct {
|
||||
incidentRepository *incident.Repository
|
||||
severityRepository *severity.Repository
|
||||
slackbotClient *slackbot.Client
|
||||
incidentServiceV2 *incidentV2.IncidentServiceV2
|
||||
}
|
||||
|
||||
func NewIncidentUpdateTypeAction(client *socketmode.Client, incidentService *incident.Repository, teamService *team.Repository, severityService *severity.Repository, slackbotClient *slackbot.Client) *IncidentUpdateTypeAction {
|
||||
func NewIncidentUpdateTypeAction(client *socketmode.Client, incidentService *incident.Repository, teamService *team.Repository, severityService *severity.Repository, slackbotClient *slackbot.Client, incidentServiceV2 *incidentV2.IncidentServiceV2) *IncidentUpdateTypeAction {
|
||||
return &IncidentUpdateTypeAction{
|
||||
socketModeClient: client,
|
||||
teamRepository: teamService,
|
||||
incidentRepository: incidentService,
|
||||
severityRepository: severityService,
|
||||
slackbotClient: slackbotClient,
|
||||
incidentServiceV2: incidentServiceV2,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +147,8 @@ func (incidentUpdateTypeAction *IncidentUpdateTypeAction) IncidentUpdateType(cal
|
||||
}
|
||||
topic := fmt.Sprintf("%s-%s(%s) Incident-%d | %s", teamEntity.Name, severityEntity.Name, severityEntity.Description, incidentEntity.ID, incidentEntity.Title)
|
||||
incidentUpdateTypeAction.slackbotClient.SetChannelTopic(callback.View.PrivateMetadata, topic)
|
||||
|
||||
incidentUpdateTypeAction.incidentServiceV2.ExecuteKrakatoaWorkflow(incidentEntity)
|
||||
}()
|
||||
|
||||
var payload interface{}
|
||||
|
||||
@@ -70,7 +70,7 @@ func NewBlockActionProcessor(
|
||||
incidentUpdateAction: action.NewIncidentUpdateAction(socketModeClient, incidentRepository,
|
||||
tagService, teamService, severityService),
|
||||
incidentUpdateTypeAction: action.NewIncidentUpdateTypeAction(socketModeClient, incidentRepository,
|
||||
teamService, severityService, slackbotClient),
|
||||
teamService, severityService, slackbotClient, incidentServiceV2),
|
||||
incidentUpdateSeverityAction: action.NewIncidentUpdateSeverityAction(socketModeClient, incidentRepository,
|
||||
severityService, teamService, slackbotClient, incidentServiceV2),
|
||||
incidentUpdateTitleAction: action.NewIncidentUpdateTitleAction(socketModeClient, incidentRepository,
|
||||
@@ -269,7 +269,7 @@ func NewViewSubmissionProcessor(
|
||||
incidentUpdateSeverityAction: action.NewIncidentUpdateSeverityAction(socketModeClient, incidentRepository,
|
||||
severityService, teamService, slackbotClient, incidentServiceV2),
|
||||
incidentUpdateTypeAction: action.NewIncidentUpdateTypeAction(socketModeClient, incidentRepository,
|
||||
teamService, severityService, slackbotClient),
|
||||
teamService, severityService, slackbotClient, incidentServiceV2),
|
||||
incidentUpdateTagsAction: action.NewIncidentUpdateTagsAction(socketModeClient, incidentRepository,
|
||||
teamService, tagService),
|
||||
incidentUpdateRca: action.NewIncidentUpdateRcaAction(socketModeClient, incidentRepository),
|
||||
|
||||
Reference in New Issue
Block a user