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
Warn users to migrate when old schema is detected and enable migration CLI #816
Conversation
Codecov Report
@@ Coverage Diff @@
## master #816 +/- ##
==========================================
+ Coverage 85.62% 85.75% +0.12%
==========================================
Files 51 51
Lines 4641 4683 +42
Branches 917 923 +6
==========================================
+ Hits 3974 4016 +42
+ Misses 481 480 -1
- Partials 186 187 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
I haven't tested this locally but I'm happy with the code in this PR! I'll test it with v1 projects on the next
branch sometime in the near future.
I'll hold off on merging to let you try a test or two in case you catch bugs that I missed in my testing. |
|
||
try: | ||
schema_version = _get_config_schema_version(root, schema_version) | ||
assert schema_version != int(SCHEMA_VERSION), ( |
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.
Maybe an if
is better here? This is one of those nit picky things but since assert
isn't ran with -O
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.
Well, I sort of did that intentionally since this indicates developer error somewhere. This is really intended to be something more like a debug print. I can remove it or change to an if statement if you'd prefer though.
@vyasr Maybe we should wait until I rebase |
Yes that was my plan. I was also hoping to get one or two additional testers aside from myself, but I think once the rebase is done if nobody has done additional testing at that point we can just go ahead and merge this and let people test it on the main branch. |
fbf1225
to
bc8f15a
Compare
@bdice @mikemhenry if one of you would like to test this locally that would be great, otherwise I think we can go ahead and just merge this. |
I'm going to go ahead and merge this. People can test it out on the master branch. |
Description
This PR adds a check in project initialization to ensure that projects with old schemas are detected when signac fails to find a project with the current schema. The resulting check provides the user a meaningful error about how to proceed with updating their schema using our migration code. This PR also exposes a CLI for migration to complement the Python interface, providing a simpler and friendlier approach to one-off migration that is recommended by the error.
Motivation and Context
Necessary to for projects how to migrate to v2.
Checklist: