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

fix: Using correct default number as config version. #1305

Merged
merged 2 commits into from
Sep 22, 2022
Merged

fix: Using correct default number as config version. #1305

merged 2 commits into from
Sep 22, 2022

Conversation

buhtz
Copy link
Member

@buhtz buhtz commented Sep 22, 2022

Because of the value of config.Config.CONFIG_VERSION the current version of the config files used by the latest stable BIT release is 6.

This fix take care that this number is used by default for (empty) config files that don't specify config.version by their own.
This problem was introduced by a commit in the year 2016.

In the wild with normal users this touch only some edge cases. But it is highly relevant for unittesting where some of tests do use empty config files.

This PR also solves a problem and the need for an associated workaround encountered by @aryoda. The problem here was that in some cases (e.g. when running TravisCI) a message appeared on stdout that informed about the automatic conversion of the config file from version 5 to 6. That pollutes the json output of --diagnostics. I will modify that specific unittest later in the context of my "Config-as-singleton" PR I am preparing.

Just another sitenote: This points to another "problem" when using --diagnostics. In that case the log level should be set to "warnings" so that "info" messages can not pollute the json output. But the BIT's own logger module doesn't provide that. We could only use some "hacks" via the low-level module syslog. The whole logger module should be replaced in the feature by Pythons own logging module. But I won't touch it yet and it seems not to be so urgent. :)

Because of the value of "config.Config.CONFIG_VERSION" the current
version of the config files used by the latest stable BIT release is 6.
This fix take care that this number is used by default for (empty)
config files that don't specificy "config.version" by their own.

In the wild with normal users this touch only some edge cases. But it is
highly relevant for unittesting where some of tests do use empty config
files.
@emtiu emtiu merged commit ff34418 into bit-team:master Sep 22, 2022
@buhtz buhtz deleted the fix/configversion branch September 22, 2022 19:37
@aryoda
Copy link
Contributor

aryoda commented Sep 24, 2022

Well done!

Shall I remove my workaround via new PR now?

https://github.com/bit-team/backintime/blob/master/common/test/test_backintime.py#L180

@buhtz
Copy link
Member Author

buhtz commented Sep 25, 2022

Shall I remove my workaround via new PR now?

No need. There is another PR (not yet merged) handling this.
#1307

After it is merged you can take a look if something can be improved.

emtiu pushed a commit that referenced this pull request Oct 3, 2022
* Integrate extended diagnostics (#1300 with #1295)
* Add user-callback path to collect_diagnostics()
* Remove TravisCI test failure workaround (was fixed with #1305).
* Correct some typos in comments
* Diagnostics: Add local and global config file info. Rename "config-version" to "latest-config-version"

by @aryoda and @buhtzz
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.

3 participants