[BI-2134] Append Experimental Dataset Workflow#359
Merged
Conversation
…eeding-Insight/bi-api into experiment-processor-refactor
davedrp
reviewed
Jul 8, 2024
...ter/services/processors/experiment/appendoverwrite/middleware/commit/BrAPIDatasetCommit.java
Outdated
Show resolved
Hide resolved
davedrp
reviewed
Jul 8, 2024
...services/processors/experiment/appendoverwrite/middleware/commit/BrAPIObservationCommit.java
Outdated
Show resolved
Hide resolved
all tests passing
davedrp
approved these changes
Jul 11, 2024
| private WorkflowUpdate<BrAPIObservation> brAPIObservationUpdate; | ||
| private Optional<WorkflowCreation.BrAPICreationState> createdBrAPIObservations; | ||
| private Optional<WorkflowUpdate.BrAPIUpdateState> priorBrAPIObservations; | ||
| private Optional<WorkflowUpdate.BrAPIUpdateState> updatedObservations; |
Contributor
There was a problem hiding this comment.
this field gets initialized, but is never used.
|
|
||
| public abstract class Middleware<T> { | ||
|
|
||
| Middleware next; |
Contributor
There was a problem hiding this comment.
Use type arguments (see suggestions below)
Suggested change
| Middleware next; | |
| Middleware<T> next; |
| public abstract class Middleware<T> { | ||
|
|
||
| Middleware next; | ||
| Middleware prior; |
Contributor
There was a problem hiding this comment.
Suggested change
| Middleware prior; | |
| Middleware<T> prior; |
Contributor
There was a problem hiding this comment.
Other change in this file may also need to be modified for this to work
| return this.next == null ? this : this.next.getLastLink(); | ||
| } | ||
|
|
||
| private Middleware getFirstLink() { |
| * @return A PendingImportObject containing the dataset with the existing list and reference ID | ||
| * @throws IllegalStateException if external references weren't found for the list | ||
| */ | ||
| public PendingImportObject<BrAPIListDetails> constructPIOFromDataset(BrAPIListDetails dataset, Program program) { |
Contributor
There was a problem hiding this comment.
the parameter program is not used
| * @return An Optional containing a ValidationError if validation fails, or Optional.empty() if validation passes. | ||
| */ | ||
| @Override | ||
| public Optional<ValidationError> validateField(String fieldName, String value, Trait variable) { |
Contributor
There was a problem hiding this comment.
| * @return Optional<ValidationError> Optional containing the first validation error encountered, if any | ||
| */ | ||
| @Override | ||
| public Optional<ValidationError> validateField(String fieldName, String value, Trait variable) { |
Contributor
There was a problem hiding this comment.
| * @return an Optional containing a ValidationError if validation fails, otherwise an empty Optional | ||
| */ | ||
| @Override | ||
| public Optional<ValidationError> validateField(String fieldName, String value, Trait variable) { |
Contributor
There was a problem hiding this comment.
| * @return Optional containing a ValidationError if validation fails, or Optional.empty() if successful. | ||
| */ | ||
| @Override | ||
| public Optional<ValidationError> validateField(String fieldName, String value, Trait variable) { |
Contributor
There was a problem hiding this comment.
| * @return an Optional containing a ValidationError if validation fails, empty otherwise | ||
| */ | ||
| @Override | ||
| public Optional<ValidationError> validateField(String fieldName, String value, Trait variable) { |
Contributor
There was a problem hiding this comment.
This was referenced Aug 13, 2024
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-2134
Workflow selection code (BI-2122) will be shown as changes in here until it is merged into develop
Updated experiment import integration tests for appending or overwriting observations
Features and fixes merged into develop since the refactor started are not included
BI-2128 has been addressed in the refactor---blank values will not overwrite existing observation values
When exceptions are caught in the workflow, any compensating steps to restore the initial state are executed before re-throwing the exception at the ExperimentFileImportService level.
Workflow Overview
Main entrypoint is AppendOverwritePhenotypesWorkflow
Middleware class is used to break down the workflow into composable steps that are joined as a linked list
Factories are used to encapsulate the entity, actions, and processed data
Common methods are saved into various service and injected as dependencies to the factories
FieldValidator is a @FunctionalInterface used to validate observation data against trait properties
Dependencies
Testing
some variations to check
Checklist: