Skip to content
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

Merged
merged 3 commits into from Dec 16, 2022
Merged

feat: deprecate ui enabled #1227

merged 3 commits into from Dec 16, 2022

Conversation

markphelps
Copy link
Collaborator

@markphelps markphelps commented Dec 15, 2022

Re: FLI-125

  • Refactors config parsing to separate out Warnings from the Config itself, making it easier to write tests against config parsing

  • Deprecates ui.enabled as in the future we will have 2 versions of Flipt:

  1. Current version where UI is always enable
  2. Headless version which is API only

@pull-request-size pull-request-size bot added size/L and removed size/M labels Dec 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Dec 15, 2022

Codecov Report

Merging #1227 (3c44f75) into main (931b5f2) will increase coverage by 0.11%.
The diff coverage is 95.83%.

@@            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     
Impacted Files Coverage Δ
internal/config/config.go 81.45% <89.65%> (-0.85%) ⬇️
internal/config/authentication.go 88.37% <100.00%> (-0.52%) ⬇️
internal/config/cache.go 100.00% <100.00%> (ø)
internal/config/cors.go 100.00% <100.00%> (ø)
internal/config/database.go 100.00% <100.00%> (ø)
internal/config/deprecations.go 100.00% <100.00%> (ø)
internal/config/log.go 100.00% <100.00%> (ø)
internal/config/meta.go 100.00% <100.00%> (ø)
internal/config/server.go 100.00% <100.00%> (ø)
internal/config/tracing.go 100.00% <100.00%> (ø)
... and 5 more

📣 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"`
Copy link
Collaborator Author

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:

  1. We could just remove it since it isn't documented anywhere
  2. Or we could figure out another way to add these Warnings back in before marshalling the config as JSON

Copy link
Contributor

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.

@markphelps markphelps marked this pull request as ready for review December 15, 2022 17:04
@markphelps markphelps requested a review from a team as a code owner December 15, 2022 17:04
@markphelps markphelps changed the title chore(wip): deprecate ui enabled feat: deprecate ui enabled Dec 15, 2022
@@ -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") {
Copy link
Collaborator Author

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{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor

@GeorgeMac GeorgeMac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 💪

@markphelps markphelps merged commit 756f00f into main Dec 16, 2022
@markphelps markphelps deleted the deprecate-ui branch December 16, 2022 15:22
markphelps added a commit that referenced this pull request Dec 16, 2022
* main:
  feat: deprecate ui enabled (#1227)
  chore: move migrator back to main so we dont need it in grpc server (#1224)
  chore: refactor deprecations checking to own method (#1226)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants