-
Notifications
You must be signed in to change notification settings - Fork 0
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 tree-list endpoint #37
Conversation
backend/kernelCI_app/views.py
Outdated
"branch": "linux-5.15", | ||
"commit": "asidnasidn-oqiwejeoij-oaidnosdnk", | ||
"buildStatus": "150 completed", | ||
"testStatus": "80 completed" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likely this won't be a string like this, but rather an object with individual entries and the frontend will compute the string.
Either a summary object such as testStatus: { fail: 0, success: 80 }
, or an array of each test and their status. For the listing, likely the summary object is better (less data).
1578003
to
b4e7ab1
Compare
'field_timestamp', 'id', 'origin', 'tree_name', | ||
'git_repository_url', 'git_commit_hash', 'git_commit_name', | ||
'git_repository_branch', 'patchset_files', 'patchset_hash', | ||
'message_id', 'comment', 'start_time', 'contacts', | ||
'log_url', 'log_excerpt', 'valid', 'misc' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we only select the fields we are going to use for now? it will likely change in the future, but for now i don't see the need to get all of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The REST API generally does not have this type of relationship with the front-end, it provides data about a resource but does not know what front-end applications will need or not.
backend/kernelCI_app/serializers.py
Outdated
return config.get(field) | ||
|
||
def get_build_status(self, obj): | ||
return self.get_field_from_config(obj, 'build_status') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about extract those build_status
, test_status
, tree_name
into variables? this way if there is some change in the database schema we only have to change it in one place
b4e7ab1
to
b320a7c
Compare
for now we are using a hard-coded configuration, this is a temporary solution while we don't have a table for it
fix serializer
b320a7c
to
d176e45
Compare
add tree-list endpoint serving a mock data for now
Description
Related Issues
How to test it
start docker services and make a get request to
/tree/
you can also check the response in your browser at
http://localhost/tree/