-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow filtering builds by commit. #4831
Conversation
…cs.org into filter-builds-by-commit
Codecov Report
@@ Coverage Diff @@
## master #4831 +/- ##
======================================
Coverage 76.2% 76.2%
======================================
Files 158 158
Lines 10022 10022
Branches 1265 1265
======================================
Hits 7637 7637
Misses 2041 2041
Partials 344 344
|
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.
👍
@@ -243,7 +243,7 @@ class BuildViewSetBase(UserSelectViewSet): | |||
serializer_class = BuildSerializer | |||
admin_serializer_class = BuildAdminSerializer | |||
model = Build | |||
filter_fields = ('project__slug',) | |||
filter_fields = ('project__slug', 'commit') |
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 commit has is not unique, so by querying only by commit you could receive 2 builds from different projects. I suppose that if the user cares about that, will also apply the filter project__slug
.
I'm assuming that we are fine.
Ups! I approved it but I forgot to mention that we should add this to our docs: https://docs.readthedocs.io/en/latest/api/v2.html#builds |
There is a section there for "Query Parameters" |
Good catch. Will add it. 👍 |
Extends #3544
Fixes #872