Skip to content
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

create a migration story for new versions of type "Config" and "State" #117

Open
5 tasks
aybabtme opened this issue Nov 3, 2024 · 0 comments
Open
5 tasks

Comments

@aybabtme
Copy link
Collaborator

aybabtme commented Nov 3, 2024

Both the Config and State types have a Version int field in them so that when decoding a config or state object, I can know if they were encoded first with an older version of the config.

This is a stop-gap solution to make it merely possible to handle a breaking change in the layout of these types, but it doesn't provide a solution for doing breaking changes to these types and writing migrations/remedies for upgrading old Config/State values to new versions.

So we need to make a mechanism to (for both State and Config, using only Config as an example here):

  • make it possible to decode Config values from any previous version
  • migrate a Config version v-1 to a version v (à la go fix), prompting for user input if necessary (see the huh package)
  • create a pipeline that can take any Config at version v-n and bring it to version v (prompting for user input if necessary)
  • this should all be testable and tested
  • it should be easy to write new migrations for breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant