-
Notifications
You must be signed in to change notification settings - Fork 6
feat: library export support being added #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
marslanabdulrauf
merged 11 commits into
main
from
marslan/10083-git-auto-export-content-library
May 22, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f95bc04
feat: library export support being added
marslanabdulrauf 918b378
fix: user added for lib v2
marslanabdulrauf 600c981
fix: minor fixes and docs updates
marslanabdulrauf a378c05
fix: migrations fixed from data-migration to renaming model and field
marslanabdulrauf 944a1b8
chore: disable E501 for app.py
marslanabdulrauf f09f31d
fix: created/updated signals replaced with published and some code ch…
marslanabdulrauf a0c9d5a
fix: enums added for course and library with util to get content details
marslanabdulrauf 0fa6bbc
fix: missing migration added, version bump and some docs
marslanabdulrauf 8041b19
fix: replace content_key with context_key
marslanabdulrauf 8be5a16
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 83b98a5
docs: flag scopes updated
marslanabdulrauf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| # Configuration Guide: Feature Flags | ||
|
|
||
| This document describes the available feature flags for controlling git auto-export behavior for courses and libraries. | ||
|
|
||
| ## Feature Flags Overview | ||
|
|
||
| ### Course-Specific Flags | ||
|
|
||
| #### `ENABLE_GIT_AUTO_EXPORT` | ||
| - **Type**: Boolean | ||
| - **Default**: `True` | ||
| - **Purpose**: Controls automatic git export for courses when they are published | ||
| - **Scope**: Courses only | ||
| - **Location**: `settings.FEATURES['ENABLE_GIT_AUTO_EXPORT']` | ||
|
|
||
| **Example**: | ||
| ```python | ||
| FEATURES['ENABLE_GIT_AUTO_EXPORT'] = True | ||
| ``` | ||
|
|
||
| #### `ENABLE_AUTO_GITHUB_REPO_CREATION` | ||
| - **Type**: Boolean | ||
| - **Default**: `False` | ||
| - **Purpose**: Controls automatic GitHub repository creation for new courses | ||
| - **Scope**: Courses only | ||
| - **Location**: `settings.FEATURES['ENABLE_AUTO_GITHUB_REPO_CREATION']` | ||
|
|
||
| **Example**: | ||
| ```python | ||
| FEATURES['ENABLE_AUTO_GITHUB_REPO_CREATION'] = True | ||
| ``` | ||
|
|
||
| ### Library-Specific Flags | ||
|
|
||
| #### `ENABLE_GIT_AUTO_LIBRARY_EXPORT` | ||
| - **Type**: Boolean | ||
| - **Default**: False | ||
| - **Purpose**: Controls automatic git export for libraries when they are updated | ||
| - **Scope**: Libraries only | ||
| - **Location**: `settings.FEATURES['ENABLE_GIT_AUTO_LIBRARY_EXPORT']` | ||
|
|
||
| **Example**: | ||
| ```python | ||
| # Enable library export separately from courses | ||
| FEATURES['ENABLE_GIT_AUTO_LIBRARY_EXPORT'] = True | ||
|
|
||
| # Or disable library export while keeping course export enabled | ||
| FEATURES['ENABLE_GIT_AUTO_EXPORT'] = True | ||
| FEATURES['ENABLE_GIT_AUTO_LIBRARY_EXPORT'] = False | ||
| ``` | ||
|
|
||
| #### `ENABLE_AUTO_GITHUB_LIBRARY_REPO_CREATION` | ||
| - **Type**: Boolean | ||
| - **Default**: False | ||
| - **Purpose**: Controls automatic GitHub repository creation for new libraries | ||
| - **Scope**: Libraries only | ||
| - **Location**: `settings.FEATURES['ENABLE_AUTO_GITHUB_LIBRARY_REPO_CREATION']` | ||
|
|
||
| **Example**: | ||
| ```python | ||
| # Enable library repo creation separately from courses | ||
| FEATURES['ENABLE_AUTO_GITHUB_LIBRARY_REPO_CREATION'] = True | ||
|
|
||
| # Or disable library repo creation while keeping course repo creation enabled | ||
| FEATURES['ENABLE_AUTO_GITHUB_REPO_CREATION'] = True | ||
| FEATURES['ENABLE_AUTO_GITHUB_LIBRARY_REPO_CREATION'] = False | ||
| ``` | ||
|
|
||
| ### Required Settings (for both courses and libraries) | ||
|
|
||
| #### `ENABLE_EXPORT_GIT` | ||
| - **Type**: Boolean | ||
| - **Purpose**: Master switch for git export functionality | ||
| - **Note**: Must be enabled for any git export to work | ||
| - **Location**: `settings.FEATURES['ENABLE_EXPORT_GIT']` | ||
|
|
||
| #### `GITHUB_ORG_API_URL` | ||
| - **Type**: String (URL) | ||
| - **Purpose**: GitHub organization API URL for creating repositories | ||
| - **Example**: `https://api.github.com/orgs/your-org` | ||
| - **Location**: `settings.GITHUB_ORG_API_URL` | ||
|
|
||
| #### `GITHUB_ACCESS_TOKEN` | ||
| - **Type**: String (Token) | ||
| - **Purpose**: GitHub personal access token with repo creation permissions | ||
| - **Location**: `settings.GITHUB_ACCESS_TOKEN` | ||
| - **Security**: Should be stored securely (e.g., environment variable, secrets management) | ||
|
|
||
| #### `GIT_REPO_EXPORT_DIR` | ||
| - **Type**: String (Path) | ||
| - **Purpose**: Directory path for git export operations | ||
| - **Default**: `/openedx/export_course_repos` | ||
| - **Location**: `settings.GIT_REPO_EXPORT_DIR` | ||
|
|
||
| ## Security Considerations | ||
|
|
||
| - **Never commit `GITHUB_ACCESS_TOKEN` to version control** | ||
| - Use environment variables or secrets management | ||
| - Ensure GitHub token has minimum required permissions: | ||
| - `repo` scope for repository creation | ||
| - `write:org` if creating repos in an organization | ||
| - Rotate tokens regularly | ||
| - Use different tokens for different environments (dev/staging/prod) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/ol_openedx_git_auto_export/ol_openedx_git_auto_export/constants.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.