-
Notifications
You must be signed in to change notification settings - Fork 73
EDUCATOR-464: Add POST method to course_summaries/ #173
Conversation
The failure you're currently seeing will go away with a |
4795f8d
to
289ea1f
Compare
Codecov Report
@@ Coverage Diff @@
## master #173 +/- ##
==========================================
+ Coverage 97.89% 97.91% +0.01%
==========================================
Files 54 54
Lines 3134 3164 +30
Branches 235 238 +3
==========================================
+ Hits 3068 3098 +30
Misses 42 42
Partials 24 24
Continue to review full report at Codecov.
|
3e557bb
to
387ddd6
Compare
1f47461
to
be1ec92
Compare
return '/api/v0/{}/{}'.format(self.list_name, query_string) | ||
|
||
def validated_request(self, ids=None, fields=None, exclude=None, **extra_args): |
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.
This is the function I'm most interested in feedback on. I'm making it so every request is done as both a GET and POST, and the results are compared before returning. Let me know what you think @efischer19.
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.
I like it, very nice test addition
POST method allows large number of course ID arguments to be passed as data, while GET method is restricted by URL length. EDUCATOR-464
be1ec92
to
ff9fb9b
Compare
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.
This all makes sense to me, let's keep things moving!
return '/api/v0/{}/{}'.format(self.list_name, query_string) | ||
|
||
def validated_request(self, ids=None, fields=None, exclude=None, **extra_args): |
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.
I like it, very nice test addition
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.
LGTM! Thanks for adding documentation; it's very helpful down the road.
It's probably a good time to cut a new release actually and build a new docker image.
@@ -9,3 +9,4 @@ Jason Bau <[email protected]> | |||
John Jarvis <[email protected]> | |||
Dmitry Viskov <[email protected]> | |||
Eric Fischer <[email protected]> | |||
Kyle McCormick <[email protected]> |
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 course_summaries/ currently supports only the GET method. A client can restrict the number of course summaries returned from the endpoint by passing in a list of desired course IDs in the
course_ids
parameter. However, this is not practically usable, as the number of IDs many clients would want to pass in would make the URL too long. So, Insights currently does not use thecourse_ids
parameter, and instead fetches every course summary and filters them on the client side. Fetching every summary incurs a response time of ~5s.To fix this, this PR adds a POST method to this endpoint. The POST method functions exactly the same as the GET method, except that all parameters are passed in the request body, allowing a much larger number of course IDs to be passed in. (It is understood that this is not the semantic meaning of the POST verb, however, this is not an uncommon workaround to URL length restrictions).
This PR updates the Analytics API Client to use the new POST method, and this PR updates Insights to take advantage of the course ID filtering now usable in the client.
JIRA Ticket: EDUCATOR-464.
TODO:
@edx/educator-dahlia