Vincent Vielle
95a348ecc7
fix(coderd): improve use case handling in notifier for appearance fetchers ( #15242 )
...
Fixing #15241 & add tests.
2024-10-28 16:53:20 +01:00
Spike Curtis
d9f1aafa94
fix: stop logging errors on cancel in notifier ( #15186 )
...
fixes https://github.com/coder/internal/issues/121
We shouldn't log errors when context is canceled, e.g. on shutdown. This breaks our tests and alarms customers needlessly.
2024-10-25 16:28:54 +04:00
Danielle Maywood
095c9797c9
feat: notify users on template deprecation ( #15195 )
...
Closes https://github.com/coder/coder/issues/15117
Notify users when a template has been deprecated.
2024-10-24 13:12:12 +01:00
Steven Masley
343f8ec9ab
chore: join owner, template, and org in new workspace view ( #15116 )
...
Joins in fields like `username`, `avatar_url`, `organization_name`,
`template_name` to `workspaces` via a **view**.
The view must be maintained moving forward, but this prevents needing to
add RBAC permissions to fetch related workspace fields.
2024-10-22 09:20:54 -05:00
Vincent Vielle and defelmnq
297089e944
feat(coderd): add company logo when available for email notifications ( #14935 )
...
This PR aims to close #14253
We keep the default behavior using the Coder logo if there's no logo
set.
Otherwise we want to use the logo based on the URL set in appearance.
---------
Co-authored-by: defelmnq <yvincent@coder.com >
2024-10-22 14:06:19 +02:00
Danielle Maywood
23f61c68b4
fix: urlencode email in reset password link ( #15167 )
...
Fixes https://github.com/coder/coder/issues/15151
This runs `urlencode` (provided by `text/template`) on the email address
in the link. This ensures the link will work if a user has an email in
the form `user+label@example.com `.
2024-10-21 16:09:59 +01:00
Spike Curtis
29099d4727
chore: refactor notifier to use quartz.TickerFunc ( #15134 )
...
In investigating https://github.com/coder/internal/issues/109 I noticed many of the notification tests are still using `time.Sleep` and `require.Eventually`. This is an initial effort to start converting these to Quartz.
One product change is to switch the `notifier` to use a `TickerFunc` instead of a normal Ticker, since it allows the test to assert that a batch process is complete via the Quartz `Mock` clock. This does introduce one slight behavioral change in that the notifier waits the fetch interval before processing its first batch. In practice, this is inconsequential: no one will notice if we send notifications immediately on startup, or just a little later.
But, it does make a difference to some tests, which are fixed up here.
2024-10-21 12:07:19 +04:00
Spike Curtis
8c8bd3141f
chore: stop creating coderd for notification unit tests ( #15133 )
...
A bunch of notification tests create a whole `coderd`, when all they use is the database and logger. This makes the tests more expensive to run, and pollutes the test logs with a bunch of stuff that doesn't matter (e.g. tailnet).
2024-10-21 10:39:37 +04:00
Bruno Quaresma
aaa1223408
feat(site): add forgot password link ( #15108 )
...
Demo:
https://github.com/user-attachments/assets/139eb8c0-5bd6-4bbd-8064-a4acc526afda
2024-10-18 09:50:22 -03:00
Sas Swart
dfb6bfa4d2
fix(coderd/notifications): exclude unset fields from notifications ( #15110 )
...
This PR will ensure that optional fields are ignored when they are unset
in user account related templates.
2024-10-16 21:53:24 +02:00
Marcin Tojek
416d67ba2c
test: use barrier in TestInflightDispatchesMetric ( #15107 )
...
Fixes: https://github.com/coder/internal/issues/109
2024-10-16 14:12:19 +02:00
Sas Swart
fac77f956e
fix(coderd/notifications): simplify TemplateWorkspaceManualBuildFailed ( #15067 )
...
This PR closes #15065 .
As advised by @mtojek, a template's display name may be set to "", which
is not useful in an email notification. We'd like to provide a friendly
name for the template, but it also needs to be identifiable.
As such, we fall back to template.Name in the case that the template's
display name is empty.
2024-10-15 21:02:02 +02:00
Sas Swart
208ed1efd7
chore(coderd/notifications): expand golden file testing for notifications ( #15032 )
...
This PR aims to close https://github.com/coder/coder/issues/14913 .
It expands the golden files for the notifier to include the entire
payload serialised as JSON.
2024-10-14 12:34:32 +00:00
Sas Swart
9d02269191
feat(coderd/notifications): improve notification format consistency ( #14967 )
...
This Pull request addresses the more trivial items in
https://github.com/coder/coder/issues/14893 .
These were simple formatting changes that I was able to fix despite
limited context.
Some more changes are required for which I will have to dig a bit deeper
into how the template contexts are populated. I'm happy to add those to
this PR or create a subsequent PR.
2024-10-09 17:31:12 -05:00
Danielle Maywood
4369f2b4b5
feat: implement api for "forgot password?" flow ( #14915 )
...
Relates to https://github.com/coder/coder/issues/14232
This implements two endpoints (names subject to change):
- `/api/v2/users/otp/request`
- `/api/v2/users/otp/change-password`
2024-10-04 11:53:25 +01:00
Marcin Tojek
0aa84b18a1
feat: expose Markdown fields in webhook payload ( #14931 )
...
Fixes: https://github.com/coder/coder/issues/14930
2024-10-02 15:38:22 +02:00
Danny Kopping
11f7b1b3f5
chore: remove notifications experiment ( #14869 )
...
Notifications have proved stable in the [mainline release of
v2.15](https://github.com/coder/coder/releases/tag/v2.15.0 ), and in
preparation for v2.16 we're moving this to stable.
2024-10-01 13:43:47 +00:00
Marcin Tojek
20a3801600
fix: use floats in report template ( #14714 )
2024-09-18 11:26:34 +00:00
Marcin Tojek
6de59371ea
feat: notifications: report failed workspace builds ( #14571 )
2024-09-18 09:11:44 +02:00
Joobi S B
3301212972
feat: turn off notification via email ( #14520 )
2024-09-11 11:10:24 -03:00
Marcin Tojek
e6d8f674ad
feat: generate golden files for notification templates ( #14537 )
2024-09-04 18:26:57 +02:00
Danny Kopping
f23a05075e
feat: support optional SMTP auth ( #14533 )
2024-09-03 11:51:34 +02:00
Spike Curtis
0eca1fcb8b
fix: fix TestPendingUpdatesMetric flaky assertion ( #14534 )
2024-09-03 13:47:34 +04:00
Danny Kopping
9596f236c1
fix: use negative deadline to ensure timeout in TestWebhook/timeout ( #14498 )
2024-08-30 16:46:13 +02:00
Danny Kopping
0f414a00d3
fix: restore closing SMTP message on method exit ( #14496 )
2024-08-30 13:03:25 +02:00
Danny Kopping
c90be9b0c1
fix: correctly close SMTP message and await response ( #14495 )
2024-08-30 11:37:50 +02:00
Danny Kopping
f24cb5cc96
fix: prevent test flakiness ( #14467 )
...
Signed-off-by: Danny Kopping <danny@coder.com >
2024-08-28 16:33:27 +02:00
Marcin Tojek
47f2c7d683
feat: notify about manual failed builds ( #14419 )
2024-08-27 14:35:28 +00:00
Danny Kopping
a4d785dec5
chore: use idiomatic test setup in notification tests ( #14416 )
2024-08-23 16:29:27 +02:00
Marcin Tojek
c818b4ddd4
feat: add notification for suspended/activated account ( #14367 )
...
* migrations
* notify
* fix
* TestNotifyUserSuspended
* TestNotifyUserReactivate
* post merge
* fix escape
* TestNotificationTemplatesCanRender
* links and events
* notifyEnq
* findUserAdmins
* notifyUserStatusChanged
* go build
* your and admin
* tests
* refactor
* 247
* Danny's review
2024-08-22 13:52:25 +02:00
Danny Kopping
9c8c6a952d
feat: add notification deduplication trigger ( #14172 )
2024-08-21 11:18:03 +02:00
Bruno Quaresma
10327fb3a9
fix(coderd): humanize duration on notifications ( #14333 )
2024-08-19 15:49:47 -03:00
Bruno Quaresma
6f1951e1c8
feat: add template delete notification ( #14250 )
2024-08-14 14:22:43 -03:00
Bruno Quaresma
27b8f201a4
refactor: refactor notification email template ( #14208 )
2024-08-09 11:25:19 -03:00
Danny Kopping
c6076d2d0d
chore: improve notification template tests' resilience ( #14196 )
2024-08-07 11:33:26 +02:00
Danny Kopping
58428aafce
fix: allow all users to read system notification templates ( #14181 )
2024-08-06 15:37:49 +02:00
Danny Kopping
e164b1e71c
feat: add notification preferences database & audit support ( #14100 )
2024-08-05 16:18:45 +02:00
Marcin Tojek
6428a766a9
feat: notify when a user account is deleted ( #14113 )
2024-08-02 14:56:54 +02:00
Marcin Tojek
cf1fcab514
feat: notify about created user account ( #14010 )
2024-07-30 15:37:45 +02:00
Bruno Quaresma
58b810fb0a
fix: fix dormancy notifications ( #14029 )
2024-07-29 11:20:04 -03:00
Marcin Tojek
d488853393
fix: notifications: use username in workspace URLs ( #14011 )
2024-07-25 12:02:24 +02:00
Bruno Quaresma
0d9615b4fd
feat(coderd): notify when workspace is marked as dormant ( #13868 )
2024-07-24 13:38:21 -03:00
Danny Kopping
695afb80e6
fix: address TestPendingUpdatesMetric flake
2024-07-23 14:39:57 +00:00
Danny Kopping
c88e4162d8
fix: TestPendingUpdatesMetric flake ( #13944 )
...
Signed-off-by: Danny Kopping <danny@coder.com >
2024-07-19 12:54:15 +02:00
Danny Kopping
492ab1cc7e
chore: add webhook tests for notification subsystem ( #13942 )
2024-07-19 12:03:29 +02:00
Danny Kopping
943ea7c52a
feat: add SMTP auth & TLS support ( #13902 )
2024-07-19 09:22:15 +02:00
Garrett Delfosse
f975701b34
feat: add provisioner key cli commands ( #13875 )
2024-07-18 14:44:20 -04:00
Marcin Tojek
91cbe679c0
chore: move notiffake to testutil ( #13933 )
2024-07-18 13:36:02 +00:00
Marcin Tojek
fbd1d7f9a7
feat: notify on successful autoupdate ( #13903 )
2024-07-18 15:19:12 +02:00
Marcin Tojek
a5e4bf38fe
feat: notify owner about failed autobuild ( #13891 )
2024-07-16 10:48:17 +02:00