feat: notifications: report failed workspace builds (#14571)

This commit is contained in:
Marcin Tojek
2024-09-18 09:11:44 +02:00
committed by GitHub
parent 1e5438eadb
commit 6de59371ea
29 changed files with 1545 additions and 55 deletions

View File

@ -174,3 +174,18 @@ SELECT *
FROM notification_templates
WHERE kind = @kind::notification_template_kind
ORDER BY name ASC;
-- name: GetNotificationReportGeneratorLogByTemplate :one
-- Fetch the notification report generator log indicating recent activity.
SELECT
*
FROM
notification_report_generator_logs
WHERE
notification_template_id = @template_id::uuid;
-- name: UpsertNotificationReportGeneratorLog :exec
-- Insert or update notification report generator logs with recent activity.
INSERT INTO notification_report_generator_logs (notification_template_id, last_generated_at) VALUES (@notification_template_id, @last_generated_at)
ON CONFLICT (notification_template_id) DO UPDATE set last_generated_at = EXCLUDED.last_generated_at
WHERE notification_report_generator_logs.notification_template_id = EXCLUDED.notification_template_id;