-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#12048] Migrate UpdateStudentAction #12727
[#12048] Migrate UpdateStudentAction #12727
Conversation
…into 12048-migrate-update-student-action
Hi @marquestye, there are alot of merges so try to keep your PR upto date with the base branch when you have time in case of conflicts, so we can catch any errors during the PR review |
…into 12048-migrate-update-student-action
…into 12048-migrate-update-student-action
…into 12048-migrate-update-student-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work but I think there are some clarifications needed on cascading of Student entity to the feedback comments, responses and account
@@ -77,8 +77,8 @@ public static UsersLogic inst() { | |||
} | |||
|
|||
void initLogicDependencies(UsersDb usersDb, AccountsLogic accountsLogic, FeedbackResponsesLogic feedbackResponsesLogic, | |||
FeedbackResponseCommentsLogic feedbackResponseCommentsLogic, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whitespace
feedbackResponsesLogic.updateFeedbackResponsesForChangingEmail(courseId, originalEmail, student.getEmail()); | ||
feedbackResponseCommentsLogic.updateFeedbackResponseCommentsEmails(courseId, originalEmail, student.getEmail()); | ||
|
||
Account originalAccount = originalStudent.getAccount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the previous comment, I think Account and Student emails can be different therefore, the email does not have to be cascaded to account. @wkurniawan07 is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the original code I think this is confused with googleid, which from my understanding was not a field that was brought over to the postgres entity, therefore this cascading is not needed @cedricongjh @weiquu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not only it doesn't have to be cascaded, it must not be cascaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, but also clarifications from the others @cedricongjh would you be able to help take a look at this as well
feedbackResponsesLogic.updateFeedbackResponsesForChangingEmail(courseId, originalEmail, student.getEmail()); | ||
feedbackResponseCommentsLogic.updateFeedbackResponseCommentsEmails(courseId, originalEmail, student.getEmail()); | ||
|
||
Account originalAccount = originalStudent.getAccount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the original code I think this is confused with googleid, which from my understanding was not a field that was brought over to the postgres entity, therefore this cascading is not needed @cedricongjh @weiquu
…into 12048-migrate-update-student-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for working with us through this as you've mentioned in #12779 Hibernate modifies managed entities when we use a setter, so we'll fix that in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work! There are still some nits, but I think it's not critical right now and it can be done separately in the future. Anyway, it looks good overall. 😄
Part of #12048
Outline of solution
UpdateStudentAction
to usesqlLogic
if course is migratedUsersLogic
,FeedbackResponsesLogic
andAccountsLogic
.Todo: