INGInious icon indicating copy to clipboard operation
INGInious copied to clipboard

Storing courses and tasks in Git repositories

Open nrybowski opened this issue 7 months ago • 3 comments

This PR lays down the basics for #1059 and related features. For more details, see #1059.

TODO list

Git-based courses and tasks

  • [x] Implement the FileSystemProvider interface for the Git-based FS. > Added with f5bf65c1b329c8070d9d12e0110e2b656b0a1259.
  • [x] Git FSP-based courses. > Added with 93d996b84a24d00ff70c9203285d0176e6590d0f.
  • [x] Git FSP-based tasks.
  • [ ] Initialize sub-module upon task creation.
  • [x] Abstract Gitolite interaction for course or task creation on remote.
  • [x] Remote configuration through INGInious config file.
  • [ ] Handling $common directory.
    • [x] Upon $common directory creation
      • [x] Create course-scoped sub-module. ~- [ ] For each task, create a task-scoped sub-module.~
    • [ ] Upon $common directory update:
      • [ ] Commit changes in the $common directory.
      • [ ] For each task, bump $common sub-module version.
      • [ ] Bump the course-scoped $common sub-module version.
    • [x] Upon task addition, add the $common sub-module.
  • [ ] Version task edition and update course submodule reference.
    • [x] Creation
    • [x] Edition
    • [ ] Deletion
    • [x] Upload
    • [ ] Rename ~- [ ] Handling $i18n directory?~ ~- [ ] Automated signed commit upon task / course modification at the web GUI.~

nrybowski avatar Jul 18 '25 16:07 nrybowski

Open question: How do we handle task migration with common directories?

Suppose we have courseA/task0 and courseB. The first course contains a $common directory: courseA/$common and courseA/task0/$common whose remote origin points towards remote:courseA/$common. courseB does not contain a $common directory.

We migrate courseA/task0 to courseB by adding a courseB/task0 sub-module whose remote still points to remote:courseA/$common. As courseB does not contain a $common directory, we can add courseA/$common submodule to courseB and update remotes from courseB/$common and courseB/task0/$common to remote:courseB/$common.

Now suppose that courseB already contains an unrelated $common sub-module. How do we merge courseA/$common with courseB/$common?

nrybowski avatar Jul 23 '25 11:07 nrybowski

With this push, we moved away from GitPython to leverage pygit2 instead. See https://github.com/INGInious/INGInious/pull/1058#discussion_r2243285240.

nrybowski avatar Jul 30 '25 16:07 nrybowski

After discussing with @anthonygego and @AlexandreDoneux, this PR will remain on hold until the course and task factories are correctly refactored.

nrybowski avatar Sep 12 '25 19:09 nrybowski