Skip to content

Commit e258035

Browse files
committed
more
1 parent 6306407 commit e258035

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

coderd/database/migrations/000250_email_reports.up.sql

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ INSERT INTO notification_templates (id, name, title_template, body_template, "gr
22
VALUES ('34a20db2-e9cc-4a93-b0e4-8569699d7a00', 'Report: Workspace Builds Failed For Template', E'Workspace builds failed for template "{{.Labels.template_display_name}}"',
33
E'Hi {{.UserName}},
44
5-
Template **{{.Labels.template_display_name}}** has failed to build {{.Data.failed_builds}}/{{.Data.total_builds}} times over the last {{.Data.report_frequency}} and may be unstable.
5+
Template **{{.Labels.template_display_name}}** has failed to build {{.Data.failed_builds}}/{{.Data.total_builds}} times over the last {{.Data.report_frequency}}.
66
77
**Report:**
88
{{range $version := .Data.template_versions}}
@@ -25,8 +25,7 @@ CREATE TABLE report_generator_logs
2525
notification_template_id uuid NOT NULL,
2626
last_generated_at timestamp with time zone NOT NULL,
2727

28-
PRIMARY KEY (user_id, notification_template_id),
29-
UNIQUE (user_id, notification_template_id)
28+
PRIMARY KEY (user_id, notification_template_id)
3029
);
3130

32-
COMMENT ON TABLE report_generator_logs IS 'Logs with generated reports for users.';
31+
COMMENT ON TABLE report_generator_logs IS 'Log of generated reports for users.';

coderd/notifications/reports/generator.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import (
88
"sort"
99
"time"
1010

11-
"cdr.dev/slog"
12-
"github.com/coder/quartz"
1311
"github.com/google/uuid"
1412
"golang.org/x/xerrors"
1513

14+
"cdr.dev/slog"
15+
"github.com/coder/quartz"
16+
1617
"github.com/coder/coder/v2/coderd/database"
1718
"github.com/coder/coder/v2/coderd/database/dbauthz"
1819
"github.com/coder/coder/v2/coderd/database/dbtime"

coderd/notifications/testdata/rendered-templates/TemplateWorkspaceBuildsFailedReport-body.md.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Hi Bobby,
22

3-
Template **Bobby First Template** has failed to build 4/55 times over the last week and may be unstable.
3+
Template **Bobby First Template** has failed to build 4/55 times over the last week.
44

55
**Report:**
66

0 commit comments

Comments
 (0)