TP-47360 : Removed deleted_at column, changed text messages (#294)
* removed the deleted_at column and removed one extra space in the resolved,duplicated messages * changed rca input entity stucture * changes text in tests of rca service
This commit is contained in:
committed by
GitHub
parent
2dd4d710e5
commit
4abb12f71f
@@ -6,6 +6,5 @@ CREATE TABLE IF NOT EXISTS rca_input (
|
||||
provider_name character varying(100),
|
||||
is_active boolean DEFAULT true,
|
||||
created_at timestamp without time zone,
|
||||
updated_at timestamp without time zone,
|
||||
deleted_at timestamp without time zone
|
||||
updated_at timestamp without time zone
|
||||
);
|
||||
@@ -107,7 +107,7 @@ func (dip *DuplicateIncidentAction) DuplicateIncidentProcess(callback slack.Inte
|
||||
logger.Info("successfully marked the incident as duplicate",
|
||||
zap.String("channel", channelId),
|
||||
zap.String("user_id", user.ID))
|
||||
msgOption := slack.MsgOptionText(fmt.Sprintf("<@%s> *>* `updated status as %s. Attached to` <#%v>", callback.User.ID,
|
||||
msgOption := slack.MsgOptionText(fmt.Sprintf("<@%s> *>* `updated status as %s. Attached to` <#%v>", callback.User.ID,
|
||||
incident.Duplicated, originalIncident.SlackChannel), false)
|
||||
_, _, errMessage := dip.client.PostMessage(channelId, msgOption)
|
||||
if errMessage != nil {
|
||||
|
||||
@@ -100,7 +100,7 @@ func (irp *ResolveIncidentAction) IncidentResolveProcess(callback slack.Interact
|
||||
logger.Info("successfully resolved the incident",
|
||||
zap.String("channel", channelId),
|
||||
zap.String("user_id", callback.User.ID))
|
||||
msgOption := slack.MsgOptionText(fmt.Sprintf("<@%s> *>* `houston set status to %s`", callback.User.ID,
|
||||
msgOption := slack.MsgOptionText(fmt.Sprintf("<@%s> *>* `houston set status to %s`", callback.User.ID,
|
||||
incident.Resolved), false)
|
||||
_, _, errMessage := irp.client.PostMessage(callback.Channel.ID, msgOption)
|
||||
if errMessage != nil {
|
||||
|
||||
@@ -2,16 +2,18 @@ package rcaInput
|
||||
|
||||
import (
|
||||
"github.com/lib/pq"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
type RcaInputEntity struct {
|
||||
gorm.Model
|
||||
ID uint `gorm:"primaryKey"`
|
||||
IncidentID uint `gorm:"column:incident_id;index"`
|
||||
DocumentType string `gorm:"column:document_type"`
|
||||
IdentifierKeys pq.StringArray `gorm:"column:identifier_keys;type:text[]"`
|
||||
ProviderName string `gorm:"column:provider_name"`
|
||||
IsActive bool `gorm:"column:is_active;default:true"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
||||
}
|
||||
|
||||
func (RcaInputEntity) TableName() string {
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestRcaService_PostRcaToIncidentChannel_Success(t *testing.T) {
|
||||
rcaRepository.UpdateRcaMock.When(testRca).Then(nil)
|
||||
|
||||
slackService.PostMessageByChannelIDMock.When(
|
||||
fmt.Sprintf("<!here> System generated RCA for this incident can be viewed *<%s|here>*", "test_link"),
|
||||
fmt.Sprintf("<!here> System generated *DRAFT* version of RCA for this incident can be viewed *<%s|here>*", "test_link"),
|
||||
false,
|
||||
"1234",
|
||||
).Then("", nil)
|
||||
@@ -161,7 +161,7 @@ func TestRcaService_PostRcaToIncidentChannel_SlackFailure_RcaSuccessCase(t *test
|
||||
rcaRepository.UpdateRcaMock.When(testRca).Then(nil)
|
||||
|
||||
slackService.PostMessageByChannelIDMock.When(
|
||||
fmt.Sprintf("<!here> System generated RCA for this incident can be viewed *<%s|here>*", "test_link"),
|
||||
fmt.Sprintf("<!here> System generated *DRAFT* version of RCA for this incident can be viewed *<%s|here>*", "test_link"),
|
||||
false,
|
||||
"1234",
|
||||
).Then("", errors.New("failed to send message"))
|
||||
|
||||
Reference in New Issue
Block a user