-
Notifications
You must be signed in to change notification settings - Fork 52
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
Manifest migration strategy update #1286
Conversation
…another. Optimal migration path detection
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
packages/js/manifests/polywrap/src/migrations/findShortestMigrationPath.ts
Show resolved
Hide resolved
Amazing work 🔥. This will be really helpful. Much better than the whole "exponentially increasing number of migrator implementations" situation! |
P.S. the |
Closes #1211
This PR introduces a developer-defined collection of Migrators, which are simple objects that describe migrations from one version of a manifest format to another.
Now, devs can define both up and down migrations, and adding a new version of a certain manifest will require writing only one migration.
Small implementation detail:
Under the assumption that all migrations have the same "level of complexity", a simple "migration graph" is traversed using BFS and the shortest migration path is returned (or
undefined
if none is found). See issue #1211 for examples.Possible future work:
polywrap manifest migrate
CLI command could now have an additional optional parameter-f, --format
wherein the user could specify to which format they want to migrate, the default being the latest format. Create an issue if people agree.