Enable outbound email on staging.gitlab.com
C4
Production Change - Criticality 4Change Objective | Enable outbound email on staging.gitlab.com |
---|---|
Change Type | ConfigurationChange |
Services Impacted | email on staging |
Change Team Members | @jarv |
Change Severity | C4 |
Change Reviewer or tested in staging | @smcgivern @aamarsanaa |
Dry-run output | If the change is done through a script, it is mandatory to have a dry-run capability in the script, run the change in dry-run mode and output the result |
Due Date | Date and time in UTC timezone for the execution of the change, if possible add the local timezone of the engineer executing the change |
Time tracking | To estimate and record times associated with changes ( including a possible rollback ) |
Overview
In order to properly test mailroom on staging we would like to enable email on staging. Currently it is disabled because the staging database contains customer emails.
Procedure
-
Update the staging database to modify customer emails so that they point to ops-contact+staging-@gitlab.com
ssh jarv-db-primary@console-01-sv-gstg.c.gitlab-staging-1.internal
select count(*) from users where email NOT LIKE '%@gitlab.com';
count
---------
1532148
#### ^^ !! confirm this number to be absolutely sure we are on the staging database !!
UPDATE users
SET email = 'ops-contact+staging-' || id || '@gitlab.com', name = 'username-removed-' || id,
notification_email = 'ops-contact+notif-staging-' || id || '@gitlab.com'
WHERE email NOT LIKE '%@gitlab.com';
UPDATE emails
SET email = 'ops-contact+staging-' || id || '@gitlab.com'
WHERE email NOT LIKE '%@gitlab.com';
-
Disable Email on push service for all projects
ssh jarv-rails@console-01-sv-gstg.c.gitlab-staging-1.internal
EmailsOnPushService.count()
=> 13039
#### ^^ !! confirm this number to be absolutely sure we are on the staging console !!
EmailsOnPushService.update_all(active: false)
PipelinesEmailService.update_all(active: false)
Rollback
Edited by John Jarvis