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 documentation to some endpoints #890

Merged
merged 3 commits into from
Feb 10, 2025

Conversation

Francisco2002
Copy link
Collaborator

@Francisco2002 Francisco2002 commented Feb 6, 2025

  • tree listing
  • tree listing fast
  • tree latest
  • tree details full

Part of #86
Close #808, #809, #810, #812

@Francisco2002 Francisco2002 force-pushed the feat/tree-endpoints-docs branch from addc82a to 65dc497 Compare February 6, 2025 16:30
@Francisco2002 Francisco2002 force-pushed the feat/tree-endpoints-docs branch from 65dc497 to af59121 Compare February 6, 2025 16:58
@Francisco2002 Francisco2002 self-assigned this Feb 6, 2025
@Francisco2002 Francisco2002 force-pushed the feat/tree-endpoints-docs branch from af59121 to 179121a Compare February 6, 2025 18:26
@Francisco2002 Francisco2002 marked this pull request as ready for review February 6, 2025 18:34
error_message="Trees not found", status_code=HTTPStatus.OK
return create_api_error_response(error_message="Trees not found", status_code=HTTPStatus.OK)

checkouts = [self._sanitize_tree(checkout) for checkout in checkouts]
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed in the meeting me and Francisco had, we could remove this _sanatize_tree using Pydantic alias but that would mean that instead of checkouts being a list of tuples, we would need to change this to a list of objects, like checkouts = [{"checkout": checkouts[0]}, {"checkout": checkouts[1]}, ...] because of the way AliasPath of pydantic works (it gets the element in index n of an object field that has an iterable as value). We judged both of the solutions to be more or less equal so decided not to change at first and would like the opinion of the other devs in this matter

Comment on lines +50 to +56
class TreeDetailsFullResponse(
TreeDetailsBuildsResponse,
CommonDetailsBootsResponse,
CommonDetailsTestsResponse,
SummaryResponse
):
pass
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this makes sense in this code (since the full endpoint must be the combination of all the other tree endpoints) but I wanna see what the others think as well

backend/kernelCI_app/typeModels/treeListing.py Outdated Show resolved Hide resolved
@Francisco2002 Francisco2002 force-pushed the feat/tree-endpoints-docs branch from 179121a to 2e231bc Compare February 7, 2025 13:04
@Francisco2002 Francisco2002 force-pushed the feat/tree-endpoints-docs branch from 2e231bc to aef36a8 Compare February 7, 2025 17:22
@Francisco2002 Francisco2002 force-pushed the feat/tree-endpoints-docs branch from aef36a8 to 8c601b0 Compare February 7, 2025 17:46
Copy link
Contributor

@murilx murilx left a comment

Choose a reason for hiding this comment

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

Seems to be working fine. I think we might still have some discussion to do about _sanitize_tree if we'd like that the function returns a dict with the already correct field names or if we'd like to use pydantic to sort this out, but for now I think this is working well

Copy link
Collaborator

@MarceloRobert MarceloRobert left a comment

Choose a reason for hiding this comment

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

It is good as it is, even though as we discussed we could change the _sanitize_tree. Pre approving

@Francisco2002 Francisco2002 merged commit 6e20fdf into main Feb 10, 2025
5 checks passed
@Francisco2002 Francisco2002 deleted the feat/tree-endpoints-docs branch February 10, 2025 13:07
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.

tree listing
3 participants