-
Notifications
You must be signed in to change notification settings - Fork 175
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
Set registration email default to false #6307
Conversation
Oops, looks like I did something wrong... |
Please update the test accordingly. |
2d599b2
to
fb0b827
Compare
I think I have fixed it. I just went with @jonatanklosko's suggestion. Haven't tested if it's working though, as I have never worked with catching emails. |
Updating the file alone has no effect on the database, instead we need a migration. You can see a bunch of past migrations here, you can think of each migration as a script that modifies the actual database. This approach allows for applying changes to the production database, as well as the local database of every developer simply by running new migrations. You can generate a new migration file with Once you write the migration, you can run it locally with When running in Docker, you need to As for verifying the change, it's likely that some tests will fail after changing the database default, so fixing them should be a good indicator. FTR: if you look at the CI build, the tests are already failing and the default is picked up, but that's because the build creates the database directly from |
Do you need any more guidance in writing the migration for this PR? |
I'm not working on this PR at the moment. I'll try to come back to this when my schedule frees up a bit. |
@gregorbg a lot of time has passed since I opened this PR, so I was wondering if this issue has been dealt with elsewhere by now. If not, I'll make the change asap. |
fb0b827
to
55505af
Compare
Please remind me how to run the migration on production. Also am I only meant to do it after this PR is merged? |
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.
The technicalities of your migration content are fine. However, you have to execute the migration locally which will change/affect the structure.sql
file. The changes to that file have to be checked in as part of this PR too, otherwise the CI fails.
Migrations on prod are run manually by me or other Senior Members when deployments are done.
We should probably also announce this in an email to delegates@ because this is a substantial change in competititon workflow. Please prepare a draft in our Google Drive and reference it in a comment here before merging :)
I actually have run the migration locally, but I intentionally avoided committing the changes to structure.sql, as you told me not to do this last time I made a PR with a migration. Are you sure you want me to do it this time? |
c73e97f
to
1348bde
Compare
For the record, Deni's question has been resolved in direct conversation. Gist: Only commit the changes to |
I have created the email draft in our Google Drive. Should I copy the text or paste a link to it? |
7bb641c
to
ba7c26a
Compare
I think I have now fixed the migration |
Please verify that further up in the |
ba7c26a
to
5fdd4da
Compare
@gregorbg good catch, I've fixed it now |
@gregorbg just to make sure I understand correctly, the column defaults don't make a difference since the migration changes the value anyways, right? We're just doing this for the sake of elegance? |
Essentially, yes. The |
Ugh, now the test has to be updated too, cause it's not expecting that value to be 0 |
@gregorbg Okay, I've figured out what the issue is. We have tests that see if after a registration organizers/delegates will receive the email about it. Obviously, because the new default is false, this test fails, cause no email is sent. I can either delete these tests or change them to something else. Please let me know which course of action is better. |
Deleting tests is never a good idea as long as the basic feature they're supposed to test still exists. In this case, the mail sending feature still exists, we just need to take a different route to trigger them. I suggest two things:
|
Uh oh, wrong keybinding. I am very sorry for accidentally closing this. |
e161e0c
to
69d8bd1
Compare
I have looked into the tests and it looks like we actually already have tests that check that no email is sent when the checkbox is set to false, so I don't believe any new tests will be necessary. I will update the existing tests shortly. |
69d8bd1
to
4d47d25
Compare
4d47d25
to
1efcede
Compare
Yes! Finally got the tests to work! Please review. |
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.
Good job on figuring out the tests! LGTM but please don't merge until we can coordinate the deployment + email sendout (reach out on Slack)
* Set receive registration emails default to false * Update tests that check if registration emails are sent to organizers Co-authored-by: Deni <epi27314@protonmail.com>
Addresses issue #4673. This simply sets the default to registration emails for delegates and organizers to false, so that they can opt in to receiving these emails if they so choose.
Please review that I implemented the change correctly.