Skip to main content

A plugin that auto saves the course OLX to git when an author publishes it

Project description

Installation

For detailed installation instructions, please refer to the plugin installation guide.

Installation required in:

  • Studio (CMS)

Configuration

  • Enable the following FEATURES flags in the config file in Open edX. For any release after Juniper, that config file is /edx/etc/cms.yml. If you’re using private.py, you will need to enable these FEATURES in cms/envs/private.py.

    "FEATURES": {
        "ENABLE_EXPORT_GIT": true,
        "ENABLE_AUTO_GITHUB_REPO_CREATION": true  # Optional, to auto create github repo for new courses
    }
    # Set when ENABLE_AUTO_GITHUB_REPO_CREATION is true
    GITHUB_ORG_API_URL = "https://api.github.com/orgs/<GITHUB_ORG_NAME>"  # For GitHub Enterprise, change the URL accordingly
    GITHUB_ACCESS_TOKEN = "<GITHUB_PERSONAL_ACCESS_TOKEN>"  # Token must have 'repo - Full control of private repositories' permission
  • Set your commit user in cms/envs/common.py, if you don’t want to use the default one

    GIT_EXPORT_DEFAULT_IDENT = {
        'name': 'STUDIO_EXPORT_TO_GIT',
        'email': 'STUDIO_EXPORT_TO_GIT@example.com'
    }
  • Restart the server using make studio-restart on Devstack or tutor dev/local restart openedx on Tutor.

  • For Tutor installations, these values can also be managed through a custom tutor plugin.

Setup github authentication for plugin

If you’re testing from a docker machine running devstack setup github authentication for plugin, you’ll need to generate SSH keys in that machine and add them to your Github account (https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/ - https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account)

Studio/CMS UI settings

  • Open studio admin at /admin/ol_openedx_git_auto_export/contentgitrepository/

  • Add your course_id and in the GIT URL, add your OLX git repo. For example git@github.com:<GITHUB_USERNAME>/edx4edxlite.git.

  • Make a change to the course content and publish.
    • When using Tutor, attach with the CMS container using tutor dev/local start cms and enter yes to the prompt to add the GitHub to known hosts.

    • You should see a new commit in your OLX repo.

    • Commit user should be the one that published the change.

    • If user is not available, it should be the default one set in GIT_EXPORT_DEFAULT_IDENT.

  • Test commit count increase on your OLX repo.

Library Support

This plugin supports automatic git export for both courses and content libraries.

Library v1 (Legacy Libraries)

Library Key Format: library-v1:org+library

Supported Operations:

  • Auto-export on update: When you update/publish a library v1, changes are automatically exported to git

  • Auto-repo creation: Library v1 does NOT have a creation signal in Open edX, so the GitHub repository is automatically created on the first library update signal

Setup for Library v1:

  1. Enable the library feature flags in your config:

    "FEATURES": {
        "ENABLE_GIT_AUTO_LIBRARY_EXPORT": true,
        "ENABLE_AUTO_GITHUB_LIBRARY_REPO_CREATION": true
    }
  2. Make changes to your library and publish

Library v2 (Content Libraries)

Library Key Format: lib:org:slug

Supported Operations:

  • Auto-export on update: When you update a library v2, changes are automatically exported to git

  • Auto-repo creation: When you create a new library v2, a GitHub repository can be automatically created

Setup for Library v2:

  1. Enable the library feature flags in your config:

    "FEATURES": {
        "ENABLE_GIT_AUTO_LIBRARY_EXPORT": true,
        "ENABLE_AUTO_GITHUB_LIBRARY_REPO_CREATION": true
    }
  2. When creating a new library v2, if ENABLE_AUTO_GITHUB_LIBRARY_REPO_CREATION is enabled, a GitHub repository will be created automatically

  3. Updates to the library will be automatically exported to git

Important Notes:

  • Library v1 does not emit a creation signal, so the GitHub repository is automatically created on the first library update

  • Library v2 uses the new event architecture and supports both creation and update signals for immediate repository creation

  • Both library types support automatic git export on updates once configured

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

ol_openedx_git_auto_export-0.8.1.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

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

ol_openedx_git_auto_export-0.8.1-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file ol_openedx_git_auto_export-0.8.1.tar.gz.

File metadata

File hashes

Hashes for ol_openedx_git_auto_export-0.8.1.tar.gz
Algorithm Hash digest
SHA256 a3270950f0cefd7abefbef51ec60ec74dbae7453bff13cd60097846f35fcb88c
MD5 cddf36190b77f15be1b151e0ca9ceadf
BLAKE2b-256 36638e76fc839b6f9d6f073aa36bb1ec1f57a6bb4985912d62cd48d7e4c033b8

See more details on using hashes here.

File details

Details for the file ol_openedx_git_auto_export-0.8.1-py3-none-any.whl.

File metadata

File hashes

Hashes for ol_openedx_git_auto_export-0.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c321c992ee79ace18073fcadda8052edffdabb9a4574b52bcd4ebc0f67a12365
MD5 a6e41b5e39d9068e150f2bcb23f8847e
BLAKE2b-256 3eeb5796ae7f846c3691d64fcd887bd121f0f708851fe4e7e31fb3647f6d9458

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