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

Modularize config factory #8505

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Modularize config factory #8505

wants to merge 9 commits into from

Conversation

N-o-Z
Copy link
Member

@N-o-Z N-o-Z commented Jan 15, 2025

Closes #8497

Change Description

Extract config creation into a factory module

@N-o-Z N-o-Z added the exclude-changelog PR description should not be included in next release changelog label Jan 15, 2025
@N-o-Z N-o-Z self-assigned this Jan 15, 2025
@N-o-Z N-o-Z force-pushed the task/modularize-config-8497 branch 5 times, most recently from ecd2356 to 4b3f9e4 Compare January 15, 2025 23:40
Copy link

E2E Test Results - DynamoDB Local - Local Block Adapter

13 passed

Copy link

github-actions bot commented Jan 15, 2025

E2E Test Results - Quickstart

11 passed

@N-o-Z N-o-Z force-pushed the task/modularize-config-8497 branch from 4b3f9e4 to 22ece2d Compare January 16, 2025 00:10
@N-o-Z N-o-Z force-pushed the task/modularize-config-8497 branch from 22ece2d to f8071bc Compare January 16, 2025 00:20
@N-o-Z N-o-Z requested a review from a team January 16, 2025 01:26
@N-o-Z N-o-Z marked this pull request as ready for review January 16, 2025 01:26
Copy link
Contributor

@itaigilo itaigilo left a 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?

@@ -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
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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"? 🙏

} `mapstructure:"gs"`
}

type Interface interface {
Copy link
Contributor

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?

Copy link
Member Author

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 😆 )

Copy link
Contributor

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.

return newConfig(cfgType)
}

func newConfig(cfgType string) (*config.Config, error) {
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not needed

return nil, err
}

// OSS specific validation
Copy link
Contributor

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.

@N-o-Z N-o-Z requested a review from itaigilo January 17, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude-changelog PR description should not be included in next release changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Config factory as go module
2 participants