Commit 472230fba4

472230fba4156ecacfe1203513f47e8834dd734f

parent: ed734c0b70

Verified · cmc ci/build: success ci/test: success

cmc <hello@cleberg.net> · 2026-09-18 19:59 UTC

httpd: an unknown build status is never reported as success

Ref #222
internal/httpd/builds.go +8 −1
@@ -108,7 +108,9 @@ func combinedStatus(builds []control.BuildOut) string {
108108
109109// worstStatus is combinedStatus's ordering rule, factored out so the
110110// dashboard feed can apply the same worst-first precedence to a folded
111// build run (D04).
111// build run (D04). A status outside runStatusPriority (a future state
112// such as "skipped") is still not "success": it is returned unchanged
113// rather than falling through and reading as green.
112114func worstStatus(statuses []string) string {
113115 has := map[string]bool{}
114116 for _, s := range statuses {
@@ -119,6 +121,11 @@ func worstStatus(statuses []string) string {
119121 return s
120122 }
121123 }
124 for _, s := range statuses {
125 if s != "success" {
126 return s
127 }
128 }
122129 return "success"
123130}
124131
internal/httpd/builds_test.go +4
@@ -55,6 +55,10 @@ func TestGroupRunsCombinedStatusPriority(t *testing.T) {
5555 {[]string{"running", "cancelled"}, "cancelled"},
5656 {[]string{"cancelled", "failure"}, "failure"},
5757 {[]string{"success", "success", "failure"}, "failure"},
58 // A status outside runStatusPriority (a future state such as
59 // "skipped") is still not success: it must not fall through to
60 // the "success" default and read as green.
61 {[]string{"success", "skipped"}, "skipped"},
5862 }
5963 for _, tc := range cases {
6064 var builds []control.BuildOut