Skip to content

Create github repo on course creation #482

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

marslanabdulrauf
Copy link
Contributor

@marslanabdulrauf marslanabdulrauf commented Apr 14, 2025

What are the relevant tickets?

https://github.com/mitodl/hq/issues/6962

Description (What does it do?)

This PR:

  1. Adds signal COURSE_CREATION to create github repo if the feature ENABLE_AUTO_GITHUB_REPO_CREATION is on
  2. If the feature flag is off, remove the giturl when a re-run is created

How can this be tested?

  1. Install and configure ol_openedx_git_auto_export
  2. Make sure to:
    • Enable ENABLE_AUTO_GITHUB_REPO_CREATION
    • Set GITHUB_ORG
    • Set GITHUB_ACCESS_TOKEN -- This token should have repo read/write and pull/push access.
  3. Create a new course
    • Verify if the repo is created in your ORG and have initial commit with empty course
    • Check the giturl setting in advance settings is set properly
    • Check course git repo model in django admin
  4. Create Re-Run: No repository will be created for re-runs now
    - If ENABLE_AUTO_GITHUB_REPO_CREATION is enabled -- verify if a new/different repository is created for re-run
    - else: make sure giturl is cleared from course advance settings
  5. Make changes to either new course or re-run
    • Verify that the changes are uploaded to respective github respository

Testing management command

  1. You must have a course with giturl set in its advance settings -- It shouldn't have gitrepo entry in CourseGitRepo model
  2. Run Management command python manage.py cms mirate_giturl [course_id]
  3. Verify that the giturl is migrate to CourseGitRepo model
  4. Make sure that no url is migrate for re-run courses

@marslanabdulrauf marslanabdulrauf force-pushed the marslan/6962-edx-github-integration branch from d13d4db to 54d6619 Compare April 21, 2025 11:29
@marslanabdulrauf marslanabdulrauf marked this pull request as ready for review April 29, 2025 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant