-
Notifications
You must be signed in to change notification settings - Fork 3
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
SC-580: Implement "boot" config load #256
Conversation
81aee15
to
b53d394
Compare
I have factored out and expanded on the logic into the new The most complicated part is the This code doesn't touch the filesystem because I was investigating an alternative design which doesn't require splitting every page into its own file and keeps the live config format matching the external config format. I would appreciate a review of the general approach. Currently I'm integrating it into |
03ce188
to
8586142
Compare
Tidy up split.go & split_test.go. Remove dependency on github.com/stretchr/testify - this was only used in one file. Replace it with cmp, which is already widely used in the codebase.
This virtual filesystem package is only used in split_test.go. Reimplement MockFS using a temporary directory provided by the testing system. Explicitly create directories needed in tests.
9132d40
to
c6b0ea2
Compare
Implement the config loading flow at boot.
This should support loading config from a JSON file (as like the current behaviour) and integrate its changes into the authoritative configuratio.
The challenge is that the authoritative config can be changed at any time by the user (e.g. via the UI) and these changes will not be reflected in the manually written / generated external config files.
Therefore we need to detect what has changed between the current external config and the previous external config, and apply only these changes to the live config, taking care not to squash other unrelated changes. To do this properly we need to be aware of the structure of the config, in particular which values represent a single logical group.