-
Notifications
You must be signed in to change notification settings - Fork 1
feature: config file versioning and migrations #177
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Background
This is related to discussion which came from #137
Occasionally we have to modify the structure of the shipthis.json file to adapt for new features or adjustments to resolve issues.
When doing this, it would be nice if we had a system in place to upgrade the config data structure and resave the file.
Proposal
- Adjust the shipthis.json schema to include a version number (possibly just an integer)
- Formalize the schema versions including validation of the config
- Create a set of versioned migrations with "up" and "down" methods
- The migrations will need be applied in order so we should create a
migratemethod which loops through them - Decide on when the tool should do this (at boot - before any commands, first time we read from the config file, before any game related commands)
TODO
- Check if there are some libraries which can do the validation / migration for us
- Decide when this will become relevant - is it at the next time that we need to edit the schema?
References / Reading
- An Approach to JavaScript Object Schema Migration by
Nick Scialli - https://levelup.gitconnected.com/an-approach-to-javascript-object-schema-migration-ae1bd9f0ce78
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request