{"id":20037762,"url":"https://github.com/openedx/course-discovery","last_synced_at":"2025-05-16T12:12:41.800Z","repository":{"id":36989312,"uuid":"45866355","full_name":"openedx/course-discovery","owner":"openedx","description":"Service providing access to consolidated course and program metadata","archived":false,"fork":false,"pushed_at":"2025-05-12T10:23:00.000Z","size":43986,"stargazers_count":58,"open_issues_count":22,"forks_count":172,"subscribers_count":75,"default_branch":"master","last_synced_at":"2025-05-12T10:44:43.272Z","etag":null,"topics":["backend-service"],"latest_commit_sha":null,"homepage":"https://edx-discovery.readthedocs.io/en/latest/","language":"Python","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":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-11-09T20:57:54.000Z","updated_at":"2025-05-12T06:54:28.000Z","dependencies_parsed_at":"2023-09-23T13:32:37.417Z","dependency_job_id":"b24c0043-dab6-486b-b936-6ecc85ed449a","html_url":"https://github.com/openedx/course-discovery","commit_stats":null,"previous_names":[],"tags_count":124,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcourse-discovery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcourse-discovery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcourse-discovery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openedx%2Fcourse-discovery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openedx","download_url":"https://codeload.github.com/openedx/course-discovery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254527099,"owners_count":22085919,"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-11-13T10:21:52.960Z","updated_at":"2025-05-16T12:12:36.792Z","avatar_url":"https://github.com/openedx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Course Discovery Service\n###################\n\n| |status-badge| |license-badge| |CI| |Codecov|\n\nService providing access to consolidated course and program metadata.\n\nGetting Started with Development\n********************************\n\nThis repository works with openedx `devstack`_. Once the devstack has been set up and provisioned, run the\nfollowing commands in devstack directory to access Discovery shell and perform operations as needed\n\n.. code-block:: shell\n\n    $ make dev.up.discovery\n    $ make discovery-shell\n    $ make requirements\n    $ make validate\n\n\nUsing elasticsearch locally\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nTo use elasticsearch locally, and to update your index after adding new data that you want elasticsearch to access\nrun:\n\n.. code-block:: shell\n\n    $ ./manage.py update_index --disable-change-limit\n\n\nTo delete elasticsearch old indexes locally you have to use\n\n.. code-block:: shell\n\n    $ ./manage.py remove_unused_indexes\n\nThis command will purge the oldest indexes, freeing up disk space. This command will never delete the currently used indexes.\n\n\nAlso you can use base commands by django-elasticsearch-dsl library.\n\nDelete all the currently used indexes in Elasticsearch:\n\n.. code-block:: shell\n\n    $ ./manage.py search_index --delete [-f] [--models [app[.model] app[.model] ...]]\n\nCreate the indices and their mapping in Elasticsearch:\n\n.. code-block:: shell\n\n    $ ./manage.py search_index --create [--models [app[.model] app[.model] ...]]\n\nPopulate the Elasticsearch mappings with the django models data (index need to be existing):\n\n.. code-block:: shell\n\n    $ ./manage.py search_index --populate [--models [app[.model] app[.model] ...]] [--parallel]\n\nRecreate and repopulate the indices:\n\n.. code-block:: shell\n\n    $ ./manage.py search_index --rebuild [-f] [--models [app[.model] app[.model] ...]] [--parallel]\n\nPlease use the link to get more https://django-elasticsearch-dsl.readthedocs.io/en/latest/management.html\n\n\n**WARNING:** Be aware that `search_index` command works without sanity index check. So be careful to use it.\n\nWorking with memcached locally\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nSome endpoints, such as /api/v1/courses, have their responses cached in memcached through mechanisms such as the\nCompressedCacheResponseMixin. This caching may make it difficult to see code changes reflected in various endpoints\nwithout first clearing the cache or updating the cache keys. You can update the cache keys by going to any\ncourse_metadata model in the admin dashboard and clicking save. To flush your local memcached, make sure the\nedx.devstack.memcached container is up and run:\n\n.. code-block:: shell\n\n    $ telnet localhost 11211\n    $ flush_all\n    $ quit\n\n\nRunning Tests Locally, Fast\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThere is a test settings file ``course_discovery.settings.test_local`` that allows you to persist the test\ndatabase between runs of the unittests (as long as you don't restart your container).  It stores the SQLite\ndatabase file at ``/dev/shm``, which is a filesystem backed by RAM.  Using this test file in conjunction with\npytest's ``--reuse-db`` option can significantly cut down on local testing iteration time.  You can use this\nas follows: ``pytest course_discovery/apps/course_metadata/tests/test_utils.py --ds=course_discovery.settings.test_local --reuse-db``\n\nThe first run will incur the normal cost of database creation (typically around 30 seconds), but the second run\nwill completely skip that startup cost, since the ``--reuse-db`` option causes pytest to use the already persisted\ndatabase in the ``/dev/shm`` directory.  If you need to change models or create databases between runs, you can tell\npytest to recreate the database with ``-recreate-db``.\n\nDebugging Tests Locally\n~~~~~~~~~~~~~~~~~~~~~~~\n\nPytest in this repository uses the `pytest-xdist \u003chttps://github.com/pytest-dev/pytest-xdist\u003e`_ package for distributed testing. This is configured in the `pytest.ini file`_. However, `pytest-xdist does not support pdb.set_trace()`_.\nIn order to use `pdb \u003chttps://docs.python.org/3/library/pdb.html\u003e`_ when debugging Python unit tests, you can use the `pytest-no-xdist.ini file`_ instead. Use the ``-c`` option to the pytest command to specify which ini file to use.\n\nFor example,\n\n.. code-block:: shell\n\n   pytest -c pytest-no-xdist.ini --ds=course_discovery.settings.test --durations=25 course_discovery/apps/publisher/tests/test_views.py::CourseRunDetailTests::test_detail_page_with_comments\n\n.. _pytest.ini file: https://github.com/openedx/course-discovery/blob/master/pytest.ini\n.. _pytest-xdist does not support pdb.set_trace(): https://github.com/pytest-dev/pytest/issues/390#issuecomment-112203885\n.. _pytest-no-xdist.ini file: https://github.com/openedx/course-discovery/blob/master/pytest=no-xdist.ini\n\n\nGetting Help\n*************\n\n`Documentation \u003chttps://edx-discovery.readthedocs.io/en/latest/\u003e`_ is hosted on Read the Docs. The source is hosted in this repo's `docs \u003chttps://github.com/openedx/course-discovery/tree/master/docs\u003e`_ directory. The docs are automatically rebuilt and redeployed when commits are merged to master. To contribute, please open a PR against this repo.\n\nLicense\n*************\n\nThe code in this repository is licensed under version 3 of the AGPL unless otherwise noted. Please see the LICENSE_ file for details.\n\n.. _LICENSE: https://github.com/openedx/course-discovery/blob/master/LICENSE\n\nContributing\n************\n\nContributions are very welcome.\nPlease read `How To Contribute \u003chttps://openedx.org/r/how-to-contribute\u003e`_ for details.\n\nThis project is currently accepting all types of contributions, bug fixes,\nsecurity fixes, maintenance work, or new features.  However, please make sure\nto have a discussion about your new feature idea with the maintainers prior to\nbeginning development to maximize the chances of your change being accepted.\nYou can start a conversation by creating a new issue on this repo summarizing\nyour idea.\n\nThe Open edX Code of Conduct\n****************************\n\nAll community members are expected to follow the `Open edX Code of Conduct`_.\n\n.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/\n\nReporting Security Issues\n**************************\n\n\nPlease do not report security issues in public. Please email security@openedx.org.\n\nMore Help\n*********\n\nIf you're having trouble, we have discussion forums at\n`discuss.openedx.org \u003chttps://discuss.openedx.org\u003e`_ where you can connect with others in the\ncommunity.\n\nOur real-time conversations are on Slack. You can request a `Slack\ninvitation`_, then join our `community Slack workspace`_.\n\nFor anything non-trivial, the best path is to `open an issue`__ in this\nrepository with as many details about the issue you are facing as you\ncan provide.\n\n__ https://github.com/openedx/course-discovery/issues\n\nFor more information about these options, see the `Getting Help`_ page.\n\n.. _Slack invitation: https://openedx.org/slack\n.. _community Slack workspace: https://openedx.slack.com/\n.. _Getting Help: https://openedx.org/getting-help\n.. _devstack: https://github.com/openedx/devstack\n\n.. |CI| image:: https://github.com/openedx/course-discovery/workflows/Python%20CI/badge.svg?branch=master\n    :target: https://github.com/openedx/course-discovery/actions?query=workflow%3A%22Python+CI%22\n    :alt: Test suite status\n\n.. |Codecov| image:: https://codecov.io/github/openedx/course-discovery/coverage.svg?branch=master\n    :target: https://codecov.io/github/openedx/course-discovery?branch=master\n    :alt: Code coverage\n\n.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen\n    :alt: Maintained\n\n.. |license-badge| image:: https://img.shields.io/github/license/openedx/course-discovery.svg\n    :target: https://github.com/openedx/course-discovery/blob/master/LICENSE\n    :alt: License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Fcourse-discovery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenedx%2Fcourse-discovery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenedx%2Fcourse-discovery/lists"}