Commit Graph

6 Commits

Author SHA1 Message Date
Kyle McCormick
42fcfc8217 docs: update CourseGraph README, notably w.r.t. new Tutor plugin
Update the README of the CMS's CourseGraph support app:
* Point to the newly-developed CourseGraph plugin for Tutor,
  and remove some prose that's now redundant with the Tutor
  plugin's README.
* Add a link to the now-public CourseGraph Queries wiki page.
* Capitalize the G in CourseGraph.
* Fix a couple misc. formatting things.
2022-03-29 11:21:20 -04:00
Kyle McCormick
d16fe9d427 feat: add admin action for dump to coursegraph
This introduces two admin actions:
* Dump to CourseGraph (respect cache), and
* Dump to CourseGraph (override cache)

which allow admins to select a collection of courses from Django
admin and dump them to the Neo4j instance specified by
settings.COURSEGRAPH_CONNECTION, with or without respecting
the cache (that is: whether the course has already been dumped
since its last publishing).
2022-03-29 11:21:20 -04:00
Kyle McCormick
d75a32c009 refactor: read course publish date from overview, not block structure
The `get_course_last_published` function is used by CourseGraph to
determine whether or not a course should be dumped to Neo4j.
If the course hasn't been published since it was last dumped to
Neo4j, then it can be skipped (unless the override_cache option
is enabled).

The function was previously built using the BlockStructure
data model. While this worked fine in Production instances that
enable `block_structure.storage_backing_for_cache`, this
implementation did NOT work in development environments,
which do not use the BlockStrcture model.

Instead, we switch to using CourseOverview.modified to
approximate when a course was last published. This is method
has fewer moving parts and is universally available across
instances.
2022-03-29 11:21:20 -04:00
Kyle McCormick
1bf8af5f72 feat: specify dump_to_neo4j defaults in COURSEGRAPH_CONNECTION
Introduce a new CMS settings COURSEGRAPH_CONNECTION,
which allows operators to specify default connection paramters
for a Neo4j instance.

This has three purposes:
* The `./manage.py cms dump_to_neo4j` management command will be
  much easier for developers and operators to type out because connection
  arguments can now be omitted. Note that connection arguments, if
  supplied, will override the arguments specified in CMS settings.
* The automatic push-to-coursegraph-on-publish-signal introduced in
  subsequent commits can use these connection settings.
* The CourseGraph Django admin actions introduced in subsequent
  commits can use these connection settings.
2022-03-29 11:21:20 -04:00
Kyle McCormick
c7693cfa20 docs: enrich dump_to_neo4j help text & docstrings
Move most docs out of docstring and into programatically-
displayable argument help text.

Also, the 'Example Usage' was out of date. This commit updates it to:
 * use `./manage.py cms ...' instead of `./manage.py lms ...', and
 * use `--port` instead of `--https_port`.
2022-03-29 11:21:20 -04:00
Kyle McCormick
8039e40f47 refactor: move coursegraph to cms
This code was originally located at:
  ./openedx/core/djangoapps/coursegraph

However, code makes more sense within the ./cms tree, because:
* it is responsible for publishing course content to an
  external system, with is within the responsibilities of CMS, and
* is uses modulestore, which is discouraged for use in LMS
  (see 0011-limit-modulestore-use-in-lms.rst).

So, we move the code to:
  ./cms/djangoapps/coursegraph
and uninstall coursegraph from LMS.

We do not expect this refactor to have any breaking downstream effects.
2022-03-29 11:21:20 -04:00