* 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
39 lines
1.0 KiB
Go
39 lines
1.0 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 HoustonCommandProcessor struct {
|
|
socketModeClient *socketmode.Client
|
|
houstonCommandAction *action.HoustonCommandAction
|
|
}
|
|
|
|
const houstonCommandProcessorLogTag = "[houston_command_processor]"
|
|
|
|
func NewHoustonCommandProcessor(
|
|
socketModeClient *socketmode.Client,
|
|
slackBot *slackbot.Client,
|
|
rcaService *rcaService.RcaService,
|
|
) *HoustonCommandProcessor {
|
|
return &HoustonCommandProcessor{
|
|
socketModeClient: socketModeClient,
|
|
houstonCommandAction: action.NewHoustonCommandAction(socketModeClient, slackBot, rcaService),
|
|
}
|
|
}
|
|
|
|
func (processor *HoustonCommandProcessor) ProcessSlashCommand(event *socketmode.Event) {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
logger.Error(fmt.Sprintf("%s Exception occurred: %+v", houstonCommandProcessorLogTag, r.(error)))
|
|
}
|
|
}()
|
|
|
|
processor.houstonCommandAction.PerformAction(event)
|
|
}
|