Skip to content

Commit c907238

Browse files
committed
chore(coderd/notifications): fix migration indentation
1 parent 59e57ac commit c907238

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

coderd/database/migrations/000262_improve_notification_templates.down.sql

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ UPDATE notification_templates
1414
SET
1515
body_template = E'Hi {{.UserName}},\nUser account **{{.Labels.activated_account_name}}** has been activated.'
1616
WHERE
17-
id = '9f5af851-8408-4e73-a7a1-c6502ba46689';
17+
id = '9f5af851-8408-4e73-a7a1-c6502ba46689';
1818

1919
UPDATE notification_templates
2020
SET
@@ -24,13 +24,13 @@ WHERE
2424

2525
UPDATE notification_templates
2626
SET
27-
body_template = E'Hi {{.UserName}},\n\New user account **{{.Labels.created_account_name}}** has been created.'
27+
body_template = E'Hi {{.UserName}},\n\New user account **{{.Labels.created_account_name}}** has been created.'
2828
WHERE
2929
id = '4e19c0ac-94e1-4532-9515-d1801aa283b2';
3030

3131
UPDATE notification_templates
3232
SET
33-
body_template = E'Hi {{.UserName}},\n\nUser account **{{.Labels.deleted_account_name}}** has been deleted.'
33+
body_template = E'Hi {{.UserName}},\n\nUser account **{{.Labels.deleted_account_name}}** has been deleted.'
3434
WHERE
3535
id = 'f44d9314-ad03-4bc8-95d0-5cad491da6b6';
3636

@@ -43,9 +43,10 @@ WHERE
4343

4444
UPDATE notification_templates
4545
SET body_template = E'Hi {{.UserName}}\n' ||
46-
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n' ||
47-
E'Reason for update: **{{.Labels.template_version_message}}**'
48-
WHERE id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b';
46+
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n' ||
47+
E'Reason for update: **{{.Labels.template_version_message}}**'
48+
WHERE
49+
id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b';
4950

5051
UPDATE notification_templates
5152
SET
@@ -55,7 +56,7 @@ WHERE
5556

5657
UPDATE notification_templates
5758
SET
58-
body_template = E'Hi {{.UserName}}\n\nYour workspace **{{.Labels.name}}** was deleted.\nThe specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".'
59+
body_template = E'Hi {{.UserName}}\n\nYour workspace **{{.Labels.name}}** was deleted.\nThe specified reason was "**{{.Labels.reason}}{{ if .Labels.initiator }} ({{ .Labels.initiator }}){{end}}**".'
5960
WHERE
6061
id = 'f517da0b-cdc9-410f-ab89-a86107c420ed';
6162

@@ -78,6 +79,6 @@ WHERE
7879

7980
UPDATE notification_templates
8081
SET
81-
body_template = E'Hi {{.UserName}},\n\nA manual build of the workspace **{{.Labels.name}}** using the template **{{.Labels.template_name}}** failed (version: **{{.Labels.template_version_name}}**).\nThe workspace build was initiated by **{{.Labels.initiator}}**.'
82+
body_template = E'Hi {{.UserName}},\n\nA manual build of the workspace **{{.Labels.name}}** using the template **{{.Labels.template_name}}** failed (version: **{{.Labels.template_version_name}}**).\nThe workspace build was initiated by **{{.Labels.initiator}}**.'
8283
WHERE
8384
id = '2faeee0f-26cb-4e96-821c-85ccb9f71513';

coderd/database/migrations/000262_improve_notification_templates.up.sql

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
UPDATE notification_templates
55
SET
66
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n
7-
E'User account **{{.Labels.suspended_account_name}}** has been suspended.\n\n' ||
7+
E'User account **{{.Labels.suspended_account_name}}** has been suspended.\n\n' ||
88
-- Mention the real name of the user who suspended the account:
9-
E'The newly suspended account belongs to **{{.Labels.suspended_account_user_name}}** and was suspended by **{{.Labels.account_suspender_user_name}}**.'
9+
E'The newly suspended account belongs to **{{.Labels.suspended_account_user_name}}** and was suspended by **{{.Labels.account_suspender_user_name}}**.'
1010
WHERE
1111
id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d';
1212

@@ -15,19 +15,19 @@ UPDATE notification_templates
1515
SET
1616
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n
1717
-- Mention who suspended the account:
18-
E'Your account **{{.Labels.suspended_account_name}}** has been suspended by **{{.Labels.account_suspender_user_name}}**'
18+
E'Your account **{{.Labels.suspended_account_name}}** has been suspended by **{{.Labels.account_suspender_user_name}}**.'
1919
WHERE
2020
id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff';
2121

2222
-- UserAccountActivated
2323
UPDATE notification_templates
2424
SET
2525
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n
26-
E'User account **{{.Labels.activated_account_name}}** has been activated.\n\n' ||
26+
E'User account **{{.Labels.activated_account_name}}** has been activated.\n\n' ||
2727
-- Mention the real name of the user who activated the account:
28-
E'The newly activated account belongs to **{{.Labels.activated_account_user_name}}** and was activated by **{{.Labels.account_activator_user_name}}**.'
28+
E'The newly activated account belongs to **{{.Labels.activated_account_user_name}}** and was activated by **{{.Labels.account_activator_user_name}}**.'
2929
WHERE
30-
id = '9f5af851-8408-4e73-a7a1-c6502ba46689';
30+
id = '9f5af851-8408-4e73-a7a1-c6502ba46689';
3131

3232
-- YourAccountActivated
3333
UPDATE notification_templates
@@ -41,17 +41,17 @@ WHERE
4141
-- UserAccountCreated
4242
UPDATE notification_templates
4343
SET
44-
body_template = E'Hi {{.UserName}},\n\n' ||
44+
body_template = E'Hi {{.UserName}},\n\n' ||
4545
E'New user account **{{.Labels.created_account_name}}** has been created.\n\n' ||
4646
-- Mention the real name of the user who created the account:
47-
E'This new user account was created for **{{.Labels.created_account_user_name}}** by **{{.Labels.account_creator}}**'
47+
E'This new user account was created for **{{.Labels.created_account_user_name}}** by **{{.Labels.account_creator}}**.'
4848
WHERE
4949
id = '4e19c0ac-94e1-4532-9515-d1801aa283b2';
5050

5151
-- UserAccountDeleted
5252
UPDATE notification_templates
5353
SET
54-
body_template = E'Hi {{.UserName}},\n\n' ||
54+
body_template = E'Hi {{.UserName}},\n\n' ||
5555
E'User account **{{.Labels.deleted_account_name}}** has been deleted.\n\n' ||
5656
-- Mention the real name of the user who deleted the account:
5757
E'The deleted account belonged to **{{.Labels.deleted_account_user_name}}** and was deleted by **{{.Labels.account_deleter_user_name}}**.'
@@ -72,8 +72,8 @@ WHERE
7272
UPDATE notification_templates
7373
SET body_template = E'Hi {{.UserName}},\n\n' || -- Add a comma and a \n
7474
-- Add a \n:
75-
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n\n' ||
76-
E'Reason for update: **{{.Labels.template_version_message}}**'
75+
E'Your workspace **{{.Labels.name}}** has been updated automatically to the latest template version ({{.Labels.template_version_name}}).\n\n' ||
76+
E'Reason for update: **{{.Labels.template_version_message}}**.'
7777
WHERE
7878
id = 'c34a0c09-0704-4cac-bd1c-0c0146811c2b';
7979

@@ -119,7 +119,7 @@ WHERE
119119
-- WorkspaceManualBuildFailed
120120
UPDATE notification_templates
121121
SET
122-
body_template = E'Hi {{.UserName}},\n\n' ||
122+
body_template = E'Hi {{.UserName}},\n\n' ||
123123
E'A manual build of the workspace **{{.Labels.name}}** using the template **{{.Labels.template_name}}** failed (version: **{{.Labels.template_version_name}}**).\n\n' ||
124124
-- Mention template display name:
125125
E'The template''s display name was **{{.Labels.template_display_name}}**. ' ||

coderd/notifications/notifications_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ func TestNotificationTemplates_Golden(t *testing.T) {
972972
return
973973
}
974974

975-
hint := "run \"DB=ci make update-golden-files\" and commit the changes"
975+
const hint = "run \"DB=ci make update-golden-files\" and commit the changes"
976976

977977
wantBody, err := os.ReadFile(bodyGoldenFile)
978978
require.NoError(t, err, fmt.Sprintf("missing golden notification body file. %s", hint))

0 commit comments

Comments
 (0)