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

API v2 #13

Open
VaderZ opened this issue Sep 25, 2023 · 0 comments
Open

API v2 #13

VaderZ opened this issue Sep 25, 2023 · 0 comments

Comments

@VaderZ
Copy link
Owner

VaderZ commented Sep 25, 2023

While working on #6 it turned out that hierarchical API doesn't make much sense and only adds complexity both on server side (makes hard to share data access code) and client side (client has to carry a lot of context even if in fact not needed), so it would be better to switch to a flat structure and implement it as v2 API. This will also help to integrate auth #8 without immediately breaking the UI.

API v2 should follow the following principals:

  • only one level of hierarchy, filtering instead of nesting, e.g.
    /tests
    /tests/{test_id}
    /tests?test-run-id={test_run_id}
    /metrics?test_id={test_id}

  • RPC-like "actions" are still allowed
    POST /test/{test_id}/finish
    -no redundant id's in request body, e.g. this should go away

        PUT /projects/{project_id}/test-runs/{test_run_id}/tests/{test_id}
        {
           "project_id": ...,
           "test_run_id": ...,
           "test_id": ...,
         }
    

    in this case only an id of an immediate parent (test_run_id) should be a part of the body

  • all "plurals" should support paging by default with page_size and page arguments, sending back X-Total-Count header along with the response

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

When branches are created from issues, their pull requests are automatically linked.

1 participant