Skip to content

[BI-2908] Remove cache.get() dependencies from BrAPIObservationDAO#531

Open
jloux-brapi wants to merge 3 commits into
bug/BI-2944from
feature/BI-2908
Open

[BI-2908] Remove cache.get() dependencies from BrAPIObservationDAO#531
jloux-brapi wants to merge 3 commits into
bug/BI-2944from
feature/BI-2908

Conversation

@jloux-brapi

@jloux-brapi jloux-brapi commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Story: BI-2908

Replaced programCache.get() in ObservationDAO with BrAPI GET call.

The max amount of observations retrieved by this call will be the allowed maximum from the CACHE_BRAPI_FETCH_PAGE_SIZE=65000 variable in .env

This should be enough for now, until optimizations are made to some code via other tickets created, like BI-2961, BI-2963 and BI-2964

Dependencies

Testing

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 create/modified unit and/or integration tests to cover this change or tests are not applicable
  • I have commented my code, particularly in hard-to-understand areas
  • I have either updated the source of truth or arranged for update with product owner if needed https://breedinginsight.atlassian.net/wiki/spaces/BI/pages/1559953409/Source+of+Truth

- Create tickets for optimizations and improvements to downstream usages of these calls and mark with TODOs
@jloux-brapi jloux-brapi changed the title Feature/bi 2908 [BI-2908] Remove cache.get() dependencies from BrAPIObservationDAO Jul 6, 2026
@jloux-brapi jloux-brapi requested review from a team and humsika and removed request for a team July 6, 2026 22:56
@jloux-brapi jloux-brapi added the on hold Review, but do not merge until removed label Jul 6, 2026
@@ -165,8 +174,14 @@ private void processObservations(String programKey, List<BrAPIObservation> obser
/**
* Get all observations for a program from the cache.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please update this comment as we are not reading from the cache anymore.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed this and another one I found.

import org.apache.commons.lang3.tuple.Pair;
import org.brapi.client.v2.ApiResponse;
import org.brapi.client.v2.model.exceptions.ApiException;
import org.brapi.client.v2.model.queryParams.core.TrialQueryParams;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These imports are not being used in the class, please cleanup the unused imports.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Removed this unused import and other unused ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature on hold Review, but do not merge until removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants