Skip to content

BI-1650 - Store and fetch genotype data#228

Merged
timparsons merged 28 commits intodevelopfrom
feature/BI-1650
Mar 1, 2023
Merged

BI-1650 - Store and fetch genotype data#228
timparsons merged 28 commits intodevelopfrom
feature/BI-1650

Conversation

@timparsons
Copy link
Member

@timparsons timparsons commented Nov 16, 2022

Description

Story: https://breedinginsight.atlassian.net/browse/BI-1650

  • Created a GenoService interface
  • Created a GigwaGenoServiceImpl class to handle importing and retrieving genotype data to/from Gigwa
  • Added Gigwa to the docker-compose file
  • Introduced dependency to interact with AWS S3
  • Introduced BrAPIEndpointProvider, and refactored how BrAPI endpoint classes are created from the BrAPI Java Client. This makes the code more testable because the BrAPIEndpointProvider can be mocked in tests
  • Converted ImportDAO to use the interface/impl pattern
  • Converted ImportMappingDAO to use the interface/impl pattern
  • Converted UserDAO to use the interface/impl pattern

Dependencies

  • bi-web/feature/BI-1650
  • Gigwa (should be able to run the container specified in the docker-compose file)
  • AWS keys to connect to S3

Testing

  • Get AWS keys to connect to S3
  • Verify that the application can start up, and that Gigwa can start up
  • Test the card following the acceptance criteria in the card

Checklist:

  • I have performed a self-review of my own code
  • I have tested my code and ensured it meets the acceptance criteria of the story
  • I have tested that my code works with both the brapi-java-server and BreedBase
  • I have create/modified unit tests to cover this change
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to documentation
  • I have run TAF: https://github.com/Breeding-Insight/taf/actions/runs/3500841631

Copy link
Contributor

@HMS17 HMS17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing runs into NullPointerExpection due to addition of dynamic columns. Adding a wrapper to check for null in ImportUpload.java:setDynamicColumnNames fixes it

.env Outdated
AWS_REGION=<aws region>
AWS_ACCESS_KEY_ID=<access key>
AWS_SECRET_KEY=<secret>
AWS_GENO_BUCKET=<s3 bucket for genotypic data uploads> No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also have the AWS_S3_ENDPOINT= placeholder?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this was updated

this.securityService = securityService;
}

@Post("programs/{programId}/experiments/{experimentId}/geno/import")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how well the api docs have been kept to date as of late but should new api endpoints be added in the docs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickpalladino I don't think very well. I'd be more inclined to create a separate card to handle updating the API docs. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

BrAPIGermplasm germplasm = germplasmService.getGermplasmByDBID(programId, germplasmId);
//Forward the pedigree call to the backing BrAPI system of the program passing the germplasmDbId that came in the request
GermplasmApi api = new GermplasmApi(programDAO.getCoreClient(programId));
GermplasmApi api = brAPIEndpointProvider.get(programDAO.getCoreClient(programId), GermplasmApi.class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickpalladino To make the code more testable. By changing from using the 'new ()', unit tests can now mock out the creation of certain types of BrAPI endpoint classes that are in the BrAPI Java Client.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good

Map<Integer, PendingImport> mappedBrAPIImport, Table data,
Program program, User user, boolean commit) throws ValidatorException {

log.debug("Processing germplasm import");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still want the debug logging in here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickpalladino Yes. My opinion is the more logging in the code the better. We can always change the log level if it's too noisy in production, but we can't add more without rebuilding code.

@timparsons timparsons requested review from HMS17, davedrp and nickpalladino and removed request for HMS17 February 27, 2023 21:13
@timparsons timparsons merged commit ba7927e into develop Mar 1, 2023
@timparsons timparsons deleted the feature/BI-1650 branch March 1, 2023 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants