From cbc091b4b501a846858f5124e184f3daa17fd40e Mon Sep 17 00:00:00 2001 From: Samir Faci Date: Sat, 7 Sep 2024 13:35:16 -0400 Subject: [PATCH] Renames config property `exclude_filters` to `exclude` Fixes #289 --- Taskfile.yml | 2 +- config/importer-example.yml | 13 ++++++------- internal/api/orgs.go | 2 +- internal/config/grafana_config.go | 2 +- website/content/docs/gdg/configuration.md | 2 +- website/content/docs/releases/gdg_0.6.md | 6 +++++- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 91872746..341012eb 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -23,7 +23,7 @@ tasks: cmds: - go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest - go install github.com/client9/misspell/cmd/misspell@latest - - go install github.com/securego/gosec/v2/cmd/gosec@master + - go install github.com/securego/gosec/v2/cmd/gosec@latest - go install golang.org/x/vuln/cmd/govulncheck@latest - go install github.com/vektra/mockery/v2@{{ .MOCKERY_VERSION}} - go install github.com/goreleaser/goreleaser@{{ .RELEASER_VERSION }} diff --git a/config/importer-example.yml b/config/importer-example.yml index 122889bb..b2f9e8fa 100644 --- a/config/importer-example.yml +++ b/config/importer-example.yml @@ -31,13 +31,12 @@ contexts: min_length: 8 max_length: 20 connections: - exclude_filters: - - matches: - - field: "name" - regex: "DEV-*|-Dev-*" - - field: "type" - regex: "elasticsearch" - inclusive: true + filters: + - field: "name" + regex: "DEV-*|-Dev-*" + - field: "type" + regex: "elasticsearch" + inclusive: true credential_rules: - rules: - field: "name" diff --git a/internal/api/orgs.go b/internal/api/orgs.go index f6ada8e8..cc8fe6a6 100644 --- a/internal/api/orgs.go +++ b/internal/api/orgs.go @@ -37,7 +37,7 @@ func (extended *ExtendedApi) GetConfiguredOrgId(orgName string) (int64, error) { var count uint = 5 //Giving user configured value preference over defaults if config.Config().GetGDGConfig().GetAppGlobals().RetryCount != 0 { - count = uint(config.Config().GetGDGConfig().GetAppGlobals().RetryCount) + count = uint(config.Config().GetGDGConfig().GetAppGlobals().RetryCount) // #nosec G115 } if config.Config().GetGDGConfig().GetAppGlobals().GetRetryTimeout() != time.Millisecond*100 { delay = config.Config().GetGDGConfig().GetAppGlobals().GetRetryTimeout() diff --git a/internal/config/grafana_config.go b/internal/config/grafana_config.go index 23bf1ed0..4c070169 100644 --- a/internal/config/grafana_config.go +++ b/internal/config/grafana_config.go @@ -24,7 +24,7 @@ type MonitoredOrgFolders struct { // ConnectionSettings contains Filters and Matching Rules for Grafana type ConnectionSettings struct { - FilterRules []MatchingRule `mapstructure:"exclude_filters" yaml:"exclude_filters,omitempty"` + FilterRules []MatchingRule `mapstructure:"filters" yaml:"filters,omitempty"` MatchingRules []RegexMatchesList `mapstructure:"credential_rules" yaml:"credential_rules,omitempty"` } diff --git a/website/content/docs/gdg/configuration.md b/website/content/docs/gdg/configuration.md index 8c787b5a..54cae01e 100644 --- a/website/content/docs/gdg/configuration.md +++ b/website/content/docs/gdg/configuration.md @@ -220,7 +220,7 @@ contexts: testing: output_path: test/data connections: - exclude_filters: + filters: - field: "name" regex: "Google Sheets" - field: "type" diff --git a/website/content/docs/releases/gdg_0.6.md b/website/content/docs/releases/gdg_0.6.md index 539bc929..f9a99996 100644 --- a/website/content/docs/releases/gdg_0.6.md +++ b/website/content/docs/releases/gdg_0.6.md @@ -12,8 +12,12 @@ toc: true Release Date: TBD + +### Breaking Changes + - [#289](https://github.com/esnet/gdg/issues/289)Config: Connection settings renamed `exclude_filters' to `filters` + ### Changes - - Enterprise config flag removed, future versions will programmatically determining version of grafana. + - Enterprise config flag removed, future versions will programmatically determine version of grafana. - [#283](https://github.com/esnet/gdg/issues/283) Fixing small bug with library connections - [#288](https://github.com/esnet/gdg/pull/288) Enterprise: Connection permission will require min. v10.2.3