signac
signac copied to clipboard
Warn users to migrate when old schema is detected and enable migration CLI
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:
- [x] I am familiar with the Contributing Guidelines.
- [x] I agree with the terms of the Contributor Agreement.
- [x] My name is on the list of contributors.
- [x] The changes introduced by this pull request are covered by existing or newly introduced tests.
- [x] The package documentation and framework documentation in signac-docs are up to date with these changes.
- [x] I have updated the changelog and added any related issue and pull request numbers for future reference.
Codecov Report
Merging #816 (a87e785) into master (9aa65c0) will increase coverage by
0.12%. The diff coverage is88.63%.
@@ 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
| Impacted Files | Coverage Δ | |
|---|---|---|
| signac/__main__.py | 77.79% <68.75%> (-0.22%) |
:arrow_down: |
| signac/common/config.py | 87.67% <100.00%> (+4.33%) |
:arrow_up: |
| signac/contrib/migration/v0_to_v1.py | 86.66% <100.00%> (+3.33%) |
:arrow_up: |
| signac/contrib/migration/v1_to_v2.py | 90.00% <100.00%> (+0.81%) |
:arrow_up: |
| signac/contrib/project.py | 89.84% <100.00%> (+0.19%) |
:arrow_up: |
| signac/contrib/migration/__init__.py | 93.10% <0.00%> (+6.89%) |
:arrow_up: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
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
nextbranch 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.
@vyasr Maybe we should wait until I rebase next and then rebase this PR?
@vyasr Maybe we should wait until I rebase
nextand then rebase this PR?
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.
@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.