-
Notifications
You must be signed in to change notification settings - Fork 36
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
Refactor TreeRankRecord
to allow null tree id
#6322
Conversation
TODO: Need to handle old datasets with 'incorrect' upload plans |
treeId
in upload plan for all treesTreeRankRecord
to allow null tree id
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.
A gist of the relevant changes since the PR refactors a lot of things
specifyweb/frontend/js_src/lib/components/WbPlanView/uploadPlanBuilder.ts
Show resolved
Hide resolved
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.
-
Enter data, verify upload and rollback
-
Enter data in all/some ranks, verify upload and rollback
- Ensure the entire 'path' gets uploaded correctly
-
Repeat above steps with a non Taxon base table (Geography, Storage, geo/paleo trees)
-
Enter data, verify upload and rollback
-
Enter data in all/some ranks, verify upload and rollback
- Ensure the entire 'path' gets uploaded/matched correctly
-
Add a Taxon tree to the db and repeat all above steps
-
Enter data in all/some ranks, verify upload and rollback
-
Verify there is a validation error when a COType does not belong to the same tree as the Taxon rank
- Verify there is a validation error for Multiple tree definitions in row
-
Re-run tests on datasets that were created before
7.10.1
(saiab_2025_03_12
has some old datasets that can be used)
All trees except for taxon are being unmapped after save
03-18_08.54.mp4
https://ojsmnh20250314-issue-6321.test.specifysystems.org/specify/workbench/plan/132/
Triggered by df533d9 on branch refs/heads/issue-6321
@emenslin Should be fixed now |
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.
-
Enter data, verify upload and rollback
-
Enter data in all/some ranks, verify upload and rollback
- Ensure the entire 'path' gets uploaded correctly
-
Repeat above steps with a non Taxon base table (Geography, Storage, geo/paleo trees)
-
Enter data, verify upload and rollback
-
Enter data in all/some ranks, verify upload and rollback
- Ensure the entire 'path' gets uploaded/matched correctly
-
Add a Taxon tree to the db and repeat all above steps
-
Enter data in all/some ranks, verify upload and rollback
-
Verify there is a validation error when a COType does not belong to the same tree as the Taxon rank
- Verify there is a validation error for Multiple tree definitions in row
-
Re-run tests on datasets that were created before
7.10.1
(saiab_2025_03_12
has some old datasets that can be used)
Looks good now, no trees are getting unmapped!
Triggered by 9021a58 on branch refs/heads/issue-6321
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.
Tests with single Taxon tree in the db
- Enter data, verify upload and rollback (Taxon)
- Enter data in all/some ranks, verify upload and rollback (Taxon)
- Ensure the entire 'path' gets uploaded correctly (Taxon)
- Repeat above steps with a non Taxon base table (Geography, Storage, geo/paleo trees)
- Enter data, verify upload and rollback (CO)
- Enter data in all/some ranks, verify upload and rollback (CO)
- Ensure the entire 'path' gets uploaded/matched correctly (CO)
Tests with multiple Taxon trees in the db
- Add a Taxon tree to the db and repeat all above steps
- Enter data in all/some ranks, verify upload and rollback (w/ COType)
- Verify there is a validation error when a COType does not belong to the same tree as the Taxon rank
- Verify there is a validation error for Multiple tree definitions in row
Test old datasets
- Re-run tests on datasets that were created before
7.10.1
(saiab_2025_03_12
has some old datasets that can be used)
Didn't run into any major issues, the errors were showing up when they should. Good work!
specifyweb/frontend/js_src/lib/components/WbPlanView/uploadPlanBuilder.ts
Show resolved
Hide resolved
Triggered by 6fe3d45 on branch refs/heads/issue-6321
Fixes #6321
The cause for the bug was that
TreeRankRecord
always expected a treeId and in cases where no treeId was found it would determine the treedef to upload to in a very arbitrary wayspecify7/specifyweb/workbench/upload/treerecord.py
Lines 124 to 133 in 166bad8
After this PR,
TreeRankRecord
will allow a null treeid and upload will default to the collection's default treedef after theTreeRecord
has been scoped. Additionally, the frontend will pass a treeid for all tree tables and not just for Taxon.The PR should handle all the following cases:
7.10
and before7.10.2
would have faced this issue only for non-Taxon trees but this PR will ensure uploads happen to the default tree of the collection7.10
that don't useTreeRankRecord
in the upload plan will also have nodes uploaded to the default treeChecklist
self-explanatory (or properly documented)
Testing instructions
Tests with single Taxon tree in the db
Create a WB dataset with Taxon base table
Map a single rank to a column
Enter data, verify upload and rollback
Map multiple ranks in the same dataset
Enter data in all/some ranks, verify upload and rollback
Repeat above steps with a non Taxon base table (Geography, Storage, geo/paleo trees)
Create a WB dataset with CollectionObject base table
Map a column to Taxon and to a non-Taxon table in the same dataset
CO -> Determination -> Taxon
andCO -> CE -> Locality -> Geography
Enter data, verify upload and rollback
Use multiple ranks in the dataset for all trees
Enter data in all/some ranks, verify upload and rollback
North and Central America -> United States -> South Carolina -> Dorchester
already exists in the Geography tree and doesn't get highlightedTests with multiple Taxon trees in the db
Test old datasets
7.10.1
(saiab_2025_03_12
has some old datasets that can be used)