Skip to content

Commit e252093

Browse files
make gen/golden-files
1 parent 2dea5ab commit e252093

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed

coderd/notifications/notifications_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,22 @@ func TestNotificationTemplates_Golden(t *testing.T) {
12501250
},
12511251
},
12521252
},
1253+
{
1254+
name: "PrebuildFailureLimitReached",
1255+
id: notifications.PrebuildFailureLimitReached,
1256+
payload: types.MessagePayload{
1257+
UserName: "Bobby",
1258+
UserEmail: "bobby@coder.com",
1259+
UserUsername: "bobby",
1260+
Labels: map[string]string{
1261+
"org": "cern",
1262+
"template": "docker",
1263+
"template_version": "angry_torvalds",
1264+
"preset": "particle-accelerator",
1265+
},
1266+
Data: map[string]any{},
1267+
},
1268+
},
12531269
}
12541270

12551271
// We must have a test case for every notification_template. This is enforced below:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
From: system@coder.com
2+
To: bobby@coder.com
3+
Subject: There is a problem creating prebuilt workspaces for the preset
4+
Message-Id: 02ee4935-73be-4fa1-a290-ff9999026b13@blush-whale-48
5+
Date: Fri, 11 Oct 2024 09:03:06 +0000
6+
Content-Type: multipart/alternative; boundary=bbe61b741255b6098bb6b3c1f41b885773df633cb18d2a3002b68e4bc9c4
7+
MIME-Version: 1.0
8+
9+
--bbe61b741255b6098bb6b3c1f41b885773df633cb18d2a3002b68e4bc9c4
10+
Content-Transfer-Encoding: quoted-printable
11+
Content-Type: text/plain; charset=UTF-8
12+
13+
Hi Bobby,
14+
15+
The number of failed prebuilds has reached the hard limit for template **do=
16+
cker** and preset **particle-accelerator**
17+
18+
19+
--bbe61b741255b6098bb6b3c1f41b885773df633cb18d2a3002b68e4bc9c4
20+
Content-Transfer-Encoding: quoted-printable
21+
Content-Type: text/html; charset=UTF-8
22+
23+
<!doctype html>
24+
<html lang=3D"en">
25+
<head>
26+
<meta charset=3D"UTF-8" />
27+
<meta name=3D"viewport" content=3D"width=3Ddevice-width, initial-scale=
28+
=3D1.0" />
29+
<title>There is a problem creating prebuilt workspaces for the preset</=
30+
title>
31+
</head>
32+
<body style=3D"margin: 0; padding: 0; font-family: -apple-system, system-=
33+
ui, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarel=
34+
l', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; color: #020617=
35+
; background: #f8fafc;">
36+
<div style=3D"max-width: 600px; margin: 20px auto; padding: 60px; borde=
37+
r: 1px solid #e2e8f0; border-radius: 8px; background-color: #fff; text-alig=
38+
n: left; font-size: 14px; line-height: 1.5;">
39+
<div style=3D"text-align: center;">
40+
<img src=3D"https://coder.com/coder-logo-horizontal.png" alt=3D"Cod=
41+
er Logo" style=3D"height: 40px;" />
42+
</div>
43+
<h1 style=3D"text-align: center; font-size: 24px; font-weight: 400; m=
44+
argin: 8px 0 32px; line-height: 1.5;">
45+
There is a problem creating prebuilt workspaces for the preset
46+
</h1>
47+
<div style=3D"line-height: 1.5;">
48+
<p>Hi Bobby,</p>
49+
<pre><code> The number of failed prebuilds has reached the hard li=
50+
mit for template **docker** and preset **particle-accelerator**
51+
</code></pre>
52+
</div>
53+
<div style=3D"text-align: center; margin-top: 32px;">
54+
=20
55+
</div>
56+
<div style=3D"border-top: 1px solid #e2e8f0; color: #475569; font-siz=
57+
e: 12px; margin-top: 64px; padding-top: 24px; line-height: 1.6;">
58+
<p>&copy;&nbsp;2024&nbsp;Coder. All rights reserved&nbsp;-&nbsp;<a =
59+
href=3D"http://test.com" style=3D"color: #2563eb; text-decoration: none;">h=
60+
ttp://test.com</a></p>
61+
<p><a href=3D"http://test.com/settings/notifications" style=3D"colo=
62+
r: #2563eb; text-decoration: none;">Click here to manage your notification =
63+
settings</a></p>
64+
<p><a href=3D"http://test.com/settings/notifications?disabled=3D414=
65+
d9331-c1fc-4761-b40c-d1f4702279eb" style=3D"color: #2563eb; text-decoration=
66+
: none;">Stop receiving emails like this</a></p>
67+
</div>
68+
</div>
69+
</body>
70+
</html>
71+
72+
--bbe61b741255b6098bb6b3c1f41b885773df633cb18d2a3002b68e4bc9c4--
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"_version": "1.1",
3+
"msg_id": "00000000-0000-0000-0000-000000000000",
4+
"payload": {
5+
"_version": "1.2",
6+
"notification_name": "Prebuild Failure Limit Reached",
7+
"notification_template_id": "00000000-0000-0000-0000-000000000000",
8+
"user_id": "00000000-0000-0000-0000-000000000000",
9+
"user_email": "bobby@coder.com",
10+
"user_name": "Bobby",
11+
"user_username": "bobby",
12+
"actions": [],
13+
"labels": {
14+
"org": "cern",
15+
"preset": "particle-accelerator",
16+
"template": "docker",
17+
"template_version": "angry_torvalds"
18+
},
19+
"data": {},
20+
"targets": null
21+
},
22+
"title": "There is a problem creating prebuilt workspaces for the preset",
23+
"title_markdown": "There is a problem creating prebuilt workspaces for the preset",
24+
"body": "The number of failed prebuilds has reached the hard limit for template **docker** and preset **particle-accelerator**",
25+
"body_markdown": "\n\t\t\tThe number of failed prebuilds has reached the hard limit for template **docker** and preset **particle-accelerator**\n\t\t"
26+
}

0 commit comments

Comments
 (0)