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

Add APIs to list/search raw test reports #10

Open
preaction opened this issue May 27, 2017 · 0 comments
Open

Add APIs to list/search raw test reports #10

preaction opened this issue May 27, 2017 · 0 comments

Comments

@preaction
Copy link
Member

preaction commented May 27, 2017

We should have a way to list and search the raw test report JSON that we are storing. We should create the following endpoints:

  • GET /v3/report - Get a list of reports
  • GET /v3/report/dist/:dist_name - Get a list of reports about a distribution
  • GET /v3/report/author/:author_name - Get a list of reports about an author

Other fields could be added as query parameters for more constraints like ?grade=(pass|fail).

The above endpoints are only examples. If they can not perform decently, we cannot add them. We need to test these APIs against all the records (which means this cannot be released until the old test report records are migrated: cpan-testers/cpantesters-backend#6).

Since there are 80 million records and climbing, this will need to be paginated. Each endpoint should accept offset and limit parameters. The limit parameter must be less than or equal to 1000 (this number chosen because it matches the old Metabase log.txt limit). The output should contain pagination information along with the records returned, like:

{
    "offset": 0,
    "limit": 1000,
    "total": 81345619,
    "query": { },
    "order_by": [
        [ "created", "desc" ]
    ],
    "results": [
        { "result": { "grade": "pass", "output": { } } },
        { "result": { "grade": "na", "output": { } } },
        { "result": { "grade": "fail", "output": { } } }
    ]
}

There is a problem that doing a COUNT(*) on an InnoDB table in MySQL is super-slow. But, without that information, it becomes much harder to use the API.

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

No branches or pull requests

1 participant