New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: deprecate ui enabled #1227
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1227 +/- ##
==========================================
+ Coverage 79.89% 80.00% +0.11%
==========================================
Files 38 39 +1
Lines 2805 2831 +26
==========================================
+ Hits 2241 2265 +24
- Misses 460 461 +1
- Partials 104 105 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -45,10 +44,14 @@ type Config struct { | |||
Database DatabaseConfig `json:"db,omitempty" mapstructure:"db"` | |||
Meta MetaConfig `json:"meta,omitempty" mapstructure:"meta"` | |||
Authentication AuthenticationConfig `json:"authentication,omitempty" mapstructure:"authentication"` | |||
Warnings []string `json:"warnings,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does however have the side effect that Warnings
will no longer be returned in the JSON output when hitting /meta/config
endpoint..
Two thoughts here:
- We could just remove it since it isn't documented anywhere
- Or we could figure out another way to add these
Warnings
back in before marshalling the config as JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would lean on dropping them from that endpoint and letting warnings be logs only.
We probably could get away with it. Those warnings are meant to be ephemeral over time as you fix your config.
I wouldn't expect anything to be depending on their context for something behavioural.
@@ -52,15 +52,15 @@ func (c *CacheConfig) setDefaults(v *viper.Viper) { | |||
func (c *CacheConfig) deprecations(v *viper.Viper) []deprecation { | |||
var deprecations []deprecation | |||
|
|||
if v.GetBool("cache.memory.enabled") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was only being evaluated if cache.memory.enabled
was set to true
deprecations = append(deprecations, deprecation{ | ||
|
||
option: "cache.memory.enabled", | ||
additionalMessage: deprecatedMsgMemoryEnabled, | ||
}) | ||
} | ||
|
||
if v.IsSet("cache.memory.expiration") { | ||
if v.InConfig("cache.memory.expiration") { | ||
deprecations = append(deprecations, deprecation{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 💪
Re: FLI-125
Refactors config parsing to separate out
Warnings
from theConfig
itself, making it easier to write tests against config parsingDeprecates
ui.enabled
as in the future we will have 2 versions of Flipt: