thoth-station / user-api

Web Service exposing Thoth functions to the RESTful worlds
https://thoth-station.github.io/
GNU General Public License v3.0
8 stars 18 forks source link

GET ​/python​/package List Python packages: 200 response with No packages #1782

Closed shreekarSS closed 2 years ago

shreekarSS commented 2 years ago

Describe the bug

Listing no packages with default values, still gives 200 response
{ "packages": [], "parameters": { "os_name": "ubi", "os_version": "9", "page": 0, "per_page": 25, "python_version": "3.9" } }

To Reproduce Steps to reproduce the behavior:

  1. Try https://khemenu.thoth-station.ninja/api/v1/ui/#/PythonPackages/list_python_packages

Expected behavior List of packages should be displayed

goern commented 2 years ago

/sig user-experience

goern commented 2 years ago

this seems to block https://github.com/thoth-station/support/issues/270

/sig devsecops /priority critical-urgent /assign @harshad16

harshad16 commented 2 years ago

The user-api is failing with falling error:

"  File \"/opt/app-root/src/thoth/user_api/api_v1.py\", line 680, in list_python_packages\n    entries_count = GRAPH.get_python_package_version_names_count_all(\n",
        "TypeError: get_python_package_version_names_count_all() got an unexpected keyword argument 'like'\n"

user-api-208-g684n-user-api.log

the function get_python_package_version_names_count_all was already updated in thoth-storages as we don't have a new release it is missing out from user-api view, new release of thoth-storages would fix this issue. working on the new release.

harshad16 commented 2 years ago

This should be fixed , once release of storages is finished and package is updated in user-api requirements.

harshad16 commented 2 years ago

The issue is fixed and all set in production. The following request are functioning as required.

curl -X 'GET' \
  'https://khemenu.thoth-station.ninja/api/v1/python/package?page=0&per_page=25&os_name=ubi&os_version=9&python_version=3.9&like=pa%25' \
  -H 'accept: application/json'
  curl -X 'GET' \
  'https://khemenu.thoth-station.ninja/api/v1/python/package?page=0&per_page=25&os_name=ubi&os_version=8&python_version=3.8&like=pa%25' \
  -H 'accept: application/json'