BI-2779 - Observation levels data migration#11
Merged
nickpalladino merged 1 commit intodevelopfrom Mar 20, 2026
Merged
Conversation
jloux-brapi
approved these changes
Mar 19, 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-2779
NOTE: We should probably wipe qa-test before deploying this.
Dependencies
Testing
See JIRA card for instructions on replicating prod data locally.
Spot check different cases
Prior global level
Some of the existing data had observation unit levels pointing to a global level. One example is plot in the program with program_id 6dd2c9c9-d1ec-4004-a627-ccf65655c502.
GET http://localhost:8083/brapi/v2/observationunits?programDbId=6dd2c9c9-d1ec-4004-a627-ccf65655c502Will see this prior to migration (levelNameDbId will be system specific):
After migration (levelNameDbId will be system specific):
Prior null level
Some prior existing data had null observation unit levels. This was for a period of time where bi-api was submitting levels that were not supported by the brapi server like fish. One example is program with program_id f2ac1d4d-afd3-43c1-a617-0ed14f1129c4.
GET http://localhost:8083/brapi/v2/observationunits?programDbId=f2ac1d4d-afd3-43c1-a617-0ed14f1129c4Will see this prior to migration:
After migration (levelNameDbId will be system specific):
Prior different level
Some prior existing data wrote plot as the observation unit observation level but stored a different custom level like tree in the additionalinfo to get around brapi server errors. This was done for a period of time by bi-api. One example is program with program_id 6df60fd5-bb07-465c-b7cd-fd94bea4f615.
GET http://localhost:8083/brapi/v2/observationunits?programDbId=6df60fd5-bb07-465c-b7cd-fd94bea4f615Will see this prior to migration (levelNameDbId will be system specific):
After migration (levelNameDbId will be system specific):
Checklist: