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

Manifest migration strategy update #1286

Merged
merged 4 commits into from
Oct 4, 2022

Conversation

pileks
Copy link
Contributor

@pileks pileks commented Sep 27, 2022

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:

  • The 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.

@pileks pileks linked an issue Sep 27, 2022 that may be closed by this pull request
cbrzn
cbrzn previously approved these changes Sep 30, 2022
Copy link
Contributor

@cbrzn cbrzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@krisbitney
Copy link
Contributor

Amazing work 🔥. This will be really helpful. Much better than the whole "exponentially increasing number of migrator implementations" situation!

@krisbitney
Copy link
Contributor

P.S. the --format option for the manifest command is a cool idea. I think it will sense to have it as we grow and get more users and publish more versions. People will be working with versions of Polywrap.

@pileks pileks merged commit 8170abe into origin-dev Oct 4, 2022
@pileks pileks deleted the pileks/manifest-migration-strategy-update branch October 4, 2022 10:25
@pileks pileks linked an issue Oct 4, 2022 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Project manifest migration strategy update
4 participants