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

Allow filtering builds by commit. #4831

Merged
merged 10 commits into from
Oct 31, 2018
Merged

Conversation

ericholscher
Copy link
Member

@ericholscher ericholscher commented Oct 31, 2018

Extends #3544
Fixes #872

@ericholscher ericholscher requested a review from a team October 31, 2018 12:20
@codecov
Copy link

codecov bot commented Oct 31, 2018

Codecov Report

Merging #4831 into master will not change coverage.
The diff coverage is 100%.

@@          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
Impacted Files Coverage Δ
readthedocs/restapi/views/model_views.py 94.08% <100%> (ø) ⬆️

Copy link
Member

@humitos humitos left a 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')
Copy link
Member

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.

@humitos
Copy link
Member

humitos commented Oct 31, 2018

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

@humitos
Copy link
Member

humitos commented Oct 31, 2018

There is a section there for "Query Parameters"

@ericholscher
Copy link
Member Author

Good catch. Will add it. 👍

@ericholscher ericholscher merged commit 521afbe into master Oct 31, 2018
@stsewd stsewd deleted the filter-builds-by-commit branch October 31, 2018 14:06
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.

3 participants