Do not add duplicate supervisors in Daisy #26

Merged
tozh4728 merged 3 commits from handle-supervisor-change-failure into develop 2024-12-02 11:28:38 +01:00
Owner

Daisy's API does not support the function "change supervisor" and only what comes down to SQL INSERT and DELETE on a specific table. If the removal of the previous supervisor(s) failed the new one was still added. This change makes it so that if the removal of any (there is no limit in the API) current supervisor fails it will not attempt to add the new supervisor.

Fixes #39

How to test

  1. Configure the Daisy integration in SciPro
  2. Enable it (Maven profile)
  3. The only currently known way to make removing a supervisor fail is to use a project where they've sent the thesis to the examiner
  4. Find one such project in the test server for Daisy (or send one for examination from SciPro)
  5. Change the supervisor of the project in SciPro
  6. Run the job "Export projects to daisy" (System / Maintenance)
  7. See that it logs the failure and that no duplicate supervisors were added to Daisy
Daisy's API does not support the function "change supervisor" and only what comes down to SQL INSERT and DELETE on a specific table. If the removal of the previous supervisor(s) failed the new one was still added. This change makes it so that if the removal of any (there is no limit in the API) current supervisor fails it will not attempt to add the new supervisor. Fixes #39 ## How to test 1. Configure the Daisy integration in SciPro 2. Enable it (Maven profile) 3. The only currently known way to make removing a supervisor fail is to use a project where they've sent the thesis to the examiner 4. Find one such project in the test server for Daisy (or send one for examination from SciPro) 5. Change the supervisor of the project in SciPro 6. Run the job "Export projects to daisy" (System / Maintenance) 7. See that it logs the failure and that no duplicate supervisors were added to Daisy
ansv7779 added 1 commit 2024-11-25 16:39:17 +01:00
Do not add duplicate supervisors in Daisy
All checks were successful
Build and test / build-and-test (push) Successful in 6m49s
f3c4f7aeb8
Daisy's API does not support the function "change supervisor" and only what comes down to SQL INSERT and DELETE on a specific table. If the removal of the previous supervisor(s) failed the new one was still added. This change makes it so that if the removal of any (there is no limit in the API) current supervisor fails it will not attempt to add the new supervisor.
ansv7779 force-pushed handle-supervisor-change-failure from f3c4f7aeb8 to 09cf81d4f3 2024-11-28 18:14:45 +01:00 Compare
tozh4728 reviewed 2024-12-02 08:54:06 +01:00
@ -247,7 +248,20 @@ public class ProjectExporter extends AbstractWorker {
if (contributor.getPerson().getId().equals(project.getHeadSupervisor().getIdentifier())) {
add = false;
Owner

I suggest, while we are still on it, rename the variable from "add" to "toAdd".

I suggest, while we are still on it, rename the variable from "add" to "toAdd".
ansv7779 marked this conversation as resolved
tozh4728 requested review from tozh4728 2024-12-02 08:54:40 +01:00
ansv7779 added 2 commits 2024-12-02 11:17:25 +01:00
Merge branch 'develop' into handle-supervisor-change-failure
All checks were successful
Build and test / build-and-test (push) Successful in 10m0s
a170e829c3
tozh4728 approved these changes 2024-12-02 11:18:45 +01:00
tozh4728 merged commit 03ad12f435 into develop 2024-12-02 11:28:38 +01:00
tozh4728 deleted branch handle-supervisor-change-failure 2024-12-02 11:28:38 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: DMC/scipro#26
No description provided.