* TP-49979 : Added API to get tags for resolving incident * TP-49979 : Set up basic structure for resolve incident from UI * TP-49979 : Complete till post rca flow * TP-49979 : Complete till rca gen flow * TP-52174 : rebase changes * TP-52174 : Integrate with slack * TP-52174 : fix error in flows * TP-52174 : Segregate interface and impl * TP-52174 : Fix ut failures * TP-52174 : Fix resolve tag api error * TP-52174 : Fix jira link bug * TP-52174 : Remove nil * TP-52174 : Rebase changes * TP-52174 : Jira links table fix * TP-52174 : Line length fix * TP-52174 : Makefile changes * TP-52174 : Basic bug fixes * TP-52174 : Minor fixes * TP-52174 : Add UT's for initial flows * TP-52174 : Added all UT's * TP-52174 : More PR review changes * TP-52174 : Add UT's for incident jira and tag service * TP-52174 : Fix jira link bug and batched create incident tags db call * TP-52174 : Make auto archival severities configurable * TP-52174 : Fix jira link in incident table issue
40 lines
1.2 KiB
Go
40 lines
1.2 KiB
Go
package processor
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/slack-go/slack/socketmode"
|
|
"houston/internal/processor/action"
|
|
"houston/logger"
|
|
"houston/pkg/slackbot"
|
|
rcaService "houston/service/rca/impl"
|
|
)
|
|
|
|
type ResolveIncidentCommandProcessor struct {
|
|
socketModeClient *socketmode.Client
|
|
resolveIncidentCommandAction *action.ResolveIncidentCommandAction
|
|
rcaService *rcaService.RcaService
|
|
}
|
|
|
|
const ResolveIncidentCommandProcessorLogTag = "[start_incident_command_processor]"
|
|
|
|
func NewResolveIncidentCommandProcessor(
|
|
socketModeClient *socketmode.Client,
|
|
slackBot *slackbot.Client,
|
|
rcaService *rcaService.RcaService,
|
|
) *ResolveIncidentCommandProcessor {
|
|
return &ResolveIncidentCommandProcessor{
|
|
socketModeClient: socketModeClient,
|
|
resolveIncidentCommandAction: action.NewResolveIncidentCommandAction(socketModeClient, slackBot, rcaService),
|
|
}
|
|
}
|
|
|
|
func (processor *ResolveIncidentCommandProcessor) ProcessSlashCommand(event *socketmode.Event) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
logger.Error(fmt.Sprintf("%s Exception occurred: %+v", ResolveIncidentCommandProcessorLogTag, r.(error)))
|
|
}
|
|
}()
|
|
|
|
processor.resolveIncidentCommandAction.PerformAction(event)
|
|
}
|