{"id":13880310,"url":"https://github.com/openedx/cs_comments_service","last_synced_at":"2025-04-12T22:36:58.732Z","repository":{"id":3663437,"uuid":"4732120","full_name":"openedx/cs_comments_service","owner":"openedx","description":"server side of the comment service","archived":false,"fork":false,"pushed_at":"2025-02-12T14:59:38.000Z","size":1567,"stargazers_count":36,"open_issues_count":19,"forks_count":156,"subscribers_count":138,"default_branch":"master","last_synced_at":"2025-04-05T00:03:30.933Z","etag":null,"topics":["backend-service"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openedx.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-06-20T22:12:04.000Z","updated_at":"2025-02-12T14:59:44.000Z","dependencies_parsed_at":"2023-09-27T14:00:36.007Z","dependency_job_id":"f6a49559-6291-4cfa-a42c-ceb29cb414ba","html_url":"https://github.com/openedx/cs_comments_service","commit_stats":null,"previous_names":[],"tags_count":88,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcs_comments_service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcs_comments_service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcs_comments_service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcs_comments_service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openedx","download_url":"https://codeload.github.com/openedx/cs_comments_service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643006,"owners_count":21138353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend-service"],"created_at":"2024-08-06T08:02:56.132Z","updated_at":"2025-04-12T22:36:58.710Z","avatar_url":"https://github.com/openedx.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"Part of `edX code`__.\n\n__ http://code.edx.org/\n\nedX Comments Service/Forums   |Build|_ |Codecov|_\n==================================================\n.. |Build| image:: https://github.com/openedx/cs_comments_service/workflows/RUBY%20CI/badge.svg?branch=master\n.. _Build: https://github.com/openedx/cs_comments_service/actions?query=workflow%3A%22RUBY+CI%22\n\n.. |Codecov| image:: http://codecov.io/github/edx/cs_comments_service/coverage.svg?branch=master\n.. _Codecov: http://codecov.io/github/edx/cs_comments_service?branch=master\n\nAn independent comment system which supports voting and nested comments. It\nalso supports features including instructor endorsement for education-aimed\ndiscussion platforms.\n\nGetting Started\n---------------\nIf you are running cs_comments_service as part of edx-platform__ development under\ndevstack, it is strongly recommended to read `those setup documents`__ first.  Note that\ndevstack will take care of just about all of the installation, configuration, and\nservice management on your behalf. If running outside of devstack, continue reading below.\n\n__ https://github.com/openedx/edx-platform\n__ https://github.com/openedx/configuration/wiki/edX-Developer-Stack\n\nThis service relies on Elasticsearch and MongoDB. By default the service will use the Elasticsearch server available at\n`http://localhost:9200` and the MongoDB server available at `localhost:27017`. This is suitable for local development;\nhowever, if you wish to change these values, refer to `config/application.yml` and `config/mongoid.yml` for the\nenvironment variables that can be set to override the defaults.\n\nInstall the requisite gems:\n\n.. code-block:: bash\n\n    $ bundle install\n\nTo initialize indices:\n\nSetup search indices. Note that the command below creates `comments_20161220185820323` and\n`comment_threads_20161220185820323` indices and assigns `comments` and `comment_threads` aliases. This will enable you\nto swap out indices (e.g. rebuild_index) without having to take downtime or modify code with a new index name.\n\n.. code-block:: bash\n\n    $ bin/rake search:initialize\n\nTo validate indices exist and contain the proper mappings:\n\n.. code-block:: bash\n\n    $ bin/rake search:validate_indices\n\nTo rebuild indices:\n\nTo rebuild new indices from the database and then point the aliases `comments` and `comment_threads` to each index\nwhich has equivalent index prefix, you can use the rebuild_indices task. This task will also run catch up before\nand after aliases are moved, to minimize time where aliases do not contain all documents.\n\n.. code-block:: bash\n\n    $ bin/rake search:rebuild_indices\n\nYou can also adjust the batch size (e.g. 200) and the sleep time (e.g. 2 seconds) between batches to lighten the load\non MongoDB.\n\n.. code-block:: bash\n\n    $ bin/rake search:rebuild_indices[200,2]\n\nRun the server:\n\n.. code-block::\n\n    $ ruby app.rb\n\nBy default Sinatra runs on port `4567`. If you'd like to use a different port pass the `-p` parameter:\n\n.. code-block::\n\n    $ ruby app.rb -p 5678\n\nRake timeout configuration should be set as env varaiable, the default value is 15 second. to set to 20 second:\n\n.. code-block::\n\n    $ RACK_TIMEOUT_SERVICE_TIMEOUT=20 ruby app.rb -p 5678\n\nRunning Tests\n-------------\nTests are built using the rspec__ framework, and can be run with the command below:\n\n.. code-block::\n\n    $ bin/rspec\n\nIf you'd like to view additional options for the command, append the `--help` option:\n\n.. code-block::\n\n    $ bin/rspec --help\n\n__ http://rspec.info/\n\n\nRunning Tests with Docker\n-------------------------\nYou can also use docker-compose to run your tests as follows (assuming you have\ndocker-compose installed):\n\n.. code-block::\n\n    $ docker-compose -f .github/docker-compose-ci.yml run --rm test-forum\n\nTo debug the tests using docker-compose, first start up the containers:\n\n.. code-block::\n\n    $ # Note: Ignore errors creating forum_testing container after it was already started\n    $ docker-compose -f .github/docker-compose-ci.yml up\n\nNext, shell into the container:\n\n.. code-block::\n\n    $ docker exec -it forum_testing bash\n\nFinally, from inside the container, start the tests:\n\n.. code-block::\n\n    $ cd /edx/app/forum/cs_comments_service/\n    $ .github/run_tests.sh\n\nTips:\n\n* After running for the first time, you can speed up ``run_tests.sh`` by commenting out ``bundle install`` and ``sleep 10``, which is only needed the first time.\n* Add ``binding.pry`` in code anywhere you want a breakpoint to start debugging.\n\nInternationalization (i18n) and Localization (l10n)\n---------------------------------------------------\n\nTo run the comments service in a language other than English, set the\n``SERVICE_LANGUAGE`` environment variable to the `language code` for the\ndesired language.  Its default value is en-US.\n\nSetting the language has no effect on user content stored by the service.\nHowever, there are a few data validation messages that may be seen by end\nusers via the frontend in edx-platform__.  These will be\ntranslated to ``SERVICE_LANGUAGE`` assuming a suitable translation file is\nfound in the locale/ directory.\n\n__ https://github.com/openedx/edx-platform\n\nedX uses Transifex to host translations. To use the Transifex client, be sure\nit is installed (``pip install transifex-client`` will do this for you), and\nfollow the instructions here__ to set up your ``.transifexrc`` file.\n\n__ http://support.transifex.com/customer/portal/articles/1000855-configuring-the-client\n\nTo upload strings to Transifex for translation when you change the set\nof translatable strings: ``bin/rake i18n:push``\n\nTo fetch the latest translations from Transifex: ``bin/rake i18n:pull``\n\nThe repository includes some translations so they will be available\nupon deployment. To commit an update to these: ``bin/rake i18n:commit``\n\nLicense\n-------\n\nThe code in this repository is licensed under version 3 of the AGPL unless\notherwise noted.\n\nPlease see ``LICENSE.txt`` for details.\n\nHow to Contribute\n-----------------\n\nContributions are very welcome. The easiest way is to fork this repo, and then\nmake a pull request from your fork. The first time you make a pull request, you\nmay be asked to sign a Contributor Agreement.\n\nReporting Security Issues\n-------------------------\n\nPlease do not report security issues in public. Please email security@openedx.org\n\nMailing List and IRC Channel\n----------------------------\n\nYou can discuss this code on the `edx-code Google Group`__ or in the\n``edx-code`` IRC channel on Freenode.\n\n__ https://groups.google.com/forum/#!forum/edx-code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Fcs_comments_service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenedx%2Fcs_comments_service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Fcs_comments_service/lists"}