Skip to content

Commit

Permalink
Merge branch 'master' into expand-resource-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Forfold committed May 14, 2024
2 parents 56f4f05 + 17bc4e2 commit d741643
Show file tree
Hide file tree
Showing 70 changed files with 6,170 additions and 1,677 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
cache: false
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
Expand Down
19 changes: 8 additions & 11 deletions .storybook/static/mockServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
/* tslint:disable */

/**
* Mock Service Worker (2.0.11).
* Mock Service Worker.
* @see https://github.com/mswjs/msw
* - Please do NOT modify this file.
* - Please do NOT serve this file on production.
*/

const INTEGRITY_CHECKSUM = 'c5f7f8e188b673ea4e677df7ea3c5a39'
const PACKAGE_VERSION = '2.3.0'
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
const activeClientIds = new Set()

Expand Down Expand Up @@ -48,7 +49,10 @@ self.addEventListener('message', async function (event) {
case 'INTEGRITY_CHECK_REQUEST': {
sendToClient(client, {
type: 'INTEGRITY_CHECK_RESPONSE',
payload: INTEGRITY_CHECKSUM,
payload: {
packageVersion: PACKAGE_VERSION,
checksum: INTEGRITY_CHECKSUM,
},
})
break
}
Expand Down Expand Up @@ -202,13 +206,6 @@ async function getResponse(event, client, requestId) {
return passthrough()
}

// Bypass requests with the explicit bypass header.
// Such requests can be issued by "ctx.fetch()".
const mswIntention = request.headers.get('x-msw-intention')
if (['bypass', 'passthrough'].includes(mswIntention)) {
return passthrough()
}

// Notify the client that a request has been intercepted.
const requestBuffer = await request.arrayBuffer()
const clientMessage = await sendToClient(
Expand Down Expand Up @@ -240,7 +237,7 @@ async function getResponse(event, client, requestId) {
return respondWithMock(clientMessage.data)
}

case 'MOCK_NOT_FOUND': {
case 'PASSTHROUGH': {
return passthrough()
}
}
Expand Down
2 changes: 1 addition & 1 deletion alert/alert.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (a Alert) Normalize() (*Alert, error) {
err := validate.Many(
validate.Text("Summary", a.Summary, 1, MaxSummaryLength),
validate.Text("Details", a.Details, 0, MaxDetailsLength),
validate.OneOf("Source", a.Source, SourceManual, SourceGrafana, SourceSite24x7, SourcePrometheusAlertmanager, SourceEmail, SourceGeneric),
validate.OneOf("Source", a.Source, SourceManual, SourceGrafana, SourceSite24x7, SourcePrometheusAlertmanager, SourceEmail, SourceGeneric, SourceUniversal),
validate.OneOf("Status", a.Status, StatusTriggered, StatusActive, StatusClosed),
validate.UUID("ServiceID", a.ServiceID),
)
Expand Down
2 changes: 2 additions & 0 deletions alert/alertlog/legacylogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ func createdSubject(msg string) *Subject {
return &Subject{Type: SubjectTypeUser, Classifier: "Web"}
case "Created via: generic":
return &Subject{Type: SubjectTypeIntegrationKey, Classifier: "Generic"}
case "Created via: universal":
return &Subject{Type: SubjectTypeIntegrationKey, Classifier: "Universal"}
}
return nil
}
1 change: 1 addition & 0 deletions alert/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const (
SourcePrometheusAlertmanager Source = "prometheusAlertmanager" // prometheus alertmanager alert
SourceManual Source = "manual" // manually triggered
SourceGeneric Source = "generic" // generic API
SourceUniversal Source = "universal" // universal integration
)

func (s Source) Value() (driver.Value, error) {
Expand Down
2 changes: 2 additions & 0 deletions expflag/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ type Flag string
const (
Example Flag = "example"
DestTypes Flag = "dest-types"
UnivKeys Flag = "univ-keys"
)

var desc = map[Flag]string{
Example: "An example experimental flag to demonstrate usage.",
DestTypes: "Generic destination type API.",
UnivKeys: "Universal integration key support.",
}

// AllFlags returns a slice of all experimental flags sorted by name.
Expand Down
7 changes: 7 additions & 0 deletions gadb/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions gadb/queries.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
module github.com/target/goalert

go 1.22.0
go 1.22

require (
github.com/99designs/gqlgen v0.17.45
github.com/99designs/gqlgen v0.17.46
github.com/brianvoe/gofakeit/v6 v6.28.0
github.com/coreos/go-oidc/v3 v3.10.0
github.com/creack/pty/v2 v2.0.1
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/emersion/go-smtp v0.21.1
github.com/emersion/go-smtp v0.21.2
github.com/expr-lang/expr v1.16.5
github.com/fatih/color v1.16.0
github.com/felixge/httpsnoop v1.0.4
github.com/fullstorydev/grpcui v1.3.3
Expand All @@ -32,7 +33,7 @@ require (
github.com/mnako/letters v0.2.2
github.com/nyaruka/phonenumbers v1.3.4
github.com/oauth2-proxy/mockoidc v0.0.0-20220308204021-b9169deeb282
github.com/pelletier/go-toml/v2 v2.2.1
github.com/pelletier/go-toml/v2 v2.2.2
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.19.0
github.com/rubenv/sql-migrate v1.6.1
Expand All @@ -45,24 +46,24 @@ require (
github.com/vektah/gqlparser/v2 v2.5.11
golang.org/x/crypto v0.22.0
golang.org/x/oauth2 v0.19.0
golang.org/x/sys v0.19.0
golang.org/x/sys v0.20.0
golang.org/x/term v0.19.0
golang.org/x/tools v0.20.0
google.golang.org/grpc v1.62.1
google.golang.org/grpc v1.63.2
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0
google.golang.org/protobuf v1.33.0
google.golang.org/protobuf v1.34.1
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
honnef.co/go/tools v0.4.7
)

require (
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/PuerkitoBio/goquery v1.9.1 // indirect
github.com/PuerkitoBio/goquery v1.9.2 // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
Expand All @@ -72,9 +73,8 @@ require (
github.com/bufbuild/protocompile v0.6.0 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43 // indirect
github.com/envoyproxy/go-control-plane v0.12.0 // indirect
github.com/envoyproxy/protoc-gen-validate v1.0.4 // indirect
Expand Down Expand Up @@ -129,7 +129,7 @@ require (
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/smartystreets/goconvey v1.7.2 // indirect
github.com/sosodev/duration v1.2.0 // indirect
github.com/sosodev/duration v1.3.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
Expand All @@ -138,20 +138,20 @@ require (
github.com/subosito/gotenv v1.6.0 // indirect
github.com/t-k/fluent-logger-golang v1.0.0 // indirect
github.com/tinylib/msgp v1.1.8 // indirect
github.com/urfave/cli/v2 v2.27.1 // indirect
github.com/urfave/cli/v2 v2.27.2 // indirect
github.com/vanng822/css v1.0.1 // indirect
github.com/vanng822/go-premailer v1.20.2 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect
golang.org/x/exp/typeparams v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect
golang.org/x/text v0.15.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
Expand Down
Loading

0 comments on commit d741643

Please sign in to comment.