-
Notifications
You must be signed in to change notification settings - Fork 72
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
config 1.0 backend #1247
config 1.0 backend #1247
Conversation
Right now the biggest issue I'm running into is how "random" it is that something is a global setting or not, and the fact that a global setting vs a package-local setting requires a bunch of duplicated definitions/logic. I tried to do a cheeky split of "only ci config is global" but a lot of not-actually-ci-config is defacto-ci-config like github releases or build dependencies. I'm going to try to do the package-local settings first to see if they're easier to migrate. |
This design is based entirely on the config overhaul i did in oranda last year, and it also had a last-step freeform system for Complex Defaults: My main annoyance here is that "defaults last" means some things have to be Options in the final config (or we add a 4th fucking copy of every struct ;-;). In practice a few extra options you have to unwrap is..... Probably Fine. |
This doc-comment in oranda is quite informative about the basic idea of the design: https://github.com/axodotdev/oranda/blob/0044504916cfbeaf5a830d8703828a81375b3362/src/config/mod.rs#L1 What this design adds is an extra "Inheritable" thing between Config and Layer to represent the delayed application of inherited values like This results in there being 4 possible values any given setting can come from, which need to apply in this exact preference order
you need the accursed middle struct to handle cases like
(cargo is enabled within a package, but doesn't specify its prerelease preferences, so the prerelease setting needs to be inherited from the workspace all-publishes setting. The |
b0503fd
to
0fd29a2
Compare
half of #841 (see that for high level design docs)
[ ] toml serialization (the codeinit
does with toml-edit)[ ] expose v1 config to end-users(probably not in this PR)[ ] read either v0 or v1 in, branching on which it is[ ] create v1 with init[ ] auto-translate v0 to v1 in init