Errors unless `FORUM_MONGODB_DATABASE` and `FORUM_MONGODB_CLIENT_PARAMETERS` are defined
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5
- Forks
- 26
- Avg merge
- 7d 11h
- Merged PRs (30d)
- 2
Description
By default, we had intended for sites running master to require no changes at all to their configuration to keep the old experience. We currently break this, as @regisb notes in this post. The code is currently doing this because we sometimes need to derive the course_id to know which code path to take, and that's not always available from the request itself.
Is it feasible to add checking to forum.backends.mongodb.api.get_course_id_by_thread_id to explicitly check to see if FORUM_MONGODB_DATABASE and FORUM_MONGODB_CLIENT_PARAMETERS exist, and return None if they don't? That should make the public api call get_course_id_by_thread return None. (And the same for get_course_id_by_comment.) When passing a course_id of None to the CourseWaffleFlag check, it should return the default value for the site as a whole. Which I think will do what we want in a backwards compatible way?
Would that work? Are there other places where we need to try to infer the course_id?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in forum/backends/mongodb/api.py at get_course_id_by_thread_id, then trace forum/api/threads.py at get_course_id_by_thread and the corresponding comment path. Check how missing FORUM_MONGODB_DATABASE and FORUM_MONGODB_CLIENT_PARAMETERS are handled, identify any other course_id inference points, and verify that absent configuration returns None so CourseWaffleFlag uses the site-wide default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mongodb, python
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100