@@ -978,45 +978,102 @@ func TestNotificationTemplates_Golden(t *testing.T) {
978
978
UserName : "Bobby" ,
979
979
UserEmail : "bobby@coder.com" ,
980
980
UserUsername : "bobby" ,
981
- Labels : map [string ]string {
982
- "template_name" : "bobby-first-template" ,
983
- "template_display_name" : "Bobby First Template" ,
984
- },
981
+ Labels : map [string ]string {},
985
982
// We need to use floats as `json.Unmarshal` unmarshal numbers in `map[string]any` to floats.
986
983
Data : map [string ]any {
987
- "failed_builds" : 4.0 ,
988
- "total_builds" : 55.0 ,
989
984
"report_frequency" : "week" ,
990
- "template_versions " : []map [string ]any {
985
+ "templates " : []map [string ]any {
991
986
{
992
- "template_version_name" : "bobby-template-version-1" ,
993
- "failed_count" : 3.0 ,
994
- "failed_builds" : []map [string ]any {
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 {
995
992
{
996
- "workspace_owner_username" : "mtojek" ,
997
- "workspace_name" : "workspace-1" ,
998
- "build_number" : 1234.0 ,
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
+ },
999
1015
},
1000
1016
{
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 ,
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
+ },
1009
1027
},
1010
1028
},
1011
1029
},
1012
1030
{
1013
- "template_version_name" : "bobby-template-version-2" ,
1014
- "failed_count" : 1.0 ,
1015
- "failed_builds" : []map [string ]any {
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
+ },
1016
1060
{
1017
- "workspace_owner_username" : "ben" ,
1018
- "workspace_name" : "cool-workspace" ,
1019
- "build_number" : 8888.0 ,
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
+ },
1020
1077
},
1021
1078
},
1022
1079
},
0 commit comments