Skip to content
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

[#11878] Fix AccountRequest migration script #12915

Conversation

jayasting98
Copy link
Contributor

Part of #11878

Outline of Solution

Checks if registeredAt is null. If it is, the status is set to APPROVED, otherwise it is set to REGISTERED.

Under the old logic, the admin adds an account request from the Google form responses into TEAMMATES only when the admin approves it. At this point, an account is not created yet, and registeredAt is null, but an email is sent to the instructor with a registration link; this corresponds to the APPROVED status in the new logic. When the instructor clicks on the registration link and registers then the account is created and registeredAt is non-null; this corresponds to the REGISTERED status in the new logic.

For more info, see:

@jayasting98 jayasting98 added s.Ongoing The PR is being worked on by the author(s) c.Task Other non-user-facing works, e.g. refactoring, adding tests labels Mar 19, 2024
@jayasting98 jayasting98 self-assigned this Mar 19, 2024
@jayasting98 jayasting98 marked this pull request as ready for review March 19, 2024 08:57
@jayasting98 jayasting98 added s.ToReview The PR is waiting for review(s) and removed s.Ongoing The PR is being worked on by the author(s) labels Mar 19, 2024
Copy link
Contributor

@EuniceSim142 EuniceSim142 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the work!
Looking at the previous discussion, I agree with you that this might not be necessary. But if we don't plan on removing the migration script after v9-migration is complete, we can just merge this in to ensure correctness.

@jayasting98 jayasting98 added s.FinalReview The PR is ready for final review and removed s.ToReview The PR is waiting for review(s) labels Mar 19, 2024
@ziqing26
Copy link
Contributor

Thanks for the PR, but this change should not be needed as the migration script applies to datastore only. Since ARF project creates the new format of AccountReq in SQL, it should not affect the script.
cc @FergusMok @NicolasCwy Kindly help me double check on this 🙏

@NicolasCwy
Copy link
Contributor

NicolasCwy commented Mar 22, 2024

@ziqing26 @jayasting98 Yes I believe ZQ is right that this isn't needed. The migration scripts was meant to use as a one-off to migrate account requests(and other non-course entities) from Datastore to our SQL database, which should be completed next week.

I'm assuming the account request form feature will only be merged much later? So I think when the time comes you would need to create a migration SQL migration script which modifies the column values directly in the SQL database. Therefore you should not modify this script since the values don't mean anything till the ARF feature is merged

@jayasting98
Copy link
Contributor Author

@ziqing26 @NicolasCwy Cool, thanks. Shall we just close this then?

@NicolasCwy NicolasCwy closed this Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Task Other non-user-facing works, e.g. refactoring, adding tests s.FinalReview The PR is ready for final review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants