Skip to content
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

feat: Add support for enabling and disabling QA category to Move2Kube API #162

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Akash-Nayak
Copy link
Contributor

Added feature requested in konveyor/move2kube#1155, konveyor/move2kube#1151 (comment)

Currently, Move2Kube API doesn't have support for --qa-enable and --qa-disable flags, which are supported by Move2Kube CLI.

Screenshot 2024-03-15 at 7 25 46 PM

Now, Move2Kube API will also support enabling/disabling QA category, similar to how the Move2Kube CLI allows for enabling/disabling the QA category using --qa-disable and --qa-enable flags.

Screenshot 2024-03-15 at 5 56 28 PM

Disabling QA category/categories

For example, to disable the questions from the transformers, network and sourceanalyzer categories-

Screenshot 2024-03-15 at 6 19 21 PM

Move2Kube only asks the questions from the categories that are not disabled. So, in this case it directly ask the question from imageregistry category as the transformers, sourceanalyzer and network categories are disabled.

Screenshot 2024-03-15 at 6 16 44 PM

It can also be done using the curl command in multiple ways.

$ curl -X 'POST' \
  'http://localhost:8080/api/v1/workspaces/{workspace-id}/projects/{project-id}/outputs?skip-qa=false&disable-qa-category=transformers,network,sourceanalyzer' \  
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d ''
$ curl -X 'POST' \
  'http://localhost:8080/api/v1/workspaces/{workspace-id}/projects/{project-id}/outputs?skip-qa=false&disable-qa-category=transformers&disable-qa-category=network&disable-qa-category=sourceanalyzer' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d ''
$ curl -X 'POST' \
  'http://localhost:8080/api/v1/workspaces/{workspace-id}/projects/{project-id}/outputs?skip-qa=false&disable-qa-category=transformers%2Cnetwork%2Csourceanalyzer' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d ''

Enabling QA category/categories

For example, to enable the questions only from the cicd category-

Screenshot 2024-03-15 at 6 35 40 PM

Move2Kube transform straightaway skips all the questions that belong to the categories other than the enabled category (cicd in this case).

Screenshot 2024-03-15 at 6 36 48 PM

This can also be done using the curl command.

$ curl -X 'POST' \
  'http://localhost:8080/api/v1/workspaces/d5d1883e-85b4-47f3-a7f1-fb8f47a55566/projects/87d5b97b-2002-488a-af21-2054c089da55/outputs?skip-qa=false&enable-qa-category=cicd' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d ''

To enable this support, I have also updated the QA engine of Move2Kube- konveyor/move2kube#1156

Signed-off-by: Akash Nayak akash19nayak@gmail.com

… API

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

Copy link

codecov bot commented Mar 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 14.48%. Comparing base (09e78d0) to head (1d94cbe).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #162   +/-   ##
=======================================
  Coverage   14.48%   14.48%           
=======================================
  Files           2        2           
  Lines         214      214           
=======================================
  Hits           31       31           
  Misses        179      179           
  Partials        4        4           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant