Enable copying the concept graph from another course as a background job#99
Conversation
|
@copilot Please use the github api to monitor the status of the CI/CD failures, and when you see that one has failed, please take action to get it to pass. In the current case, pitest is failing, meaning we need more test coverage for some backend code that passed tests even after being mutated. Please inspect the pitest results, add more tests as needed. |
Fixed in 36892cc. The pitest report (https://ucsb-cs156.github.io/proj-scaffold/prs/99/pitest/edu.ucsb.cs.scaffold.jobs/CopyConceptGraphJob.java.html) showed 1 surviving mutant: a Added |
|
@copilot You have still not resolved the merge conflicts. Please resolve the merge conflicts. And then, please use the github api to monitor the status of the CI/CD failures, and when you see that one has failed, please take action to get it to pass. |
…oncept-graph-job # Conflicts: # frontend/src/tests/components/Courses/TabComponent/ScaffoldTabComponent.test.jsx # src/main/java/edu/ucsb/cs/scaffold/controller/JobsController.java # src/test/java/edu/ucsb/cs/scaffold/controller/JobsControllerJobsTests.java
Resolved in c16cebb: merged |
Copying a course's concept graph previously required a manual YAML export/import round-trip. This adds a one-click "Copy Concept Graph" action backed by an async job, with permission checks on both the source and destination course.
Backend
CopyConceptGraphJob: new job takinguserId,fromCourseId,toCourseId. Verifies both courses exist and the user has admin/instructor/staff access to both; logs an error and terminates otherwise. Performs the copy in-memory viaConceptYamlService(serializefromcourse to YAML, then import intotocourse) rather than reimplementing the copy logic, so bugs/fixes only need to happen in one place.JobsController: newPOST /api/jobs/launch/copyConceptGraph?fromCourseId=&toCourseId=endpoint,@PreAuthorize-guarded to require manage permissions on both courses.Frontend
ScaffoldTabComponent: new "Copy Concept Graph from Another Course" section with a course selector grouped by Instructor/Staff/Student access, plus an "Admin" group listing every course in the system for admin users (current course excluded from the list).CopyConceptGraphModal: confirmation dialog warning that the action replaces all concept graph content and user state, with "Yes, replace all content" / "No, keep current content" options.useBackendMutationand surfaces the job number in a toast, pointing the user to the Jobs tab to monitor progress.