drop URL from Message as it is unfilled and superfluous

main
Bel LaPointe 2024-04-16 09:13:44 -06:00
parent 4f3b8ec866
commit 600a2e0111
4 changed files with 2 additions and 6 deletions

View File

@ -4,18 +4,16 @@ package model
type Message struct {
Updated uint64
ID string
URL string
TS uint64
Author string
Plaintext 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{
Updated: updated(),
ID: ID,
URL: URL,
TS: TS,
Author: Author,
Plaintext: Plaintext,

View File

@ -77,7 +77,7 @@ func newSlackToModelProcess(cfg Config) processFunc {
}
message := model.Message{}
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{}
if s.Thread != "" && s.Source != "" && s.TS > 0 && s.Event != "" {

View File

@ -45,7 +45,6 @@ func TestSlackToModelPipeline(t *testing.T) {
),
Message: model.NewMessage(
"1712927439.728409/1712927439",
"https://renderinc.slack.com/archives/C06U1DDBBU4/p1712927439728409",
1712927439,
"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&amp;viewPanel=17>\nSource: <https://grafana.render.com/alerting/grafana/fa7b06b8-b4d8-4979-bce7-5e1c432edd81/view?orgId=1>",

View File

@ -67,7 +67,6 @@ func TestStorage(t *testing.T) {
t.Run("upsert get message", func(t *testing.T) {
m := model.NewMessage(
"ID",
"URL",
1,
"Author",
"Plaintext",