Skip to content

Support a different instructor per course in repository publishing - #245

Merged
AQIB-NAWAB merged 1 commit into
mainfrom
feat/per-course-instructor
Nov 18, 2026
Merged

AQIB-NAWAB merged 1 commit into
mainfrom
feat/per-course-instructor

Conversation

@AQIB-NAWAB

Copy link
Copy Markdown
Collaborator

The same change as devweekends/Edorax-core#152 (merged), applied to this repository's original of server/scripts/repository-course-publish.ts. publisher/ in Edorax-core is a synced copy of this file (scripts/sync-publisher-from-platform.sh). Without this change, the next sync would overwrite the per-course instructor support there.

What changes

A course can name its own instructor with creatorEmail in its course.yaml. It is then published under, and bound to, that account. Courses without creatorEmail use the default instructor in courses/publishing.yaml, exactly as before. Before this, a creatorEmail that differed from publishing.yaml made the publish check fail with "creatorEmail conflicts with courses/publishing.yaml".

  • Every instructor used in a release is checked first (verified email, Mentor or Admin role, ZIP import enabled). If any is missing, the release stops before any course changes.
  • Ownership binding and imports use the course's own instructor. The previous owner is still kept as COURSE_CREATOR.
  • Learner side: only Course.mentorId and CourseInstructor rows can change, the same rows the release already changes. Releases, progress, pricing and content are untouched. The instructor name shown in the catalog follows the course owner.

Tests

  • 3 new tests in tests/scripts/repository-course-publish.test.ts (default vs own instructor, the transport ZIP carries the course's instructor, distinct instructors are listed once without regard to case). The file passes (14 tests). Type check clean.
  • Seven other test files in tests/scripts fail to run in a fresh checkout. They fail the same way on an unmodified origin/main (same 7 files), so this change does not cause them.
  • The publish path itself was exercised against a scratch database in Edorax-core#152: a course with creatorEmail created under that instructor, others under the default, ownership moved with the old owner kept, and an unknown email stopped the release with no change. This copy has not been run against a database.

Notes

  • This copy of the script is older than the vendored one in Edorax-core (no pricing or versioned publishing yet), so the change was ported by hand, not applied as a patch.
  • Write creatorEmail exactly as the account's email is stored.

A course can name its own instructor with creatorEmail in its course.yaml.
The course is published under, and bound to, that account. A course without
creatorEmail uses the default instructor in courses/publishing.yaml, exactly
as before.

Before this change a creatorEmail that differed from publishing.yaml made the
publish check fail with "creatorEmail conflicts with courses/publishing.yaml".

Every instructor used in a release is checked (verified, Mentor or Admin,
ZIP import enabled) before any course changes, so one missing account stops
the whole release. Ownership binding keeps the previous owner as
COURSE_CREATOR, as before.

Same change as devweekends/Edorax-core#152, which edits the vendored copy of
this script.
@AQIB-NAWAB
AQIB-NAWAB merged commit a878268 into main Nov 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant