Improve configuration validation
GentlemanHal opened this issue · 1 comments
GentlemanHal commented
We currently have a json schema that is used to validate configuration. This performs simple checks on the structure, making sure certain keys exist for example. However it doesn't perform any semantic validation.
Some semantic validations we could perform:
- Check
trays
key match thetrayId
in the object -
Checkprojects
keys match a knowntrayId
- Check
projects
key match thetrayId
in the object -
Checkselected
keys match a knowntrayId
-
Checkselected
array matches knownprojectId
- Check
backupRemoteLocations
key match theinternalId
in the object (once #271 is done)
Note: if #301 is done before this improvement some of the keys about trays may have been renamed.
GentlemanHal commented
Turns out we can't always check projects and selected match known tray IDs as it's possible to partially import any subset of the state (this is on purpose so we don't have to write migrations for every change to state).
In theory we could check these things IF the trays key was also present, but that seems like overkill for now.