[BI-693] Upgrade micronaut to 2.5.13#146
Conversation
davedrp
left a comment
There was a problem hiding this comment.
All test passed.
Steps to test
- Cleared databases
- Ran script to build bi-api
- Started docker
- Started bi-api server
- Added new programs
- Snacks
- Trail Mix
- Added/registered new users
- Tested redirect
- Imported Ontology
- Edit Ontology
HMS17
left a comment
There was a problem hiding this comment.
Tested
- Unauthorized log in and redirect
- Admin login
- Log out redirect
- Sidebar links direct to proper pages
- Tables display data
- New account creation
- Login with one program
- Page does not exist
A couple comments on the tests, but BI appears to be working!
| super.stopContainers(); | ||
| } | ||
|
|
||
| //TODO: Fix this test |
There was a problem hiding this comment.
Is this and the other todos for a future development or were they accidentally left in?
(Also a+ re: cats)
There was a problem hiding this comment.
Just accidentally left in. I removed those TODOS
| assertEquals(expectedLocation, redirectLocation); | ||
|
|
||
| // Check that the jwt cookie was returned | ||
|
|
There was a problem hiding this comment.
It seems there is code missing here?
There was a problem hiding this comment.
This was moved below to the end of the test. I moved this comment down there.
3519f75 to
2563331
Compare
timparsons
left a comment
There was a problem hiding this comment.
Tested running the application and using the interface to create a program, import ontology terms, import germplasm, view ontology terms, view germplasm, and sign in from Field Book. All of those things worked as expected.
Left a few comments, with some minor changes to make.
| import org.breedinginsight.model.ProgramBrAPIEndpoints; | ||
| import org.breedinginsight.services.ProgramService; | ||
| import org.breedinginsight.services.exceptions.DoesNotExistException; | ||
| import org.intellij.lang.annotations.Flow; |
There was a problem hiding this comment.
This is unused and can be removed
| package org.breedinginsight.api.v1.controller.brapi; | ||
|
|
||
| import io.micronaut.context.annotation.Property; | ||
| import io.micronaut.core.async.publisher.Publishers; |
There was a problem hiding this comment.
This is unused and can be removed
| import io.micronaut.http.server.exceptions.InternalServerException; | ||
| import io.micronaut.web.router.MethodBasedRouteMatch; | ||
| import io.micronaut.web.router.RouteMatch; | ||
| import io.micronaut.web.router.RouteMatchUtils; |
There was a problem hiding this comment.
This is unused and can be removed
|
|
||
| import javax.inject.Inject; | ||
| import java.util.Map; | ||
| import java.util.Optional; |
There was a problem hiding this comment.
This is unused and can be removed
| MutableHttpResponse<?> response = HttpResponse.status(HttpStatus.NOT_FOUND, "Program does not exist"); | ||
| return Flowable.just(response); |
There was a problem hiding this comment.
Why was this (and lines 95/96) changed?
There was a problem hiding this comment.
Micronaut was not exiting out of the request to return the failure with the previous way. Needed to use the just so it didn't continue with the request and returns immediately.
| String[] names = traits.stream() | ||
| .filter(trait -> trait.getObservationVariableName() != null) | ||
| .map(trait -> (RowN) row(trait.getObservationVariableName())) | ||
| .collect(Collectors.toList()).toArray(RowN[]::new); | ||
| .map(trait -> trait.getObservationVariableName().toLowerCase()) | ||
| .collect(Collectors.toList()).toArray(String[]::new); | ||
|
|
||
| List<Trait> traitResults = new ArrayList<>(); | ||
| if (valueRows.length > 0){ | ||
| Table newTraits = dsl.select() | ||
| .from(values(valueRows).as("newTraits", "new_trait_name")).asTable("newTraits"); | ||
| if (names.length > 0){ | ||
|
|
||
| Result<Record> records = dsl.select() | ||
| .from(newTraits) | ||
| .join(TRAIT).on(TRAIT.OBSERVATION_VARIABLE_NAME.upper().equalIgnoreCase(newTraits.field("new_trait_name"))) | ||
| .from(TRAIT) | ||
| .join(PROGRAM_ONTOLOGY).on(TRAIT.PROGRAM_ONTOLOGY_ID.eq(PROGRAM_ONTOLOGY.ID)) | ||
| .join(PROGRAM).on(PROGRAM_ONTOLOGY.PROGRAM_ID.eq(PROGRAM.ID)) | ||
| .join(SCALE).on(TRAIT.SCALE_ID.eq(SCALE.ID)) | ||
| .join(METHOD).on(TRAIT.METHOD_ID.eq(METHOD.ID)) | ||
| .where(PROGRAM.ID.eq(programId)) | ||
| .and(lower(TRAIT.OBSERVATION_VARIABLE_NAME).in(names)) |
There was a problem hiding this comment.
I'm assuming this set of changes is from merging in the latest develop/1.0 branches to this branch?
There was a problem hiding this comment.
These changes were for the migration. The updated JOOQ no longer supported how this was being done. It works the same, but the names are now processed on line 503, and the check was moved from the join statement to the where statement. But, it has the same logic as before.
There was a problem hiding this comment.
k! Just wanted to make sure!
d38c1be to
6950a80
Compare
[BI-693] Upgrade micronaut to 2.5.13
[BI-693] Upgrade micronaut to 2.5.13
[BI-693] Upgrade micronaut to 2.5.13
[BI-693] Upgrade micronaut to 2.5.13
Description
Includes:
Dependencies
develop of bi-web.
jooq-3.16.3 of bi-jooq-codegen (Breeding-Insight/bi-jooq-codegen#3) (not needed locally, this just needs to be merged first)
Testing
Minimum testing:
Here are some suggestions for what to test:
I tested these and all of them passed.
Here is a file with descriptions on how to test a new account and field book.
bi-api_testing_details.md
TAF run returns the same results as the develop branch.
Checklist: