Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Conversation

mlm483
Copy link

@mlm483 mlm483 commented Jun 28, 2024

Description

Story: BI-2109
bi-web PR: Breeding-Insight/bi-web#382
bi-api PR: Breeding-Insight/bi-api#362

Added a migration to insert a datasets array into the additional_info of rows in the trial table, datasets is an array of objects with id, name and level fields.

Important Note: the migration is named in such a way that BI (Breeding Insight) will be able to fit an arbitrary number of BI-specific migrations between the migrations that will actually be pushed upstream. This migration will not be pushed upstream, as it is a BI-specific data migration.

Testing

Create some "legacy" data to migrate.

  1. Checkout and run the develop branch for bi-web, bi-api and brapi-Java-TestServer.
  2. Create experiments through the DeltaBreed UI (this will result in trial rows without a datasets array).

Checkout feature branches and let the migration run on the "legacy" data.

  1. Checkout and run the feature/BI-2109 branches for bi-web, bi-api and brapi-Java-TestServer.
  2. View and download the experiments you created in the DeltaBreed UI, ensure no errors.

Test new features.

  1. In the DeltaBreed UI, on an experiment detail view, create a sub-entity dataset. You must use a BrAPI specified name until BI-2219 is completed (case insensitive).
  2. View and download the top-level and sub-entity datasets, and ensure the files contain the correct data.

UPDATE
trial
SET
additional_info = additional_info
Copy link
Member

Choose a reason for hiding this comment

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

If the new code was run prior to running this db migration for some reason, would the trial datasets array be overwritten with the old datasetId value? If so, do we need to do any check in the migration or just leave it up to process?

Copy link
Author

Choose a reason for hiding this comment

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

I think I'll update the migration to be safe.

Copy link
Author

Choose a reason for hiding this comment

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

Done, 8e06edf.

I tested this change by creating an experiment with the old code, then checking out the bi-web and bi-api feature/BI-2109 branches, creating two experiments and a sub-entity dataset, then checking out the BrAPI-Java-TestServer feature/BI-2109 branch and running it to ensure the migration added the datasets key for the "legacy" data and preserved the datasets key for the "new" data.

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

UPDATE
trial
SET
additional_info = additional_info
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

Copy link

@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 31d1129 into develop Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants