Skip to main content

Open edX forum application

Project description

Open edX Forum

CI License status-badge

This application provides a forum backend for use within Open edX courses. Features include: nested comments, voting, instructor endorsements, and others. The frontend is provided by the frontend-app-discussions microfrontend application.

This project is a drop-in replacement of the legacy cs_comments_service application. The legacy application was written in Ruby, while this one is written in Python for direct integration in the edx-platform Django project. Moreover, forum data no longer resides in MongoDB, but in the relational MySQL database. The motivation for this rewrite is described more extensively in the Axim Funded Contribution Proposal.

Installation

⚠️ At the moment, the forum is not yet fully integrated in Tutor. Users will need to install the forum plugin from the regisb/forumv2 branch.

The only prerequisite is a working Open edX platform with Tutor, on the Sumac release (v19+) or the nightly branch. Enable the forum by running:

tutor plugins enable forum
tutor local launch

The forum feature will then be automatically enabled in the Open edX platform, and all API calls will be transparently handled by the new application.

Development

Run tests with:

make test-all       # run all tests
make test           # run unit tests only
make test-quality   # run quality tests only
make test-e2e       # run end-to-end tests only

When developing this application, it is recommended to clone this repository locally and mount it within the application containers:

git clone git@github.com:openedx/forum.git
tutor mounts add ./forum/

Check that the forum repository is properly bind-mounted both at build- and run-time by running tutor mounts list. It should output the following:

- name: /home/path/to/forum
  build_mounts:
  - image: openedx
    context: mnt-forum
  - image: openedx-dev
    context: mnt-forum
  compose_mounts:
  - service: openedx
    container_path: /mnt/forum
  - service: openedx-dev
    container_path: /mnt/forum

Re-build the openedx-dev image and launch the platform:

tutor images build openedx-dev
tutor dev launch

Administration

Deployment of the forum v2 application is gated by two course waffle flags. In addition, this application provides a few commands to facilitate the transition from the legacy forum app.

Forum v2 toggle

In edx-platform, forum v2 is not enabled by default and edx-platform will keep communicating with the legacy forum app. To enable forum v2 in your Open edX platform, toggle the discussions.enable_forum_v2 course waffle flag:

./manage.py lms waffle_flag --create --everyone discussions.enable_forum_v2

Note that Tutor enables this flag for all forum plugin users, such that you don’t have to run this command yourself. If you wish to migrate your courses one by one to the new forum v2 app, you may create the corresponding “Waffle flag course override” objects in your LMS administration panel, at: http(s)://<LMS_HOST>/admin/waffle_utils/waffleflagcourseoverridemodel/.

MySQL backend toggle

To preserve the legacy behaviour of storing data in MongoDB, the forum v2 app makes it possible to keep using MongoDB as a data backend. However, it is strongly recommended to switch to the MySQL storage backend by toggling the forum_v2.enable_mysql_backend course waffle flag:

./manage.py lms waffle_flag --create --everyone forum_v2.enable_mysql_backend

Here again, Tutor creates this flag by default, such that you don’t have to create it yourself. If you decide to switch to MySQL, you will have to migrate your data from MongoDB – see instructions below.

Migration from MongoDB to MySQL

The forum v2 app comes with the forum_migrate_courses_to_mysql migration command to move data from MongoDB to MySQL. This command will perform the following steps:

  1. Migrate data: user, content and read state data from MongoDB to MySQL.

  2. Enable the forum_v2.enable_mysql_backend waffle flag for the specified course(s).

To migrate data for specific courses, run the command with the course IDs as argument:

./manage.py lms forum_migrate_course_from_mongodb_to_mysql <course_id_1> <course_id_2>

To migrate data for all courses, run the command with the all argument:

./manage.py lms forum_migrate_course_from_mongodb_to_mysql all

To test data migration without actually creating course toggles, use the --no-toggle option:

./manage.py lms forum_migrate_course_from_mongodb_to_mysql --no-toggle all

⚠️ Note that the command will create toggles only for the processed courses. Courses created in the future will not automatically use the MySQL backend unless you create the global waffle flag with the waffle_flag --create command indicated above.

MongoDB data deletion

After you have successfully migrated your course data from MySQL to MongoDB using the command above, you may delete your MongoDB data using the forum_delete_course_from_mongodb management command. This command deletes course data from MongoDB for the specified courses.

Run the command with the course ID(s) as an argument:

./manage.py lms forum_delete_course_from_mongodb <course_id_1> <course_id_2>

To delete data for all courses, run the command with the all argument:

./manage.py lms forum_delete_course_from_mongodb all

To try out changes before applying them, use the --dry-run option. For instance:

./manage.py lms forum_delete_course_from_mongodb all --dry-run

Getting Help

If you are having trouble, we have discussion forums at https://discuss.openedx.org where you can connect with others in the community.

Our real-time conversations are on Slack. You can request a Slack invitation, then join our community Slack workspace.

For anything non-trivial, the best path is to open an issue in this repository with as many details about the issue you are facing as you can provide.

For more information about these options, see the Getting Help page.

License

The code in this repository is licensed under the AGPL 3.0 unless otherwise noted. See LICENSE.txt for details.

Contributing

Contributions are very welcome. Please read How To Contribute for details.

This project is currently accepting all types of contributions, bug fixes, security fixes, maintenance work, or new features. However, please make sure to discuss your new feature idea with the maintainers before beginning development to maximize the chances of your change being accepted. You can start a conversation by creating a new issue on this repo summarizing your idea.

The Open edX Code of Conduct

All community members are expected to follow the Open edX Code of Conduct.

People

The assigned maintainers for this component and other project details may be found in Backstage. Backstage pulls this data from the catalog-info.yaml file in this repo.

Reporting Security Issues

Please do not report security issues in public. Please email security@openedx.org.

Change Log

Unreleased

0.1.0 – 2024-11-12

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openedx_forum-0.1.3.tar.gz (107.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openedx_forum-0.1.3-py2.py3-none-any.whl (129.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file openedx_forum-0.1.3.tar.gz.

File metadata

  • Download URL: openedx_forum-0.1.3.tar.gz
  • Upload date:
  • Size: 107.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for openedx_forum-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5855d5c9afd7fdeef60eeb10efe55b89968bb2f93803cd49116e464ad7852caf
MD5 915deb6ea6e322518e3064f8e0c0ca55
BLAKE2b-256 934edb0c8d8c4031472e4701681c5cd77b8cbfce0e73d460fdbc3bda2499ae38

See more details on using hashes here.

File details

Details for the file openedx_forum-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: openedx_forum-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 129.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for openedx_forum-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 26da600d383408858bb377d0582b38a7db060287baa088bf7781d5e5c6684eac
MD5 20f412e15142bf3f38e23e1a2debd39e
BLAKE2b-256 8c2bbdad64354a522d5415719f2418a8a6971e6c2a42123a91789d0a79c57845

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page