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

Allow filtering builds by commit. #4831

merged 10 commits into from Oct 31, 2018

Conversation

@ericholscher
Copy link
Member

@ericholscher ericholscher commented Oct 31, 2018

Extends #3544
Fixes #872

@ericholscher ericholscher requested a review from Oct 31, 2018
@codecov
Copy link

@codecov 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

👍

@@ -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

@humitos humitos Oct 31, 2018

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 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 humitos commented Oct 31, 2018

There is a section there for "Query Parameters"

@ericholscher
Copy link
Member Author

@ericholscher ericholscher commented Oct 31, 2018

Good catch. Will add it. 👍

@ericholscher ericholscher merged commit 521afbe into master Oct 31, 2018
3 checks passed
@stsewd stsewd deleted the filter-builds-by-commit branch Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants