Files
coder/coderd/notifications/testdata/rendered-templates/webhook/TemplateWorkspaceBuildsFailedReport.json.golden
T
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

124 lines
7.1 KiB
Plaintext

{
"_version": "1.1",
"msg_id": "00000000-0000-0000-0000-000000000000",
"payload": {
"_version": "1.2",
"notification_name": "Report: Workspace Builds Failed",
"notification_template_id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000",
"user_email": "bobby@coder.com",
"user_name": "Bobby",
"user_username": "bobby",
"actions": [
{
"label": "View workspaces",
"url": "http://test.com/workspaces?filter=id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000+id%3A00000000-0000-0000-0000-000000000000"
}
],
"labels": {},
"data": {
"report_frequency": "week",
"templates": [
{
"display_name": "Bobby First Template",
"failed_builds": 4,
"name": "bobby-first-template",
"total_builds": 55,
"versions": [
{
"failed_builds": [
{
"build_number": 1234,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "workspace-1",
"workspace_owner_username": "mtojek"
},
{
"build_number": 5678,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "my-workspace-3",
"workspace_owner_username": "johndoe"
},
{
"build_number": 774,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "workwork",
"workspace_owner_username": "jack"
}
],
"failed_count": 3,
"template_version_name": "bobby-template-version-1"
},
{
"failed_builds": [
{
"build_number": 8888,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "cool-workspace",
"workspace_owner_username": "ben"
}
],
"failed_count": 1,
"template_version_name": "bobby-template-version-2"
}
]
},
{
"display_name": "Bobby Second Template",
"failed_builds": 5,
"name": "bobby-second-template",
"total_builds": 50,
"versions": [
{
"failed_builds": [
{
"build_number": 9234,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "workspace-9",
"workspace_owner_username": "daniellemaywood"
},
{
"build_number": 8678,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "my-workspace-7",
"workspace_owner_username": "johndoe"
},
{
"build_number": 374,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "workworkwork",
"workspace_owner_username": "jack"
}
],
"failed_count": 3,
"template_version_name": "bobby-template-version-1"
},
{
"failed_builds": [
{
"build_number": 8878,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "more-cool-workspace",
"workspace_owner_username": "ben"
},
{
"build_number": 8848,
"workspace_id": "00000000-0000-0000-0000-000000000000",
"workspace_name": "less-cool-workspace",
"workspace_owner_username": "ben"
}
],
"failed_count": 2,
"template_version_name": "bobby-template-version-2"
}
]
}
]
},
"targets": null
},
"title": "Failed workspace builds report",
"title_markdown": "Failed workspace builds report",
"body": "The following templates have had build failures over the last week:\n\nBobby First Template failed to build 4/55 times\nBobby Second Template failed to build 5/50 times\n\nReport:\n\nBobby First Template\n\nbobby-template-version-1 failed 3 times:\n mtojek / workspace-1 / #1234 (http://test.com/@mtojek/workspace-1/builds/1234)\n johndoe / my-workspace-3 / #5678 (http://test.com/@johndoe/my-workspace-3/builds/5678)\n jack / workwork / #774 (http://test.com/@jack/workwork/builds/774)\nbobby-template-version-2 failed 1 time:\n ben / cool-workspace / #8888 (http://test.com/@ben/cool-workspace/builds/8888)\n\n\nBobby Second Template\n\nbobby-template-version-1 failed 3 times:\n daniellemaywood / workspace-9 / #9234 (http://test.com/@daniellemaywood/workspace-9/builds/9234)\n johndoe / my-workspace-7 / #8678 (http://test.com/@johndoe/my-workspace-7/builds/8678)\n jack / workworkwork / #374 (http://test.com/@jack/workworkwork/builds/374)\nbobby-template-version-2 failed 2 times:\n ben / more-cool-workspace / #8878 (http://test.com/@ben/more-cool-workspace/builds/8878)\n ben / less-cool-workspace / #8848 (http://test.com/@ben/less-cool-workspace/builds/8848)\n\n\nWe recommend reviewing these issues to ensure future builds are successful.",
"body_markdown": "The following templates have had build failures over the last week:\n\n- **Bobby First Template** failed to build 4/55 times\n\n- **Bobby Second Template** failed to build 5/50 times\n\n\n**Report:**\n\n**Bobby First Template**\n\n- **bobby-template-version-1** failed 3 times:\n\n - [mtojek / workspace-1 / #1234](http://test.com/@mtojek/workspace-1/builds/1234)\n\n - [johndoe / my-workspace-3 / #5678](http://test.com/@johndoe/my-workspace-3/builds/5678)\n\n - [jack / workwork / #774](http://test.com/@jack/workwork/builds/774)\n\n\n- **bobby-template-version-2** failed 1 time:\n\n - [ben / cool-workspace / #8888](http://test.com/@ben/cool-workspace/builds/8888)\n\n\n\n**Bobby Second Template**\n\n- **bobby-template-version-1** failed 3 times:\n\n - [daniellemaywood / workspace-9 / #9234](http://test.com/@daniellemaywood/workspace-9/builds/9234)\n\n - [johndoe / my-workspace-7 / #8678](http://test.com/@johndoe/my-workspace-7/builds/8678)\n\n - [jack / workworkwork / #374](http://test.com/@jack/workworkwork/builds/374)\n\n\n- **bobby-template-version-2** failed 2 times:\n\n - [ben / more-cool-workspace / #8878](http://test.com/@ben/more-cool-workspace/builds/8878)\n\n - [ben / less-cool-workspace / #8848](http://test.com/@ben/less-cool-workspace/builds/8848)\n\n\n\n\nWe recommend reviewing these issues to ensure future builds are successful."
}