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

Project manifest migration strategy update #1211

Closed
pileks opened this issue Sep 2, 2022 · 2 comments · Fixed by #1286
Closed

Project manifest migration strategy update #1211

pileks opened this issue Sep 2, 2022 · 2 comments · Fixed by #1286

Comments

@pileks
Copy link
Contributor

pileks commented Sep 2, 2022

We should probably rethink our manifest migration strategy. While we can have all of these options set as optional manifest properties, I'd say that we'll likely want to create a proper migration strategy sooner than later, as it will reduce future work.

Current migration strategy:

Auto-generated code requires us to implement certain, fixed migrators.

available manifests:
0.1.0
0.2.0
0.3.0
0.4.0

migrators/migration paths:
0.1.0 -> 0.4.0
0.2.0 -> 0.4.0
0.3.0 -> 0.4.0

After update to 0.5.0:
We need to update/create n+1 migrators if we want full migration support.

available manifests:
0.1.0
0.2.0
0.3.0
0.4.0
0.5.0

migrators/migration paths:
0.1.0 -> 0.5.0 #added/modified
0.2.0 -> 0.5.0 #added/modified
0.3.0 -> 0.5.0 #added/modified
0.4.0 -> 0.5.0 #added

Proposed migration strategy:

Allow developers to declare their own migrators, from whichever version to whichever other version.
A simple search algorithm would then find the appropriate migration path, and could even allow for downgrades if the correct migrator exists.

available manifests:
0.1.0
0.2.0
0.3.0
0.4.0

migrators:
0.1.0 -> 0.2.0
0.2.0 -> 0.3.0
0.3.0 -> 0.4.0
0.1.0 -> 0.3.0

migration paths to 0.4.0:
0.1.0 -> 0.2.0 -> 0.3.0 -> 0.4.0
0.1.0 -> 0.3.0 -> 0.4.0

After update to 0.5.0:

available manifests:
0.1.0
0.2.0
0.3.0
0.4.0
0.5.0

migrators:
0.1.0 -> 0.2.0
0.2.0 -> 0.3.0
0.3.0 -> 0.4.0
0.1.0 -> 0.3.0
0.4.0 -> 0.5.0 #added

migration paths to 0.4.0:
0.1.0 -> 0.2.0 -> 0.3.0 -> 0.4.0 -> 0.5.0
0.1.0 -> 0.3.0 -> 0.4.0 -> 0.5.0
@pileks pileks changed the title Manifest migration strategy update Project manifest migration strategy update Sep 5, 2022
@pileks
Copy link
Contributor Author

pileks commented Sep 5, 2022

Niraj: Look into Django migrations.

@pileks pileks added this to the origin-qa milestone Sep 5, 2022
@pileks pileks self-assigned this Sep 23, 2022
@krisbitney
Copy link
Contributor

krisbitney commented Sep 26, 2022

I think this is a good idea, but I think we should require the simplest complete path:

migrators:
0.1.0 -> 0.2.0
0.2.0 -> 0.3.0
0.3.0 -> 0.4.0

This ensures any migration can always happen, even when nobody adds a shorter path. Even though this is the longest path, the migrators are inexpensive and it won't be a practical issue.

I think you already had this in mind, but I thought I'd make it explicit just in case.

@pileks pileks modified the milestone: origin-qa Sep 26, 2022
@pileks pileks linked a pull request Sep 27, 2022 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants