Untangle/Hack Pedigree UUID scheme so links work on fe - #553
Open
jloux-brapi wants to merge 7 commits into
Open
Conversation
…plement stopgap hack Unit tests made me aware of the use case where rows in a gemrplasm import can reference other rows in the import as parents, and when this happens, no germplasmDbId will be created until the germplasm is fully imported because of the way the import is organized. Until we manage to change this, I've created a stop-gap which will mutate this additional info on the fly from the bi-generated exrefs to the brapiGermplasmDbIds in the BrAPIGermplasmDAO.processGermplasmForDisplay method. This will lookup the germplasmDbIds of the pedigree nodes using the exrefs, and will mutate the additional info records for male/female IDs so that the links still work as expected in the frontend UI
jloux-brapi
marked this pull request as ready for review
September 4, 2026 19:35
humsika
reviewed
Sep 8, 2026
humsika
reviewed
Sep 8, 2026
humsika
reviewed
Sep 8, 2026
| namePedigreeString = parentNames.get(0); | ||
| uuidPedigreeString = additionalInfo.has(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_UUID) ? additionalInfo.get(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_UUID).getAsString() : ""; | ||
| // Convert the bi-generated additionalInfo parent ID to the brapi germplasmDbId using map from previous step. | ||
| uuidPedigreeString = additionalInfo.has(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_UUID) ? pedigreeBrAPIGermplasmDbIdByBICreatedExRef.get(additionalInfo.get(BrAPIAdditionalInfoFields.GERMPLASM_FEMALE_PARENT_UUID).getAsString()) : ""; |
Contributor
There was a problem hiding this comment.
If the BrAPI search does not return one of the requested parent external references, Map.get() returns null. This can serialize pedigreeByUUID as JSON null or produce values such as null/, which BI-Web cannot safely use as a germplasm link. The old implementation did not have this lookup failure mode. Could we validate that every requested parent was resolved, or intentionally use an empty value/GID fallback instead of returning null?
Collaborator
Author
There was a problem hiding this comment.
Ultimately we have a huge problem if the search returns empty for a specific exref. In that case, we should probably just throw an error that prevents the page from loading.
humsika
reviewed
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Story: BI-2904
germplasm.additionalInfo.male/femaleGermplasmUUIDto convert bi-generated ids to the eventually saved brapi germplasmDbIds. This issue was causing links of female/parent Germplasm data table rows to throw and error when clicked, because these IDs are being looked up as brapi germplasmDbIds with the set of changes fromfeature/BI-2902. This is a rather messy/hacky fix I am using as a stop-gap until we decide to import pedigree after germplasm records are created. A comment explaining this situation has been provided in the code.Dependencies
epic/BI-2862branch ofbrapi-java-prodserverfeature/BI-2905branch ofbi-webTesting
Full regression for most germplasm features, excluding sample importing, which will be dealt with once
developbi-api code is merged and this ticketThis features include:
Germplasmtab, and clicking all associated links in the rows including the GID, both parent links, and Show DetailsChecklist: