drop URL from Message as it is unfilled and superfluous
parent
4f3b8ec866
commit
600a2e0111
|
|
@ -4,18 +4,16 @@ package model
|
||||||
type Message struct {
|
type Message struct {
|
||||||
Updated uint64
|
Updated uint64
|
||||||
ID string
|
ID string
|
||||||
URL string
|
|
||||||
TS uint64
|
TS uint64
|
||||||
Author string
|
Author string
|
||||||
Plaintext string
|
Plaintext string
|
||||||
ThreadID string
|
ThreadID string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMessage(ID, URL string, TS uint64, Author, Plaintext string, ThreadID string) Message {
|
func NewMessage(ID string, TS uint64, Author, Plaintext string, ThreadID string) Message {
|
||||||
return Message{
|
return Message{
|
||||||
Updated: updated(),
|
Updated: updated(),
|
||||||
ID: ID,
|
ID: ID,
|
||||||
URL: URL,
|
|
||||||
TS: TS,
|
TS: TS,
|
||||||
Author: Author,
|
Author: Author,
|
||||||
Plaintext: Plaintext,
|
Plaintext: Plaintext,
|
||||||
|
|
|
||||||
2
slack.go
2
slack.go
|
|
@ -77,7 +77,7 @@ func newSlackToModelProcess(cfg Config) processFunc {
|
||||||
}
|
}
|
||||||
message := model.Message{}
|
message := model.Message{}
|
||||||
if s.ID != "" && s.Source != "" && s.TS > 0 && s.Thread != "" {
|
if s.ID != "" && s.Source != "" && s.TS > 0 && s.Thread != "" {
|
||||||
message = model.NewMessage(s.ID, s.Source, s.TS, s.Author, s.Plaintext, s.Thread)
|
message = model.NewMessage(s.ID, s.TS, s.Author, s.Plaintext, s.Thread)
|
||||||
}
|
}
|
||||||
thread := model.Thread{}
|
thread := model.Thread{}
|
||||||
if s.Thread != "" && s.Source != "" && s.TS > 0 && s.Event != "" {
|
if s.Thread != "" && s.Source != "" && s.TS > 0 && s.Event != "" {
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@ func TestSlackToModelPipeline(t *testing.T) {
|
||||||
),
|
),
|
||||||
Message: model.NewMessage(
|
Message: model.NewMessage(
|
||||||
"1712927439.728409/1712927439",
|
"1712927439.728409/1712927439",
|
||||||
"https://renderinc.slack.com/archives/C06U1DDBBU4/p1712927439728409",
|
|
||||||
1712927439,
|
1712927439,
|
||||||
"Opsgenie for Alert Management",
|
"Opsgenie for Alert Management",
|
||||||
"At least one alertconfig run has failed unexpectedly.\nDashboard: <https://grafana.render.com/d/VLZU83YVk?orgId=1>\nPanel: <https://grafana.render.com/d/VLZU83YVk?orgId=1&viewPanel=17>\nSource: <https://grafana.render.com/alerting/grafana/fa7b06b8-b4d8-4979-bce7-5e1c432edd81/view?orgId=1>",
|
"At least one alertconfig run has failed unexpectedly.\nDashboard: <https://grafana.render.com/d/VLZU83YVk?orgId=1>\nPanel: <https://grafana.render.com/d/VLZU83YVk?orgId=1&viewPanel=17>\nSource: <https://grafana.render.com/alerting/grafana/fa7b06b8-b4d8-4979-bce7-5e1c432edd81/view?orgId=1>",
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ func TestStorage(t *testing.T) {
|
||||||
t.Run("upsert get message", func(t *testing.T) {
|
t.Run("upsert get message", func(t *testing.T) {
|
||||||
m := model.NewMessage(
|
m := model.NewMessage(
|
||||||
"ID",
|
"ID",
|
||||||
"URL",
|
|
||||||
1,
|
1,
|
||||||
"Author",
|
"Author",
|
||||||
"Plaintext",
|
"Plaintext",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue