Skip to content

BI-2047 - Pull Existing Observation Values For An Experiment Into Field-Book#443

Merged
mlm483 merged 15 commits intodevelopfrom
feature/BI-2047
Feb 18, 2025
Merged

BI-2047 - Pull Existing Observation Values For An Experiment Into Field-Book#443
mlm483 merged 15 commits intodevelopfrom
feature/BI-2047

Conversation

@mlm483
Copy link
Contributor

@mlm483 mlm483 commented Feb 11, 2025

Description

Story: BI-2047

Partially implemented the BrAPI /observations GET endpoint to support pulling existing observation values into Field Book. The endpoint only supports studyDbId and pagination (pageSize, page) query parameters. The use of other query parameters will result in a 501 Not Implemented response. The use of invalid pagination query parameters will result in a 400 Bad Request response.

Valid pagination query parameters must satisfy the following conditions.

  • Either both or neither of page and pageSize must be present, one is invalid without the other. (BrAPI specifies default values).
  • If present, pageSize must be greater than zero. If omitted, pageSize defaults to 1000.
  • If present, page must be greater than or equal to zero and less than the total number of pages (page is zero-indexed). If omitted, page defaults to 0.

There is a story to add support for all query params, BI-2506.

Testing

Part 1: Field Book Integration

To test with Delta Breed running locally and Field Book running in an android emulator, follow the Connect to Local DeltaBreed from Field Book section of the Field Book Development Guide.

  1. Upload an experiment with observations to DeltaBreed.
  2. Pull the experiment into Field Book (I recommend enabling the new BrAPI import UI in Settings > Experimental.
  3. On the Field Book "Field Detail" page, use the "Sync" activity to pull existing observations into Field Book.
  4. The data collected should be visualized in the "Data" section of the "Field Detail" page.
  5. Go to the "Collect" activity, and confirm that the values uploaded to DeltaBreed are in the Field Book collection UI.

Part 2: 501 Not Implemented

  • Using the /observations GET endpoint with query parameters other than studyDbId should result in a 501 status code.

For example a request to {{baseURL}}/v1/programs/{{programId}}/brapi/v2/observations?trialDbId={{trialDbId}} with all variables substituted with valid values should result in a 501 response. The story to implement support other query parameters is BI-2506.

Part 3: Pagination

Test pagination, by providing both valid and invalid pageSize and page query parameters to the {{baseURL}}/v1/programs/{{programId}}/brapi/v2/observations endpoint. Invalid pagination query parameters should result in a 400 Bad Request response. Valid pagination query parameters should result in data and metadata consistent with the BrAPI documentation on pagination. Note: the BrAPI Java Server is inconsistent with the docs, this is an open issue.

OR

Review the test cases in BrAPIObservationsControllerIntegrationTest::testGetObsPagination for logical correctness.

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, HMS17 and nickpalladino and removed request for a team February 17, 2025 19:23
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.

API endpoint testing passes and fieldbook demo looked excellent!

@mlm483 mlm483 merged commit 487aedb into develop Feb 18, 2025
1 check passed
@mlm483 mlm483 deleted the feature/BI-2047 branch February 18, 2025 20:29
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