Skip to content

Manifest migration strategy update#1286

Merged
pileks merged 4 commits intoorigin-devfrom
pileks/manifest-migration-strategy-update
Oct 4, 2022
Merged

Manifest migration strategy update#1286
pileks merged 4 commits intoorigin-devfrom
pileks/manifest-migration-strategy-update

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