-
Notifications
You must be signed in to change notification settings - Fork 362
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
Modularize config factory #8505
base: master
Are you sure you want to change the base?
Conversation
ecd2356
to
4b3f9e4
Compare
4b3f9e4
to
22ece2d
Compare
22ece2d
to
f8071bc
Compare
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.
Really nice work, in a very tricky area. Well done.
Is there a way to move the Blockstore
part of BaseConfig
into `StorageConfig1?
Or will this make the parsing of the config problematic?
cmd/lakefs/cmd/root.go
Outdated
@@ -52,6 +53,8 @@ func init() { | |||
rootCmd.PersistentFlags().Bool(config.QuickstartConfiguration, false, "Use lakeFS quickstart configuration") | |||
} | |||
|
|||
// TODO (niro): All this validation logic should be in the OSS config package |
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.
When should this happen?
Is there an Issue for it?
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.
It's not something that is blocking us from continuing work. This is something we should do to cleanup the code a little.
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.
Can you please change the comment to not refer to "OSS"? 🙏
pkg/config/config.go
Outdated
} `mapstructure:"gs"` | ||
} | ||
|
||
type Interface interface { |
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 is quite confusing.
Can you rename Config
to BaseConfig
, and Interface
to Config
?
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.
The renaming of Config will create a lot of unnecessary changes in the code I'd like to avoid.
If you think we should renaming it still let me know (since you'll be the one needing to deal with the headache of reviewing it 😆 )
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 assumed this is the reason.
I'd be happy to review such change -
It will only mess this single PR, and will make our code more readable.
modules/config/factory/build.go
Outdated
return newConfig(cfgType) | ||
} | ||
|
||
func newConfig(cfgType string) (*config.Config, error) { |
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.
Kind of nit, but -
Why this func is needed?
Why this isn't the code of BuildConfig
?
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.
Not needed
modules/config/factory/build.go
Outdated
return nil, err | ||
} | ||
|
||
// OSS specific validation |
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 don't think we should have such "OSS" references in the code.
Maybe something like "mandatory validation", or "basic validation" -
Otherwise this comment will only confuse maintainers.
…fig-8497 # Conflicts: # pkg/config/config_test.go
Closes #8497
Change Description
Extract config creation into a factory module