Skip to content

BI-2058 - Add Observations and ObservationUnits to Redis Cache#339

Merged
mlm483 merged 18 commits intodevelopfrom
feature/BI-2058
Apr 9, 2024
Merged

BI-2058 - Add Observations and ObservationUnits to Redis Cache#339
mlm483 merged 18 commits intodevelopfrom
feature/BI-2058

Conversation

@mlm483
Copy link
Contributor

@mlm483 mlm483 commented Mar 15, 2024

Description

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

Added Observations and ObservationUnits to the redis cache. They are eagerly fetched on application startup just like the other entities we cache.

All the methods that write Observations or ObservationUnits have been modified to repopulate the cache, which is essential for reading one's own writes.

Most of the methods that read Observations and Observation units have been modified to read from the cache.

A few read methods still make BrAPI calls because it would be impractical to use the cache. For example, I did not update BrAPIObservationUnitDAO::getObservationUnits because some of the search parameters would be expensive to implement client-side (compared to SQL joins), notably the seasonDbId parameter, which is not directly on the ObservationUnit object.

Also, calling ProgramCache::post with a null postFunction would result in a NPE, I prevented this possibility, see this commit.

Dependencies

bi-web develop branch

Testing

Ensure experiment upload, view, and download (file export) workflows work as expected.

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: <please include a link to TAF run>

@mlm483 mlm483 requested review from a team, davedrp and dmeidlin and removed request for a team March 28, 2024 18:00
Copy link
Contributor

@davedrp davedrp left a comment

Choose a reason for hiding this comment

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

Passed Developer Testing

@mlm483 mlm483 merged commit 478cd1e into develop Apr 9, 2024
@mlm483 mlm483 deleted the feature/BI-2058 branch April 9, 2024 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants