Skip to content

Conversation

@davedrp
Copy link
Contributor

@davedrp davedrp commented Aug 6, 2025

Description

BI-2641 - Remove references to static ObsUnitID column for Create Experiment Workflow

Dependencies

bi-web:DEVELOP

Testing

Import a new experiment. It should still behave according to spec.

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>

@davedrp davedrp requested review from a team, HMS17 and nickpalladino and removed request for a team August 6, 2025 19:36
@davedrp
Copy link
Contributor Author

davedrp commented Aug 13, 2025

Some unit test where failing due to a bug that I introduced. The code has now been fixed

@github-actions
Copy link

There is a problem with the Gemini CLI PR review. Please check the action logs for details.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

N/A

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

📋 Review Summary

This pull request aims to remove the dependency on a static ObsUnitID for the experiment creation workflow. The changes are generally well-aligned with this goal, simplifying the import process for users.

🔍 General Feedback

  • The refactoring correctly removes the logic for fetching existing observation units, trials, and studies based on user-provided IDs.
  • Most of the changes in the affected files are clean and contribute to the desired outcome.

I have found one critical issue that needs to be addressed before merging. Please see the inline comment for details.

existingLocations.forEach(existingLocation -> locationByName.put(existingLocation.getName(), new PendingImportObject<>(ImportObjectState.EXISTING, existingLocation, existingLocation.getId())));
return locationByName;
}
/**

Choose a reason for hiding this comment

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

🔴 critical: The trialByNameNoScope variable is initialized as a new empty HashMap within this method. This shadows the trialByNameNoScope map that is initialized and populated in the process method. As a result, getTrialPIO will always be called with an empty map, trialPIO will be Optional.empty(), and no observation variable datasets will be found.

To fix this, you should pass the trialByNameNoScope map from the process method as a parameter to this method, and remove this line.

Copy link
Member

Choose a reason for hiding this comment

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

@gemini-cli This feedback seems incorrect. trialByNameNoScope is passed into the initializeStudyByNameNoScope method.

@github-actions
Copy link

@nickpalladino I've received your request and I'm working on it now! 🤖

@davedrp
Copy link
Contributor Author

davedrp commented Aug 28, 2025

The build was run manually, and was successful.

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.

Successfully imported new experiment, looks good!

Map<String, PendingImportObject<BrAPITrial>> trialByNameNoScope,
List<ExperimentObservation> experimentImportRows) {
Map<String, PendingImportObject<BrAPIListDetails>> obsVarDatasetByName = new HashMap<>();
Map<String, PendingImportObject<BrAPITrial>> trialByNameNoScope = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

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

What was the reason for making this empty rather than using the passed in map?

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.

4 participants