Files
coder/coderd/database/migrations/000316_group_build_failure_notifications.down.sql
Danielle Maywood 6dd1056025 feat(coderd/notifications): group workspace build failure report (#17306)
Closes https://github.com/coder/coder/issues/15745

Instead of sending X many reports to a single template admin, we instead
send only 1.
2025-04-10 13:32:19 +01:00

22 lines
1.1 KiB
SQL

UPDATE notification_templates
SET
name = 'Report: Workspace Builds Failed For Template',
title_template = E'Workspace builds failed for template "{{.Labels.template_display_name}}"',
body_template = E'Template **{{.Labels.template_display_name}}** has failed to build {{.Data.failed_builds}}/{{.Data.total_builds}} times over the last {{.Data.report_frequency}}.
**Report:**
{{range $version := .Data.template_versions}}
**{{$version.template_version_name}}** failed {{$version.failed_count}} time{{if gt $version.failed_count 1.0}}s{{end}}:
{{range $build := $version.failed_builds}}
* [{{$build.workspace_owner_username}} / {{$build.workspace_name}} / #{{$build.build_number}}]({{base_url}}/@{{$build.workspace_owner_username}}/{{$build.workspace_name}}/builds/{{$build.build_number}})
{{- end}}
{{end}}
We recommend reviewing these issues to ensure future builds are successful.',
actions = '[
{
"label": "View workspaces",
"url": "{{ base_url }}/workspaces?filter=template%3A{{.Labels.template_name}}"
}
]'::jsonb
WHERE id = '34a20db2-e9cc-4a93-b0e4-8569699d7a00';