-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tackle-75-business-logic-for-create-assessment #18
tackle-75-business-logic-for-create-assessment #18
Conversation
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Codecov Report
@@ Coverage Diff @@
## main #18 +/- ##
=============================================
- Coverage 91.11% 77.77% -13.34%
- Complexity 25 33 +8
=============================================
Files 7 16 +9
Lines 45 63 +18
Branches 1 1
=============================================
+ Hits 41 49 +8
- Misses 3 13 +10
Partials 1 1
Continue to review full report at Codecov.
|
…pproach Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Created test for the structure copy Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Modified flyway scripts to have the default false to boolean Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanvila I added some comments below and besides my comments I'd like to also mention:
- I've seen the field
notes
in the Assessment entity;comment
inAssessmentQuestion
but thecomments/notes
should be located in theAssessmentCategory
. Could we have a single term for bothcomment
andnotes
? unless they both mean different things. - Before this PR the creation of an assessment was very quick but with this PR the creation of an assessment takes longer (I guess it is because it needs to copy the questionnaire). Since it takes longer for the backend to process the
POST /assessment
request I was able to discover that we can create multiple assessments for a single application which I think is breaking the constraint of having a single assessment per application. See the video below (note that in my video I'm using the UI but you can use curl to have the same results). In the video I'm clicking multiple times the "assess" button.
Peek.2021-04-09.11-29.mp4
Of course, the UI should also disable the button "assess" while executing POST /assessment
so this is something to enhance also in the UI.
- Could you please format to the .SQL files? I guess it is a matter of using the IDE format feature.
src/main/resources/db/migration/V0.0.2_002__create_assessment_quest.sql
Outdated
Show resolved
Hide resolved
src/main/resources/db/migration/V0.0.2_002__create_assessment_quest.sql
Outdated
Show resolved
Hide resolved
Well, a comment and notes are not exactly the same and that was my intention. But I see your point, and as it's a matter of perception , I will rename to Comment everywhere as you point. |
👍 Good spot . |
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
…response Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathanvila I added just an additional comment to this PR, feel free to take any action about it.
I've tested the latest commit available and the problem of having multiple assessments for an application seems to be solved. I'm sharing the video below of one test I've done using JMeter. This is what I understand from the current status of this PR:
- The problem of multiple assessments per application was solved by adding a
UNIQUE
constraint to the tableassessment
. In this way, we are sure that even if the backend tries to create multiple assessments per application the DB won't allow it to happen. - The line
assessment.persistAndFlush()
located at https://github.com/jonathanvila/tackle-pathfinder/blob/tackle-75-business-logic-for-create-assessment/src/main/java/io/tackle/pathfinder/services/AssessmentSvc.java#L47 helps to early reject the creation of a new assessment. I've startedpathfinder
usingquarkus:dev
and withassessment.persistAndFlush()
it takes around 4 seconds for an assessment to be created; on the other hand, usingassessment.persist()
takes around 10 seconds. The timing might change on a native container.
Peek.2021-04-13.11-53.mp4
Signed-off-by: Jonathan Vila <jvilalop@redhat.com>
Thanks @jonathanvila , this PR looks good to me. |
Issue : #11
Features included :
Pre steps :
Add this below
paths:
Test case 1 : Obtain Keycloak secret
Test case 2 : Create assessment for applicationId=20
Test case 3 : DB check for assessment for applicationId=20
$ kubectl exec -ti pgcli sh
pathfinder_db=# select count(*) from single_option ; count ------- 174 (1 row)
Test case 4 : Simultaneous calls to create assessment return 201 for the first and 400 for the rest ( to avoid multiple assessments per application )
bash -x file.sh {incremental number} {cluster ip}
If you are using minikube you can get your cluster ip with : minikube ip