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

Smarter, less strict, config generator #227

Merged
merged 2 commits into from
Jul 17, 2019
Merged

Conversation

yajo
Copy link
Contributor

@yajo yajo commented Jul 8, 2019

Before Odoo v11, Odoo wasn't so strict when reading configuration. Since v11, where Python 3 started to be used, it used the new default strict=True mode to read configuration files.

The strict mode forbids section and option repetitions. Although that seems legit for most apps (even Odoo itself), in Doodba we provide a set of predefined defaults that downstream scaffoldings should be able to override.

To allow such behavior, now the script that generates the final config will do it in strict=False mode, but will remove duplicates and just use the latest option defined, effectively producing a strict config file out of a collection of non-strict configs.

Of course, options until now are respected, like output of result while in LOG_LEVEL=DEBUG or env variable substitution.

Full power! 💪

@yajo yajo self-assigned this Jul 8, 2019
bin/config-generate Outdated Show resolved Hide resolved
@yajo yajo force-pushed the config-generate-smarter branch 4 times, most recently from 00fd069 to 25e21c4 Compare July 11, 2019 13:01
Before Odoo v11, Odoo wasn't so strict when reading configuration. Since v11, where Python 3 started to be used, it used the new default `strict=True` mode to read configuration files.

The strict mode forbids section and option repetitions. Although that seems legit for most apps (even Odoo itself), in Doodba we provide a set of predefined defaults that downstream scaffoldings should be able to override.

To allow such behavior, now the script that generates the final config will do it in `strict=False` mode, but will remove duplicates and just use the latest option defined, effectively producing a strict config file out of a collection of non-strict configs.

Of course, options until now are respected, like output of result while in `LOG_LEVEL=DEBUG` or env variable substitution.

Full power! 💪
@yajo yajo merged commit e00e55c into master Jul 17, 2019
@yajo yajo deleted the config-generate-smarter branch July 17, 2019 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants