-
Notifications
You must be signed in to change notification settings - Fork 192
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
Add export archive migration for Group
type strings
#3912
Add export archive migration for Group
type strings
#3912
Conversation
@CasperWA this PR is blocked because it depends on #3882 and #3903 need to be merged first. But I wanted to already open it to discuss it. We only have to look at the last commit. The migration is relatively simple, just updating the Question: is this sufficient, or do we need an update in the archives that are hosted in the external repository as well? |
84afa7d
to
cd60e0c
Compare
Codecov Report
@@ Coverage Diff @@
## develop #3912 +/- ##
========================================
Coverage 78.21% 78.22%
========================================
Files 460 461 +1
Lines 34036 34050 +14
========================================
+ Hits 26621 26635 +14
Misses 7415 7415
Continue to review full report at Codecov.
|
cdacd05
to
d290e5a
Compare
@CasperWA do you have an idea when you could give a look at this? Because this PR is blocking the release |
I can see what time I can spare over Easter and get it done. Otherwise it will not be until after, I'm afraid. |
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.
Cheers @sphuber.
An initial question:
- What changed in the
export_v0.X_simple.aiida
archives? They shouldn't change, I believe, right?
And then, let's go through the dedicated wiki-page.
There are 3 major steps:
-
Export/Import archive schema
For this I see no changes to the import/export config. So all good here. -
Archive migrations
This seems to also be all done. -
Tests
a. Export/Import tests for changes introduced to export/import
You may or may not choose to add a small test here (at
tests/tools/importexport/orm/test_groups.py
) making sure thetype_string
is as expected. Perhaps a quick look through the tests may also find that some may need updating?b. Archive migration tests
No PR has been made for the
aiida-export-migration-tests
repository in order to update it to v0.9, with all that it may entail.
Also, you should add atest_v0.8_to_newest
intests.tools.importexport.migration.text_migration:TestExportFileMigration
And finally, you're missing a test specifically for themigration_dbgroup_type_string
function.
Thanks a lot for the review @CasperWA , especially during this easter weekend.
As explained in the commit and OP:
So I indeed had to update them all because none of them contained any groups.
Ah yes, apologies, forgot that that existed.
This last part 3b was exactly what I was wondering. Since the changes are really minor (just a changing of the |
Cool, thanks! 👍
You can definitely argue that it's overkill. In any case, I have created a PR in the external repo that you can go through. Concerning the updated archive, I have only changed the |
You should update to |
d290e5a
to
ff320a9
Compare
/update-requirements |
Starting 'update-requirements' workflow for this branch. |
ff320a9
to
b5ad5bb
Compare
@CasperWA this is ready for review |
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.
Much more streamlined now it seems. Cool, thanks @sphuber.
Only a single comment/consideration.
Edit: Also, you may want to make a test under tests/tools/importexport/orm/test_groups.py
to make sure the type_strings
are correct in the created data.json
file.
Again, this is in line with my comment here, and may be overkill and a bit too specific a test?
I don't think really understand why you think there should be a test of the migration function in the |
b5ad5bb
to
eb3d01c
Compare
It is in the importexport |
I see, except this code has not been touched nor changed, so don't think we should add a test |
@CasperWA this is ready for review |
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.
Thanks for the extra test @sphuber !
It said the export_v0.9_simple.aiida
also changed in the latest commit, did you add or change something?
In any case, I'll approve this PR in its current state. The extra and extremely specific test under importexport/orm/test_groups.py
that we have discussed is still open for you to do, but I do not consider it essential, as we should already have simple tests that makes sure we can export and import Group
s, which is enough for me, and can be argued is enough for making sure the type_string
s are valid, right?
No, it is very implicit indeed. I've accepted the PR on the basis of the current changes, but left this open for you to decide upon yourself. I consider it good enough. |
Thanks for the review @CasperWA . I hold off a bit with merging still because technically the tests failed, but that is due to a non-related issue. The
The |
The `Group` entity class is now subclassable, for which the type string of existing entries in the database had to be changed through a migration. Here we add the corresponding migration for existing export archives. The only required change is to map the type string of groups. To test this migration we use the existing export archives in the module `tests/fixtures/export/migrate`. They did not contain any group entities so `export_v0.1_simple.aiida` was updated first and had four groups added, one for each of the migrated type strings. This initial archive was then migrated to each subsequent version, step by step, using the command `verdi export migrate --version`. Also fixed and migrated `tests/fixtures/graphs/graph1.aiida` which was corrupt and could not be migrated automatically, because it contained a process node with an active process state.
eb3d01c
to
08e5310
Compare
This was my understanding and thought as well, concerning the "overkill". Great to have it confirmed. |
Fixes #3908
The
Group
entity class is now subclassable, for which the type stringof existing entries in the database had to be changed through a
migration. Here we add the corresponding migration for existing export
archives. The only required change is to map the type string of groups.
To test this migration we use the existing export archives in the module
tests/fixtures/export/migrate
. They did not contain any group entitiesso
export_v0.1_simple.aiida
was updated first and had four groupsadded, one for each of the migrated type strings. This initial archive
was then migrated to each subsequent version, step by step, using the
command
verdi export migrate --version
.