post
post copied to clipboard
Introduce PoST data versioning
Description
Some recent updates to PoST required changes to postdata_metadata.json
file. Fortunately these changes were full backwards compatible such that implementing them didn't pose a big challenge.
In the future we will probably require updates to PoST that are not fully backwards compatible and may require migration of existing data to be used with newer versions. The goal of this issue is to lay the foundations of making this happen.
Acceptance criteria
- Add version information to
postdata_metadata.json
. Assume version 0 (the state of PoST as it is used in v0.8.11) if not present. - When accessing a PoST directory parse that version information and return an error if the found version doesn't match the expected version.
- Add functions that allow migration from a previous version of PoST to the current version.
Implementation hints
- Consider making changes to
postdata_metadata.json
atomically when updating the file.