Skip to content

Commit 6f1d7f1

Browse files
committed
Merge branch 'master' of github.com:target/goalert into dependabot/npm_and_yarn/react-error-boundary-6.1.1
2 parents e9f2242 + e7fdaa9 commit 6f1d7f1

33 files changed

Lines changed: 904 additions & 308 deletions

.github/dco.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
####
2+
# This file configures dco2, a tool Target uses to nudge contributors to sign-off their
3+
# adherence to the DCO agreement.
4+
#
5+
# dco2: https://github.com/cncf/dco2
6+
#
7+
# For more information about Target's use of the Developer Certificate of Origin standard,
8+
# please see https://github.com/target/.github.
9+
#
10+
# This file should be kept in sync with https://github.com/target/.github/blob/main/dco.yml
11+
#
12+
####
13+
# https://github.com/cncf/dco2?#remediation-commits
14+
allowRemediationCommits:
15+
# Allow individual remediation commits
16+
# https://github.com/cncf/dco2?#individual
17+
individual: true
18+
# DO NOT Allow third-party remediation commits
19+
# https://github.com/cncf/dco2?#third-party
20+
thirdParty: false
21+
22+
require:
23+
# Target contributors are NOT required to sign-off commits
24+
# https://github.com/cncf/dco2?#skipping-sign-off-for-organization-members
25+
members: false

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 74 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you're using the demo container for integration testing:
2929

3030
If you'd like to contribute to GoAlert, please see our [Contributing Guidelines](./CONTRIBUTING.md) and the [Development Setup Guide](./docs/development-setup.md).
3131

32-
Please also see our [Code of Conduct](./CODE_OF_CONDUCT.md).
32+
Please also see our [Code of Conduct](https://github.com/target/.github/blob/main/CODE_OF_CONDUCT.md).
3333

3434
For most purposes, you can use `make start` from the root of this repo to start a development server.
3535

alert/alertlog/queries.sql

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ FROM
1919
WHERE
2020
a.status != 'closed';
2121

22+
-- name: AlertLog_HasRecentDuplicate :one
23+
-- Checks if there is a recent duplicate-suppressed log for the alert.
24+
SELECT
25+
EXISTS (
26+
SELECT
27+
1
28+
FROM
29+
alert_logs
30+
WHERE
31+
alert_id = @alert_id::bigint
32+
AND event = 'duplicate_suppressed'
33+
AND timestamp >(now() - INTERVAL '5 seconds'));
34+
2235
-- name: AlertLog_InsertSvc :exec
2336
-- Inserts a new alert log for all alerts in the service that are not closed.
2437
INSERT INTO alert_logs(alert_id, event, sub_type, sub_user_id, sub_integration_key_id, sub_hb_monitor_id, sub_channel_id, sub_classifier, meta, message)

alert/alertlog/store.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,20 @@ func (s *Store) MustLog(ctx context.Context, alertID int, _type Type, meta inter
126126
}
127127

128128
func (s *Store) MustLogTx(ctx context.Context, tx *sql.Tx, alertID int, _type Type, meta interface{}) {
129+
// suppress duplicate duplicate-suppression logs since they aren't actionable and just add noise
130+
if _type == TypeDuplicateSupressed {
131+
hasRecent, err := gadb.New(tx).AlertLog_HasRecentDuplicate(ctx, int64(alertID))
132+
if err != nil {
133+
log.Log(ctx, errors.Wrap(err, "check for recent duplicate alert log"))
134+
return
135+
}
136+
137+
if hasRecent {
138+
// skip it if there's been one in the last 5 seconds
139+
return
140+
}
141+
}
142+
129143
err := s.LogTx(ctx, tx, alertID, _type, meta)
130144
if err != nil {
131145
log.Log(ctx, errors.Wrap(err, "append alert log"))

app/runapp.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import (
66
"net/http"
77
"os"
88

9+
"github.com/target/goalert/app/lifecycle"
10+
911
"github.com/pkg/errors"
1012
)
1113

@@ -19,7 +21,10 @@ func (app *App) Run(ctx context.Context) error {
1921
func (app *App) _Run(ctx context.Context) error {
2022
go func() {
2123
err := app.Engine.Run(ctx)
22-
if err != nil {
24+
// ErrShutdown / context.Canceled mean the engine was shut down before
25+
// this goroutine got scheduled (race between _Run and _Shutdown);
26+
// it's expected during fast restarts, not a failure.
27+
if err != nil && !errors.Is(err, lifecycle.ErrShutdown) && !errors.Is(err, context.Canceled) {
2328
app.Logger.ErrorContext(ctx, "Failed to run engine.", slog.Any("error", err))
2429
}
2530
}()

config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ type Config struct {
100100

101101
SigningSecret string `password:"true" info:"Signing secret to verify requests from slack."`
102102
InteractiveMessages bool `info:"Enable interactive messages (e.g. buttons)."`
103+
DisableBroadcastThreadReplies bool `info:"Disable broadcasting alert status updates in threads to the main channel." public:"true"`
103104
}
104105

105106
Twilio struct {

gadb/queries.sql.go

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,54 @@ go 1.26.0
55
replace github.com/imdario/mergo => github.com/imdario/mergo v0.3.16
66

77
require (
8-
github.com/99designs/gqlgen v0.17.90
9-
github.com/brianvoe/gofakeit/v7 v7.14.1
10-
github.com/coreos/go-oidc/v3 v3.18.0
8+
github.com/99designs/gqlgen v0.17.91
9+
github.com/brianvoe/gofakeit/v7 v7.15.0
10+
github.com/coreos/go-oidc/v3 v3.19.0
1111
github.com/creack/pty/v2 v2.0.1
1212
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
1313
github.com/deckarep/golang-set/v2 v2.9.0
1414
github.com/emersion/go-smtp v0.24.0
1515
github.com/expr-lang/expr v1.17.8
1616
github.com/fatih/color v1.19.0
17-
github.com/felixge/httpsnoop v1.0.4
17+
github.com/felixge/httpsnoop v1.1.0
1818
github.com/golang-jwt/jwt/v5 v5.3.1
1919
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8
2020
github.com/google/go-github/v86 v86.0.0
2121
github.com/google/uuid v1.6.0
2222
github.com/hashicorp/yamux v0.1.2
2323
github.com/jackc/pgtype v1.14.4
24-
github.com/jackc/pgx/v5 v5.9.2
24+
github.com/jackc/pgx/v5 v5.10.0
2525
github.com/jackc/pgxlisten v0.0.0-20250802141604-12b92425684c
2626
github.com/jmespath/go-jmespath v0.4.0
2727
github.com/joho/godotenv v1.5.1
2828
github.com/lib/pq v1.12.3
2929
github.com/matcornic/hermes v1.3.0
3030
github.com/mnako/letters v0.2.8
31-
github.com/nyaruka/phonenumbers v1.7.2
31+
github.com/nyaruka/phonenumbers v1.8.0
3232
github.com/oauth2-proxy/mockoidc v0.0.0-20240214162133-caebfff84d25
33-
github.com/pelletier/go-toml/v2 v2.3.1
33+
github.com/pelletier/go-toml/v2 v2.4.0
3434
github.com/pkg/errors v0.9.1
3535
github.com/prometheus/client_golang v1.23.2
36-
github.com/riverqueue/river v0.35.1
37-
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.35.1
38-
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.35.1
39-
github.com/riverqueue/river/rivertype v0.35.1
36+
github.com/riverqueue/river v0.39.0
37+
github.com/riverqueue/river/riverdriver/riverdatabasesql v0.39.0
38+
github.com/riverqueue/river/riverdriver/riverpgxv5 v0.39.0
39+
github.com/riverqueue/river/rivertype v0.39.0
4040
github.com/samber/slog-logrus/v2 v2.5.4
4141
github.com/sirupsen/logrus v1.9.4
42-
github.com/slack-go/slack v0.23.1
42+
github.com/slack-go/slack v0.26.0
4343
github.com/spf13/cobra v1.10.2
4444
github.com/spf13/viper v1.21.0
4545
github.com/sqlc-dev/pqtype v0.3.0
4646
github.com/stretchr/testify v1.11.1
47-
github.com/vektah/gqlparser/v2 v2.5.33
48-
golang.org/x/crypto v0.50.0
47+
github.com/vektah/gqlparser/v2 v2.5.34
48+
golang.org/x/crypto v0.53.0
4949
golang.org/x/oauth2 v0.36.0
50-
golang.org/x/sys v0.44.0
51-
golang.org/x/term v0.43.0
52-
google.golang.org/grpc v1.81.0
50+
golang.org/x/sys v0.46.0
51+
golang.org/x/term v0.44.0
52+
google.golang.org/grpc v1.81.1
5353
google.golang.org/protobuf v1.36.11
5454
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
55-
riverqueue.com/riverui v0.15.0
55+
riverqueue.com/riverui v0.16.0
5656
)
5757

5858
require (
@@ -74,6 +74,7 @@ require (
7474
github.com/clipperhouse/displaywidth v0.11.0 // indirect
7575
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
7676
github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect
77+
github.com/coder/websocket v1.8.14 // indirect
7778
github.com/coreos/go-semver v0.3.1 // indirect
7879
github.com/cubicdaiya/gonp v1.0.4 // indirect
7980
github.com/dustin/go-humanize v1.0.1 // indirect
@@ -146,10 +147,10 @@ require (
146147
github.com/prometheus/procfs v0.20.1 // indirect
147148
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
148149
github.com/riverqueue/apiframe v0.0.0-20260428012848-22cd8d31a740 // indirect
149-
github.com/riverqueue/river/cmd/river v0.35.1 // indirect
150-
github.com/riverqueue/river/riverdriver v0.35.1 // indirect
151-
github.com/riverqueue/river/riverdriver/riversqlite v0.35.1 // indirect
152-
github.com/riverqueue/river/rivershared v0.35.1 // indirect
150+
github.com/riverqueue/river/cmd/river v0.39.0 // indirect
151+
github.com/riverqueue/river/riverdriver v0.39.0 // indirect
152+
github.com/riverqueue/river/riverdriver/riversqlite v0.39.0 // indirect
153+
github.com/riverqueue/river/rivershared v0.39.0 // indirect
153154
github.com/riza-io/grpc-go v0.2.0 // indirect
154155
github.com/russross/blackfriday/v2 v2.1.0 // indirect
155156
github.com/sagikazarmark/locafero v0.12.0 // indirect
@@ -165,11 +166,11 @@ require (
165166
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
166167
github.com/subosito/gotenv v1.6.0 // indirect
167168
github.com/tetratelabs/wazero v1.11.0 // indirect
168-
github.com/tidwall/gjson v1.18.0 // indirect
169+
github.com/tidwall/gjson v1.19.0 // indirect
169170
github.com/tidwall/match v1.2.0 // indirect
170171
github.com/tidwall/pretty v1.2.1 // indirect
171172
github.com/tidwall/sjson v1.2.5 // indirect
172-
github.com/urfave/cli/v3 v3.8.0 // indirect
173+
github.com/urfave/cli/v3 v3.9.0 // indirect
173174
github.com/vanng822/css v1.0.1 // indirect
174175
github.com/vanng822/go-premailer v1.33.0 // indirect
175176
github.com/wasilibs/go-pgquery v0.0.0-20260428021157-dca720e45577 // indirect
@@ -182,12 +183,12 @@ require (
182183
go.yaml.in/yaml/v2 v2.4.4 // indirect
183184
go.yaml.in/yaml/v3 v3.0.4 // indirect
184185
golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect
185-
golang.org/x/mod v0.35.0 // indirect
186-
golang.org/x/net v0.53.0 // indirect
187-
golang.org/x/sync v0.20.0 // indirect
188-
golang.org/x/telemetry v0.0.0-20260428171046-76f71b9afea0 // indirect
189-
golang.org/x/text v0.37.0 // indirect
190-
golang.org/x/tools v0.44.0 // indirect
186+
golang.org/x/mod v0.36.0 // indirect
187+
golang.org/x/net v0.55.0 // indirect
188+
golang.org/x/sync v0.21.0 // indirect
189+
golang.org/x/telemetry v0.0.0-20260508192327-42602be52be6 // indirect
190+
golang.org/x/text v0.38.0 // indirect
191+
golang.org/x/tools v0.45.0 // indirect
191192
google.golang.org/genproto/googleapis/api v0.0.0-20260504160031-60b97b32f348 // indirect
192193
google.golang.org/genproto/googleapis/rpc v0.0.0-20260504160031-60b97b32f348 // indirect
193194
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.6.1 // indirect
@@ -196,10 +197,10 @@ require (
196197
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
197198
gopkg.in/yaml.v2 v2.4.0 // indirect
198199
gopkg.in/yaml.v3 v3.0.1 // indirect
199-
modernc.org/libc v1.72.2 // indirect
200+
modernc.org/libc v1.72.3 // indirect
200201
modernc.org/mathutil v1.7.1 // indirect
201202
modernc.org/memory v1.11.0 // indirect
202-
modernc.org/sqlite v1.50.0 // indirect
203+
modernc.org/sqlite v1.51.0 // indirect
203204
)
204205

205206
tool (

0 commit comments

Comments
 (0)