-
Notifications
You must be signed in to change notification settings - Fork 937
chore(coderd/notifications): expand golden file testing for notifications #15032
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
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
70f3486
feat(notifications): Improve notification format consistency
SasSwart 7e31a34
chore(coderd/notifications): regenerate notification testdata from th…
SasSwart cf3afd4
Merge remote-tracking branch 'origin/main' into jjs/consistent-notifi…
SasSwart 4b85f2b
chore(coderd/database): renumber migration
SasSwart e8ad3ac
chore(coderd/notifications): regenerate testdata
SasSwart 2a4d740
fix(coderd/notifications): remove duplicate function signature
SasSwart e741c43
chore: remove redundant escaping in migration
SasSwart adffe60
chore(coderd/notifications): improve failed test feedback
SasSwart 41ed54a
feat(coderd/database): add new information to the account activated n…
SasSwart 5541331
Merge remote-tracking branch 'origin/main' into jjs/additional-notifi…
SasSwart fe94f0d
chore(coderd/database): rework migration for legibility
SasSwart 98e7501
feat(coderd): send newly required information to notification templates
SasSwart d8e00c2
feat(coderd/notifications): provide additional context to workspace n…
SasSwart d6a339f
fix(coderd/notifications): add a missing call to fmt.Sprintf
SasSwart 920ad31
fix(coderd/notifications): fix oversights in template migration
SasSwart 9e938e5
chore(coderd/provisionerdserver): set the displayname in TestNotifica…
SasSwart 59e57ac
chore(coderd): add more robust testing assertions to TestNotifyDelete…
SasSwart c907238
chore(coderd/notifications): fix migration indentation
SasSwart 2493556
chore(coderd/notifications): regenerate golden files
SasSwart fc18142
Merge remote-tracking branch 'origin/main' into jjs/consistent-notifi…
SasSwart eccef1c
chore(coderd/notifications): expand golden file testing for notificat…
SasSwart 0036006
chore(coderd/notifications): ensure that notification golden files ar…
SasSwart e9eebf3
chore(coderd/notifications): remove defunct test assertions
SasSwart 78f2787
chore(coderd/notifications): lint notifications_test
SasSwart aa7658b
Merge remote-tracking branch 'origin/main' into jjs/14913
SasSwart 02535bb
feat(coderd/notifications): demonstrate the concept of smtp golden files
SasSwart 7e013d8
chore(coderd/notifications): move mock smtp server into its own package
SasSwart a3b240d
chore(coderd/notifications): new golden files for smtp and wehbook
SasSwart 8989a44
chore(coderd/notifications): replace sleep with require.eventually in…
SasSwart ff18208
Merge remote-tracking branch 'origin/main' into jjs/14913
SasSwart ed91226
chore(coderd/notifications): rename and regenerate notifications files
SasSwart 91e3f94
chore(coderd/notifications): remove defunct test
SasSwart 3430580
chore(coderd/notifications): half the number of db containers needed …
SasSwart 9d47785
chore(coderd/notifications): ensure that all rendered golden files ar…
SasSwart 7ab1664
chore(coderd/notifications): ensure that all rendered golden files ar…
SasSwart 8f3ed16
chore(coderd/notifications): ensure that all rendered golden files ar…
SasSwart ca9b130
fix(coderd/notifications): use consistent labels throughout notificat…
SasSwart ff620e5
exempt notifications testdata from typo checking
SasSwart b08587c
chore(coderd/notifications) TestSMTP
SasSwart 9927434
chore(coderd/notifications) rename mock_smtp package to match linting…
SasSwart f6ef5c4
chore(coderd/notifications) remove a defunct type conversion
SasSwart dadad9f
chore(coderd/notifications) rename mock_smtp package to match linting…
SasSwart f93135a
chore(coderd/notifications): fix golden file test
SasSwart 55e3d02
chore(coderd/notifications): fix linting
SasSwart be00f59
chore(coderd/notifications): fix golden file test
SasSwart 4991c33
chore(coderd/notifications): remove defunct test sleep
SasSwart 464b244
chore(coderd/notifications): rename a test package
SasSwart 3eb9c1e
chore(coderd/notifications): handle test assertions in the correct go…
SasSwart f049c05
chore(coderd/notifications): reformat imports and remove dead code
SasSwart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
coderd/database/migrations/000263_consistent_notification_initiator_naming.down.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
-- UserAccountCreated | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'New user account **{{.Labels.created_account_name}}** has been created.\n\n' || | ||
-- Mention the real name of the user who created the account: | ||
E'This new user account was created for **{{.Labels.created_account_user_name}}** by **{{.Labels.account_creator}}**.' | ||
WHERE | ||
id = '4e19c0ac-94e1-4532-9515-d1801aa283b2'; | ||
|
||
-- UserAccountDeleted | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'User account **{{.Labels.deleted_account_name}}** has been deleted.\n\n' || | ||
-- Mention the real name of the user who deleted the account: | ||
E'The deleted account belonged to **{{.Labels.deleted_account_user_name}}** and was deleted by **{{.Labels.account_deleter_user_name}}**.' | ||
WHERE | ||
id = 'f44d9314-ad03-4bc8-95d0-5cad491da6b6'; | ||
|
||
-- UserAccountSuspended | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
E'User account **{{.Labels.suspended_account_name}}** has been suspended.\n\n' || | ||
-- Mention the real name of the user who suspended the account: | ||
E'The newly suspended account belongs to **{{.Labels.suspended_account_user_name}}** and was suspended by **{{.Labels.account_suspender_user_name}}**.' | ||
WHERE | ||
id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d'; | ||
|
||
-- YourAccountSuspended | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
E'Your account **{{.Labels.suspended_account_name}}** has been suspended by **{{.Labels.account_suspender_user_name}}**.' | ||
WHERE | ||
id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff'; | ||
|
||
|
||
-- UserAccountActivated | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
E'User account **{{.Labels.activated_account_name}}** has been activated.\n\n' || | ||
E'The newly activated account belongs to **{{.Labels.activated_account_user_name}}** and was activated by **{{.Labels.account_activator_user_name}}**.' | ||
WHERE | ||
id = '9f5af851-8408-4e73-a7a1-c6502ba46689'; | ||
|
||
-- YourAccountActivated | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
E'Your account **{{.Labels.activated_account_name}}** has been activated by **{{.Labels.account_activator_user_name}}**.' | ||
WHERE | ||
id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4'; |
57 changes: 57 additions & 0 deletions
57
coderd/database/migrations/000263_consistent_notification_initiator_naming.up.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
-- UserAccountCreated | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'New user account **{{.Labels.created_account_name}}** has been created.\n\n' || | ||
-- Use the conventional initiator label: | ||
E'This new user account was created for **{{.Labels.created_account_user_name}}** by **{{.Labels.initiator}}**.' | ||
WHERE | ||
id = '4e19c0ac-94e1-4532-9515-d1801aa283b2'; | ||
|
||
-- UserAccountDeleted | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || | ||
E'User account **{{.Labels.deleted_account_name}}** has been deleted.\n\n' || | ||
-- Use the conventional initiator label: | ||
E'The deleted account belonged to **{{.Labels.deleted_account_user_name}}** and was deleted by **{{.Labels.initiator}}**.' | ||
WHERE | ||
id = 'f44d9314-ad03-4bc8-95d0-5cad491da6b6'; | ||
|
||
-- UserAccountSuspended | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
E'User account **{{.Labels.suspended_account_name}}** has been suspended.\n\n' || | ||
-- Use the conventional initiator label: | ||
E'The newly suspended account belongs to **{{.Labels.suspended_account_user_name}}** and was suspended by **{{.Labels.initiator}}**.' | ||
WHERE | ||
id = 'b02ddd82-4733-4d02-a2d7-c36f3598997d'; | ||
|
||
-- YourAccountSuspended | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
-- Use the conventional initiator label: | ||
E'Your account **{{.Labels.suspended_account_name}}** has been suspended by **{{.Labels.initiator}}**.' | ||
WHERE | ||
id = '6a2f0609-9b69-4d36-a989-9f5925b6cbff'; | ||
|
||
-- UserAccountActivated | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
E'User account **{{.Labels.activated_account_name}}** has been activated.\n\n' || | ||
-- Use the conventional initiator label: | ||
E'The newly activated account belongs to **{{.Labels.activated_account_user_name}}** and was activated by **{{.Labels.initiator}}**.' | ||
WHERE | ||
id = '9f5af851-8408-4e73-a7a1-c6502ba46689'; | ||
|
||
-- YourAccountActivated | ||
UPDATE notification_templates | ||
SET | ||
body_template = E'Hi {{.UserName}},\n\n' || -- Add a \n | ||
-- Use the conventional initiator label: | ||
E'Your account **{{.Labels.activated_account_name}}** has been activated by **{{.Labels.initiator}}**.' | ||
WHERE | ||
id = '1a6a6bea-ee0a-43e2-9e7c-eabdb53730e4'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.