-
Notifications
You must be signed in to change notification settings - Fork 268
refactor!: Demonstrator: New config management class (and some more stuff) #1850
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
Draft
buhtz
wants to merge
101
commits into
bit-team:dev
Choose a base branch
from
buhtz:konfig
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
daviewales
reviewed
Aug 29, 2024
Contributor
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.
Hi @buhtz, I've had a look over this.
I don't have any big suggestions, but I commented on a few small things.
There are a few style tweaks (particularly the suggestion for create-manpage at the end), so let me know if you'd prefer not to get these kind of style comments.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Blocked by
That PR is intended to get merged but also it is more a demonstrator instead of a modification to the current BIT behavior. The code technically is not "connected" to regular BIT and merging it won't change BIT behavior.
The objective was to replace the configuration management logic currently realized in the
Configclass. The current implementation is inefficient and blown up. Additionally that class does a lot more then just managing the configuration.The PR demonstrate the new solution. Some details are not finished and need to be solved. But I would like to discuss the approach as early as possible before finishing it.
__main__incommon/konfig.pyfile for a short example.Konfigas name for the new class because of lack of a better alternative. I am open for suggestions. On a long run we will "delete" the wholeConfigclass with separating its behavior in several other classes. Once whenConfigis gone we can renameKonfigintoConfig.configparsernow is used to read and write the config file. Because that package reads INI-like files I used a little trick because BIT's config file is not an INI file. After reading the raw file into memory I simply add[BIT]before the first line and then read it withconfigparser.Profileinternally dealing withKonfig.backintime-config (1)man page still is done with a script. The script does not parse the konfig.py file anymore but useinspectto extract the relevant information (from public properties with docstrings).How to integrate it into BIT? Not in this PR but later. I would use
Configin a wrapper-like manner usingKonfiginternally. This is a lot of extra work. But this step would make it smooth and less-risky transforming the codebase into usingKonfig. And also the needed PRs can be smaller. This way we can carefully decouple the codebase step by step from theConfigclass monolith.Side note to myself
ConfigParsercan't handle lines like this:Problem is solved.