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

Adjust Pi evaluator reply structure to the API response #1353

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

jhrozek
Copy link
Contributor

@jhrozek jhrozek commented Oct 31, 2023

The reply looks now as follows:

curl 'https://staging.stacklok.dev/pi/v1/report?package_name=urllib3&package_type=pypi' | jq '.alternatives'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11774  100 11774    0     0   8730      0  0:00:01  0:00:01 --:--:--  8753
{
  "status": "complete",
  "packages": [
    {
      "package_name": "aiohttp",
      "package_type": "pypi",
      "repo_description": "Rust friendly bindings to *nix APIs (fork with features used in cntr)",
      "score": 6.9
    },
    {
      "package_name": "httpx",
      "package_type": "pypi",
      "repo_description": "Stream based JSON parsing with a Python C-Extension around YAJL",
      "score": 6.6
    },
    {
      "package_name": "httplib2",
      "package_type": "pypi",
      "repo_description": "Small, fast HTTP client library for Python. Features persistent connections, cache, and Google App Engine support. Originally written by Joe Gregorio, now supported by community.",
      "score": 6.1
    },
    {
      "package_name": "treq",
      "package_type": "pypi",
      "repo_description": "Python requests like API built on top of Twisted's HTTP client.",
      "score": 5.9
    }
  ]
}

The reply looks now as follows:
```
curl 'https://staging.stacklok.dev/pi/v1/report?package_name=urllib3&package_type=pypi' | jq '.alternatives'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11774  100 11774    0     0   8730      0  0:00:01  0:00:01 --:--:--  8753
{
  "status": "complete",
  "packages": [
    {
      "package_name": "aiohttp",
      "package_type": "pypi",
      "repo_description": "Rust friendly bindings to *nix APIs (fork with features used in cntr)",
      "score": 6.9
    },
    {
      "package_name": "httpx",
      "package_type": "pypi",
      "repo_description": "Stream based JSON parsing with a Python C-Extension around YAJL",
      "score": 6.6
    },
    {
      "package_name": "httplib2",
      "package_type": "pypi",
      "repo_description": "Small, fast HTTP client library for Python. Features persistent connections, cache, and Google App Engine support. Originally written by Joe Gregorio, now supported by community.",
      "score": 6.1
    },
    {
      "package_name": "treq",
      "package_type": "pypi",
      "repo_description": "Python requests like API built on top of Twisted's HTTP client.",
      "score": 5.9
    }
  ]
}
```
Copy link
Contributor

@lujunsan lujunsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jhrozek jhrozek merged commit 9160ab1 into mindersec:main Oct 31, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants