Skip to content

feature: config file versioning and migrations #177

@madebydavid

Description

@madebydavid

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 migrate method 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions