konveyor / tackle-pathfinder

Tackle Pathfinder application
Apache License 2.0
16 stars 23 forks source link

Tackle-92 Assessment Confidence #68

Closed jonathanvila closed 3 years ago

jonathanvila commented 3 years ago

Issue : https://github.com/konveyor/tackle-pathfinder/issues/69

Features covered

Unit , Integration and End2End Tests cases covered

Pre steps Minikube:

  1. Install minikube : https://minikube.sigs.k8s.io/docs/start/
  2. Start minikube : minikube start --kubernetes-version=v1.20.2 --cpus 4 --memory 12000
  3. Enable ingress addons : minikube addons enable ingress
  4. Create tackle namespace
    kubectl create namespace tackle
  5. Deploy tackle ( to have the keycloak instance running ) on your K8s cluster
    $ kubectl apply -f  https://raw.githubusercontent.com/konveyor/tackle/main/kubernetes/kubernetes-tackle.yaml -n tackle
  6. Edit the Ingress object to allow direct request to Pathfinder API
    $ kubectl edit ingress tackle -n tackle

    Add this below paths:

     - backend:
          service:
            name: tackle-pathfinder
            port:
              number: 8080 
        path: /pathfinder
        pathType: ImplementationSpecific
  7. Build and push
    $ ./mvnw -U -B package -Dquarkus.container-image.push=true -Dquarkus.container-image.group={your quay user} -Dquarkus.container-image.registry=quay.io -Dquarkus.container-image.username={your quay user} -Dquarkus.container-image.password={your quay pwd} -Pnative
  8. Change the image in the deployment tackle-pathfinder to be the one you have pushed
  9. Rollout to update the image
    $ kubectl rollout restart deployment tackle-pathfinder -n tackle

Test case with Minikube : Do the full API test

$ .github/scripts/check_api.sh

Expect

+++++ API CHECK SUCCESSFUL ++++++

Pre steps non containerised local test:

  1. run keycloak
    podman run -it --name keycloak --rm \     
            -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e KEYCLOAK_IMPORT=/tmp/keycloak/quarkus-realm.json \
            -e DB_VENDOR=h2 -p 8180:8080 -p 8543:8443 -v ./src/main/resources/keycloak:/tmp/keycloak:Z \
            jboss/keycloak:12.0.2
  2. run postgresql
    podman run -it \                          
            --name postgres-pathfinder -e POSTGRES_USER=pathfinder \                                               
            -e POSTGRES_PASSWORD=pathfinder -e POSTGRES_DB=pathfinder_db \                              
            -p 5433:5432 postgres:10.6
  3. run application
    ./mvnw quarkus:dev

Test case with local non containerised : Do the full API test

$ .github/scripts/check_api.sh localhost:8085 localhost:8180

Expect

+++++ API CHECK SUCCESSFUL ++++++
jonathanvila commented 3 years ago

@jonathanvila The response of the endpoint POST /confidence should also contain the applicationId rather than just the fields: assessmentId and confidence.

In order to create the graph https://docs.google.com/presentation/d/1RFDsQLfyuFd4vMqjlq4Q1tRQi8V-PC3jvMr7jLnTnJE/edit#slide=id.ga9b8077a6e_0_172 it is required to know which confidence was assigned to a certain application.

Let me give you this example:

Let's say we have 2 applications:

[
  {id: 1, name: "app1"},
  {id: 2, name: app2}
]

And then we send a request POST /confidence with the body:

[
  {applicationId: 1},
  {applicationId: 2},
]

The response of the previous request is:

[
  {"assessmentId": 99, confidence: 3},
  {"assessmentId": 100, confidence: 3},
]

Now the question is how can I know which assessment belongs to which application?

The final result is that I have 2 objects:

[
  {id: 1, name: "app1"},
  {id: 2, name: app2}
]

and

[
  {"assessmentId": 99, confidence: 3},
  {"assessmentId": 100, confidence: 3},
]

with no way to create a match between the previous 2 objects.

Could you please add the applicationId to the response of the endpoint?

:+1: