Skip to content

Commit

Permalink
chore: update schema (#915)
Browse files Browse the repository at this point in the history
* chore: update schema

* asd
  • Loading branch information
dbarrosop authored Sep 17, 2024
1 parent 2328105 commit c1a77d0
Show file tree
Hide file tree
Showing 13 changed files with 12,660 additions and 5,751 deletions.
52 changes: 52 additions & 0 deletions cmd/config/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,58 @@ func commandExample(cCtx *cli.Context) error { //nolint:funlen,maintidx
User: "smtpUser",
Password: "smtpPassword",
},
Alerting: &model.ConfigGrafanaAlerting{
Enabled: ptr(true),
},
Contacts: &model.ConfigGrafanaContacts{
Emails: []string{
"engineering@acme.com",
},
Pagerduty: []*model.ConfigGrafanacontactsPagerduty{
{
IntegrationKey: "integration-key",
Severity: "critical",
Class: "infra",
Component: "backend",
Group: "group",
},
},
Discord: []*model.ConfigGrafanacontactsDiscord{
{
Url: "https://discord.com/api/webhooks/...",
AvatarUrl: "https://discord.com/api/avatar/...",
},
},
Slack: []*model.ConfigGrafanacontactsSlack{
{
Recipient: "recipient",
Token: "token",
Username: "username",
IconEmoji: "danger",
IconURL: "https://...",
MentionUsers: []string{
"user1", "user2",
},
MentionGroups: []string{
"group1", "group2",
},
MentionChannel: "channel",
Url: "https://slack.com/api/webhooks/...",
EndpointURL: "https://slack.com/api/endpoint/...",
},
},
Webhook: []*model.ConfigGrafanacontactsWebhook{
{
Url: "https://webhook.example.com",
HttpMethod: "POST",
Username: "user",
Password: "password",
AuthorizationScheme: "Bearer",
AuthorizationCredentials: "token",
MaxAlerts: 10,
},
},
},
},
},
}
Expand Down
9 changes: 8 additions & 1 deletion cmd/config/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,14 @@ func expectedConfig() *model.ConfigConfig {
Provider: &model.ConfigProvider{},
Storage: &model.ConfigStorage{Version: ptr("0.3.4")},
Observability: &model.ConfigObservability{
Grafana: &model.ConfigGrafana{AdminPassword: "grafana-admin-password"},
Grafana: &model.ConfigGrafana{
AdminPassword: "grafana-admin-password",
Smtp: nil,
Alerting: &model.ConfigGrafanaAlerting{
Enabled: ptr(false),
},
Contacts: &model.ConfigGrafanaContacts{},
},
},
}
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/configserver/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ func newApp() *graph.App {
Grafana: &model.ConfigGrafana{
AdminPassword: "asdasd",
Smtp: nil,
Alerting: nil,
Contacts: nil,
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions dockercompose/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ func getConfig() *model.ConfigConfig { //nolint:maintidx
Grafana: &model.ConfigGrafana{
AdminPassword: "grafanaAdminPassword",
Smtp: nil,
Alerting: &model.ConfigGrafanaAlerting{}, //nolint:exhaustruct
Contacts: &model.ConfigGrafanaContacts{}, //nolint:exhaustruct
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-getter v1.7.6
github.com/nhost/be v0.0.0-20240912110026-065f6e01492e
github.com/nhost/be v0.0.0-20240916113452-cf291042e14b
github.com/pelletier/go-toml/v2 v2.2.3
github.com/rs/cors/wrapper/gin v0.0.0-20240830163046-1084d89a1692
github.com/sirupsen/logrus v1.9.3
Expand Down
12 changes: 2 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -512,16 +512,8 @@ github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/nhost/be v0.0.0-20240908163314-496619d1918a h1:3+feiRHyXSfWb1DRdk8DePL377tOQ2dA6vAYU8k3fys=
github.com/nhost/be v0.0.0-20240908163314-496619d1918a/go.mod h1:66uhAK6GsdrY7fv2oOQaBAKzMQO0p/pGuf12YuXNHSs=
github.com/nhost/be v0.0.0-20240909125313-7c9f5c9566d0 h1:nGocbayWSf+PivZLt06Si/8+dLMyf+U6vi/me+1hQDQ=
github.com/nhost/be v0.0.0-20240909125313-7c9f5c9566d0/go.mod h1:fnA4FCHOZpOIdUCXvHBav8KhvHEc2bd+xjDDJq+j+To=
github.com/nhost/be v0.0.0-20240909130456-6e51b7cb8f1c h1:Q8ZFSWvmU/l1/YiIfdrMk2pZ/yZQFiG1abJqXZByq4o=
github.com/nhost/be v0.0.0-20240909130456-6e51b7cb8f1c/go.mod h1:fnA4FCHOZpOIdUCXvHBav8KhvHEc2bd+xjDDJq+j+To=
github.com/nhost/be v0.0.0-20240909133931-ac84bc8054d6 h1:/JEKTGU1epbT40S56gHIxgx7cQ0mj6l1varORuedhgw=
github.com/nhost/be v0.0.0-20240909133931-ac84bc8054d6/go.mod h1:fnA4FCHOZpOIdUCXvHBav8KhvHEc2bd+xjDDJq+j+To=
github.com/nhost/be v0.0.0-20240912110026-065f6e01492e h1:pHtjtGzg2b+Y+fPlNnhTCDQ/XXN5n50SCuu8828ytaA=
github.com/nhost/be v0.0.0-20240912110026-065f6e01492e/go.mod h1:fnA4FCHOZpOIdUCXvHBav8KhvHEc2bd+xjDDJq+j+To=
github.com/nhost/be v0.0.0-20240916113452-cf291042e14b h1:4IJ5mofAuOW+ZjYAlufF9O06Pgot/wvD/gTA4IVMcqo=
github.com/nhost/be v0.0.0-20240916113452-cf291042e14b/go.mod h1:fhC4rG9GeDBfXefXth+fbwqG8t1sIzPKrStErP7rt3w=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
Expand Down
108 changes: 104 additions & 4 deletions nhostclient/graphql/models_gen.go

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

2 changes: 2 additions & 0 deletions project/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ func DefaultConfig() (*model.ConfigConfig, error) {
Grafana: &model.ConfigGrafana{
AdminPassword: "{{ secrets.GRAFANA_ADMIN_PASSWORD }}",
Smtp: nil,
Alerting: &model.ConfigGrafanaAlerting{}, //nolint:exhaustruct
Contacts: &model.ConfigGrafanaContacts{}, //nolint:exhaustruct
},
},
}
Expand Down
Loading

0 comments on commit c1a77d0

Please sign in to comment.