We're often grabbing the metadata of a specific thread to then be able
to perform other operations, but we never need the actual responses or
comments of a thread unless we're displaying it in the normal forum
view.
This change sets a default of with_responses=False, which instructs the
comment service to not send back the responses/comments for the given
thread. We only ask for responses in the case of rendering a single
thread or inline discussion.
For now, this only includes course id, search terms, and result count.
Information is logged both to the standard logger for near-term analysis
and the event tracker for the longer term. Result count logging requires
commit 02466b1 of cs_comments_service (otherwise it will be null).
Previously, an error was raised if the comments service returned data
including an unexpected field, which unnecessarily complicated the
release path for new features, since the list of allowed fields would
need to be modified before cs_comments_service could be modified, and
only then could edx-platform take advantage of the new CS feature. We
still log a warning if an unexpected field is returned, so we will
still be able to tell if the CS returns a corrupt response.
JIRA: FOR-180
This captures real-time metrics for all of the comment client actions,
segregated by course_id, as well as other small-cardinality fields.
The goal is to be able to detect changes in forum usage, with the goal
of alerting on potential error conditions.
This change requires cs_comments_service version 31ef160 or later. Now
that the /threads endpoint can filter by commentable_ids, use that
instead of the /search/threads endpoint, which does not sort and
paginate correctly.
Bug: FOR-224
CommentClientError now has sane subclasses that are meaningfully
distinct, and each subclass is handled appropriately. Errors raised by
the requests library are no longer handled by turning them into
CommentClientErrors, since there is no meaningful handling we can do,
and this way we will get more visibility into why errors are occurring.
Also, HTTP status codes from the comments service indicating client
error are correctly passed through to the client.
This reverts commit e4819a1b55, reversing
changes made to b6ec41cae0.
Now that we're ready to test again, need to revert the revert to put the filtering UI back in.
This reverts commit 66889b8724, reversing
changes made to 0dd9c24e74.
This was merged too early--it's still missing the filtering and display-your-cohort changes.
Will need to revert this revert later.