Improve supervisor change integration #114

Merged
ansv7779 merged 4 commits from supervisor-change-daisy-integration into develop 2025-02-21 00:27:23 +01:00
Owner

Previously when we wanted to change supervisor we had to make two calls against the daisy api.
A DELETE and a POST, this was brittle because if one of the calls failed we didn't have a good way of handling that.
This could leave the application in a state where a project could end up with 2 different supervisors.
This caused side effects and forced us to manually go into the databases and clean up the errors.

Now the daisy api is updated and we only need to do a POST to change the supervisor. See further documentation here
POST /thesis/{id}/contributor

IMPORTANT: Release needs to be synced with Daisy API

Previously when we wanted to change supervisor we had to make two calls against the daisy api. A DELETE and a POST, this was brittle because if one of the calls failed we didn't have a good way of handling that. This could leave the application in a state where a project could end up with 2 different supervisors. This caused side effects and forced us to manually go into the databases and clean up the errors. Now the daisy api is updated and we only need to do a POST to change the supervisor. See further documentation here [POST /thesis/{id}/contributor](https://apitest.dsv.su.se/resource_Theses.html#resource_Theses_postContributor_id_projectParticipant_POST) ### IMPORTANT: Release needs to be synced with Daisy API
niat8586 changed title from Improve supervisor change integration to WIP: Improve supervisor change integration 2025-02-19 10:11:44 +01:00
niat8586 added 1 commit 2025-02-19 10:31:56 +01:00
Updated daisy api xsd
Some checks failed
Build and test / build-and-test (push) Failing after 58s
Deploy to branch.dsv.su.se / deploy (pull_request) Failing after 8m28s
130ab46284
Since daisy api has changed we have to update our xsd.
One of the changes wade is that the api has changed from dateTime -> date

Corrected affected code so it uses LocalDate.
niat8586 self-assigned this 2025-02-19 10:32:22 +01:00
niat8586 added 1 commit 2025-02-20 08:37:18 +01:00
Replace head supervisor
Some checks failed
Build and test / build-and-test (push) Failing after 44s
Deploy to branch.dsv.su.se / deploy (pull_request) Successful in 3m35s
ff2ba01690
updateHeadSupervisor method has been updated to conform with the new daisy api changes.
We no longer need to delete supervisor before replacing (updating).
niat8586 added 1 commit 2025-02-20 08:45:19 +01:00
reformatted code with prettier tooling
All checks were successful
Deploy to branch.dsv.su.se / deploy (pull_request) Successful in 3m27s
Build and test / build-and-test (push) Successful in 16m4s
82c5a7a85a
niat8586 added 1 commit 2025-02-20 11:22:23 +01:00
Refactoring and new test
All checks were successful
Deploy to branch.dsv.su.se / deploy (pull_request) Successful in 3m30s
Build and test / build-and-test (push) Successful in 15m52s
Remove branch deployment from branch.dsv.su.se / cleanup (pull_request) Successful in 15s
9bdd22d91d
Renamed boolean in updateHeadSupervisor method from toAdd -> shouldChange

Added test to cover the branching in updateHeadSupervisor
Owner

Code looks good. Nice to get closer to full java.time utilization by removing usages of java.util.Calendar.

Has this been tested against the new version of Daisy's API and that start date, end date, and supervisor is updated correctly? As in - is this ready for a synced release?

Code looks good. Nice to get closer to full `java.time` utilization by removing usages of `java.util.Calendar`. Has this been tested against the new version of Daisy's API and that start date, end date, and supervisor is updated correctly? As in - is this ready for a synced release?
Author
Owner

Code looks good. Nice to get closer to full java.time utilization by removing usages of java.util.Calendar.

Has this been tested against the new version of Daisy's API and that start date, end date, and supervisor is updated correctly? As in - is this ready for a synced release?

Have not tested with the new version of Daisy's API, i could use some help with doing that.
But the new xsd and date changes where tested in conjunction with #113 . We decided to have those changes in conjunction with this fix instead as per our discussion.

> Code looks good. Nice to get closer to full `java.time` utilization by removing usages of `java.util.Calendar`. > > Has this been tested against the new version of Daisy's API and that start date, end date, and supervisor is updated correctly? As in - is this ready for a synced release? > Have not tested with the new version of Daisy's API, i could use some help with doing that. But the new xsd and date changes where tested in conjunction with #113 . We decided to have those changes in conjunction with this fix instead as per our discussion.
niat8586 changed title from WIP: Improve supervisor change integration to Improve supervisor change integration 2025-02-20 13:44:23 +01:00
Author
Owner

Tested against daisys API seems to work as expected

Tested against daisys API seems to work as expected
ansv7779 approved these changes 2025-02-20 13:49:39 +01:00
ansv7779 merged commit 03570fc6db into develop 2025-02-21 00:27:23 +01:00
ansv7779 deleted branch supervisor-change-daisy-integration 2025-02-21 00:27:24 +01:00
Sign in to join this conversation.
No description provided.