Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Document the config merge strategy #3136

Open
HarHarLinks opened this issue Aug 23, 2024 · 3 comments
Open

Document the config merge strategy #3136

HarHarLinks opened this issue Aug 23, 2024 · 3 comments
Labels
A-Configuration Related on what is configurable and how it can be configured

Comments

@HarHarLinks
Copy link

To help understand what the resulting configuration looks like after merging all the configuration files, the [`config dump`](../reference/cli/config.md#config-dump) command can be used:

but it's not explained how configs get merged in theory. will values from second.yaml overwrite those in first.yaml or reverse? or is it illegal to try this?

@sandhose
Copy link
Member

We're using figment under the hood, with the merge strategy, meaning that later values are generally preferred. Not sure whether this is the right approach or not; it may make more sense to switch to the adjoin strategy, where the first config files take precedence, and arrays get merged?

https://docs.rs/figment/latest/figment/struct.Figment.html#conflict-resolution

@sandhose sandhose added the A-Configuration Related on what is configurable and how it can be configured label Aug 30, 2024
@HarHarLinks
Copy link
Author

merge strategy meets what I would have guessed but could not be sure. Whether you decide to change it or not, this issue is about documenting your approach so that the reader may create their config appropriately.

@matrixbot
Copy link
Member

For your information, this issue has been copied over to the Element fork of matrix-authentication-service: element-hq/matrix-authentication-service#3136

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Configuration Related on what is configurable and how it can be configured
Projects
None yet
Development

No branches or pull requests

3 participants