BI-1855 - Create germplasm list not working#281
Conversation
mlm483
left a comment
There was a problem hiding this comment.
Getting a NullPointerException. To reproduce, try to upload the attached germplasm file. It works on develop but on bug/BI-1855-tep46 I get a NullPointerException during the "Upload and Validate" process.
|
Passed Developer testing! senario 1: has existing pedigree and file pedigree is different and not empty. senario 2: no existing pedigree and file different pedigree. senario 3: existing pedigree and file pedigree samee. senario 4: existing pedigree and file pedigree empty. |
davedrp
left a comment
There was a problem hiding this comment.
The code and logic seem great to me. I left some comments on minor cosmetic changes.
src/main/java/org/breedinginsight/brapps/importer/model/base/Germplasm.java
Outdated
Show resolved
Hide resolved
src/main/java/org/breedinginsight/brapps/importer/services/processors/GermplasmProcessor.java
Outdated
Show resolved
Hide resolved
Pushed a fix for this |
mlm483
left a comment
There was a problem hiding this comment.
Thanks for the test files, super helpful!
The file 3_new list-wrongped - fail.xls is expected to produce an error, but I noticed it says "See details below" when there are no details to be seen below. Possibly out of scope, but I recommend either (1) providing details in this error case or (2) if it's truly exceptional, removing "See details below". Could make a new story.
FWIW I'm seeing "The following parental GIDs were not found in the database: 5, 6, 7, 8." being sent from the server, so it might be as simple as showing that message on the frontend.
Here's the story I created to refactor processGermplasmForDisplay, BI-1881.
Assuming the missingParentalDbIds and missingDbIds business is sorted out and you feel good about it, I'm OK to merge.
| // TODO: hack for now, probably should update breedbase | ||
| // Breedbase will return NA/NA for no pedigree or NA/father, mother/NA | ||
| // strip NAs before saving RAW_PEDIGREE, if there was a germplasm with name NA it would be in format NA [program key] | ||
| // so that case should be ok if we just strip NA/NA, NA/, or /NA<\0> | ||
| private String processBreedbasePedigree(String pedigree) { |
There was a problem hiding this comment.
Is there a story for the change to BreedBase? I think that story should have removing this code as part of it's acceptance criteria. You could also potentially link to that story in the TODO comment.
There was a problem hiding this comment.
I created a story BI-1883 and updated the comment.
| String pedigree = processBreedbasePedigree(germplasm.getPedigree()); | ||
| additionalInfo.addProperty(BrAPIAdditionalInfoFields.GERMPLASM_RAW_PEDIGREE, pedigree); |
There was a problem hiding this comment.
Will we want to clean this up eventually once BreedBase is handling pedigree correctly?
Just want to make sure we're documenting future work with Jira stories and TODOs.
| List<String> missingParentalDbIds = germplasmDBIDs.entrySet().stream().filter(Map.Entry::getValue).map(Map.Entry::getKey).collect(Collectors.toList()); | ||
| List<String> missingDbIds = germplasmDBIDs.entrySet().stream().filter(Map.Entry::getValue).map(Map.Entry::getKey).collect(Collectors.toList()); |
There was a problem hiding this comment.
Given that missingParentalDbIds and missingDbIds contain the same values, the way they are used doesn't make sense. See my comment below.
There was a problem hiding this comment.
I looked into this more and did some testing. I ended up changing List<String> missingDbIds = germplasmDBIDs.entrySet().stream().filter(Map.Entry::getValue).map(Map.Entry::getKey).collect(Collectors.toList()); to List<String> missingDbIds = germplasmDBIDs.entrySet().stream().filter(entry -> !entry.getValue()).map(Map.Entry::getKey).collect(Collectors.toList());. The map is setup with values of true for parent gids and false for update gids. So now these lists are filtered appropriately from the map and will have different values.
| //GID existence check | ||
| if (missingDbIds.size() > 0) { | ||
| throw new HttpStatusException(HttpStatus.UNPROCESSABLE_ENTITY, | ||
| String.format(missingDbIdsMsg, |
There was a problem hiding this comment.
This code will never be reached because if missingDbIds.size() > 0, missingParentalDbIds.size() > 0 as well, because they have the same values and are mutated in the same ways, so the exception will always be thrown above for missingParentalDbIds.
There was a problem hiding this comment.
With the change that has been made this has been resolved.
The notification message displays on release/0.8 as it is sent from bi-api so I think we can hold off on this until things are merged into develop and have a new card to address it at that point. Created a card: BI-1882 |


Description
Story: BI-1855
Dependencies
Testing
Checklist: