Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35af566

Browse files
authored
Merge branch 'release/2.21' into cherry-pick-41726c-release/2.21
2 parents 8ec201b + b8ffc29 commit 35af566

File tree

13 files changed

+266
-555
lines changed

13 files changed

+266
-555
lines changed

coderd/database/dbmem/dbmem.go

-1
Original file line numberDiff line numberDiff line change
@@ -3283,7 +3283,6 @@ func (q *FakeQuerier) GetFailedWorkspaceBuildsByTemplateID(ctx context.Context,
32833283
}
32843284

32853285
workspaceBuildStats = append(workspaceBuildStats, database.GetFailedWorkspaceBuildsByTemplateIDRow{
3286-
WorkspaceID: w.ID,
32873286
WorkspaceName: w.Name,
32883287
WorkspaceOwnerUsername: workspaceOwner.Username,
32893288
TemplateVersionName: templateVersion.Name,

coderd/database/migrations/000316_group_build_failure_notifications.down.sql

-21
This file was deleted.

coderd/database/migrations/000316_group_build_failure_notifications.up.sql

-29
This file was deleted.

coderd/database/queries.sql.go

+4-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/workspacebuilds.sql

-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ SELECT
213213
tv.name AS template_version_name,
214214
u.username AS workspace_owner_username,
215215
w.name AS workspace_name,
216-
w.id AS workspace_id,
217216
wb.build_number AS workspace_build_number
218217
FROM
219218
workspace_build_with_user AS wb

coderd/notifications/notifications_test.go

+27-84
Original file line numberDiff line numberDiff line change
@@ -978,102 +978,45 @@ func TestNotificationTemplates_Golden(t *testing.T) {
978978
UserName: "Bobby",
979979
UserEmail: "[email protected]",
980980
UserUsername: "bobby",
981-
Labels: map[string]string{},
981+
Labels: map[string]string{
982+
"template_name": "bobby-first-template",
983+
"template_display_name": "Bobby First Template",
984+
},
982985
// We need to use floats as `json.Unmarshal` unmarshal numbers in `map[string]any` to floats.
983986
Data: map[string]any{
987+
"failed_builds": 4.0,
988+
"total_builds": 55.0,
984989
"report_frequency": "week",
985-
"templates": []map[string]any{
990+
"template_versions": []map[string]any{
986991
{
987-
"name": "bobby-first-template",
988-
"display_name": "Bobby First Template",
989-
"failed_builds": 4.0,
990-
"total_builds": 55.0,
991-
"versions": []map[string]any{
992+
"template_version_name": "bobby-template-version-1",
993+
"failed_count": 3.0,
994+
"failed_builds": []map[string]any{
992995
{
993-
"template_version_name": "bobby-template-version-1",
994-
"failed_count": 3.0,
995-
"failed_builds": []map[string]any{
996-
{
997-
"workspace_owner_username": "mtojek",
998-
"workspace_name": "workspace-1",
999-
"workspace_id": "24f5bd8f-1566-4374-9734-c3efa0454dc7",
1000-
"build_number": 1234.0,
1001-
},
1002-
{
1003-
"workspace_owner_username": "johndoe",
1004-
"workspace_name": "my-workspace-3",
1005-
"workspace_id": "372a194b-dcde-43f1-b7cf-8a2f3d3114a0",
1006-
"build_number": 5678.0,
1007-
},
1008-
{
1009-
"workspace_owner_username": "jack",
1010-
"workspace_name": "workwork",
1011-
"workspace_id": "1386d294-19c1-4351-89e2-6cae1afb9bfe",
1012-
"build_number": 774.0,
1013-
},
1014-
},
996+
"workspace_owner_username": "mtojek",
997+
"workspace_name": "workspace-1",
998+
"build_number": 1234.0,
1015999
},
10161000
{
1017-
"template_version_name": "bobby-template-version-2",
1018-
"failed_count": 1.0,
1019-
"failed_builds": []map[string]any{
1020-
{
1021-
"workspace_owner_username": "ben",
1022-
"workspace_name": "cool-workspace",
1023-
"workspace_id": "86fd99b1-1b6e-4b7e-b58e-0aee6e35c159",
1024-
"build_number": 8888.0,
1025-
},
1026-
},
1001+
"workspace_owner_username": "johndoe",
1002+
"workspace_name": "my-workspace-3",
1003+
"build_number": 5678.0,
1004+
},
1005+
{
1006+
"workspace_owner_username": "jack",
1007+
"workspace_name": "workwork",
1008+
"build_number": 774.0,
10271009
},
10281010
},
10291011
},
10301012
{
1031-
"name": "bobby-second-template",
1032-
"display_name": "Bobby Second Template",
1033-
"failed_builds": 5.0,
1034-
"total_builds": 50.0,
1035-
"versions": []map[string]any{
1036-
{
1037-
"template_version_name": "bobby-template-version-1",
1038-
"failed_count": 3.0,
1039-
"failed_builds": []map[string]any{
1040-
{
1041-
"workspace_owner_username": "daniellemaywood",
1042-
"workspace_name": "workspace-9",
1043-
"workspace_id": "cd469690-b6eb-4123-b759-980be7a7b278",
1044-
"build_number": 9234.0,
1045-
},
1046-
{
1047-
"workspace_owner_username": "johndoe",
1048-
"workspace_name": "my-workspace-7",
1049-
"workspace_id": "c447d472-0800-4529-a836-788754d5e27d",
1050-
"build_number": 8678.0,
1051-
},
1052-
{
1053-
"workspace_owner_username": "jack",
1054-
"workspace_name": "workworkwork",
1055-
"workspace_id": "919db6df-48f0-4dc1-b357-9036a2c40f86",
1056-
"build_number": 374.0,
1057-
},
1058-
},
1059-
},
1013+
"template_version_name": "bobby-template-version-2",
1014+
"failed_count": 1.0,
1015+
"failed_builds": []map[string]any{
10601016
{
1061-
"template_version_name": "bobby-template-version-2",
1062-
"failed_count": 2.0,
1063-
"failed_builds": []map[string]any{
1064-
{
1065-
"workspace_owner_username": "ben",
1066-
"workspace_name": "more-cool-workspace",
1067-
"workspace_id": "c8fb0652-9290-4bf2-a711-71b910243ac2",
1068-
"build_number": 8878.0,
1069-
},
1070-
{
1071-
"workspace_owner_username": "ben",
1072-
"workspace_name": "less-cool-workspace",
1073-
"workspace_id": "703d718d-2234-4990-9a02-5b1df6cf462a",
1074-
"build_number": 8848.0,
1075-
},
1076-
},
1017+
"workspace_owner_username": "ben",
1018+
"workspace_name": "cool-workspace",
1019+
"build_number": 8888.0,
10771020
},
10781021
},
10791022
},

0 commit comments

Comments
 (0)