Skip to content

Commit 630c024

Browse files
committed
naming
1 parent a4f4868 commit 630c024

File tree

5 files changed

+9
-10
lines changed

5 files changed

+9
-10
lines changed

coderd/notifications/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ var (
3030
var (
3131
TemplateTemplateDeleted = uuid.MustParse("29a09665-2a4c-403f-9648-54301670e7be")
3232

33-
TemplateWorkspaceBuildSummary = uuid.MustParse("34a20db2-e9cc-4a93-b0e4-8569699d7a00")
33+
TemplateWorkspaceBuildsFailedReport = uuid.MustParse("34a20db2-e9cc-4a93-b0e4-8569699d7a00")
3434
)

coderd/notifications/notifications_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,8 @@ func TestNotificationTemplatesCanRender(t *testing.T) {
845845
},
846846
},
847847
{
848-
name: "TemplateWorkspaceBuildSummary",
849-
id: notifications.TemplateWorkspaceBuildSummary,
848+
name: "TemplateWorkspaceBuildsFailedReport",
849+
id: notifications.TemplateWorkspaceBuildsFailedReport,
850850
payload: types.MessagePayload{
851851
UserName: "Bobby",
852852
Labels: map[string]string{

coderd/notifications/reports/generator.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ func NewReportGenerator(ctx context.Context, logger slog.Logger, db database.Sto
4343

4444
// TODO:
4545
//
46-
// 1. for every user:
47-
// 1. for every template they administrate:
48-
// 1. for every enabled report:
49-
// 1. check last run `report_generator_log`
50-
// 2. generate report
51-
// 3. send notification
52-
// 4. upsert into `report_generator_log`
46+
// 1. select(workspace_builds_failed): templates + (template admins + users with "write" permissions) + matching entry for `report_generator_log`:
47+
// 1. check last run `report_generator_log`
48+
// 2. generate report
49+
// 3. send notification
50+
// 4. upsert into `report_generator_log`
51+
//
5352
// 2. clean stale `report_generator_log` entries
5453

5554
logger.Info(ctx, "report generator finished", slog.F("duration", clk.Since(start)))

0 commit comments

Comments
 (0)