From dc9d65524d59c67d66712353ff873e725ecb1590 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 26 Oct 2026 19:08:00 +0100 Subject: [PATCH] A check judged by a build module that reports no programs says so in its status line, still passing: the refusal did not run (issue 1577) --- .../internal/check/binaries.go | 2 ++ .../internal/check/binaries_test.go | 4 ++++ .../internal/check/case.go | 21 ++++++++++++++++++- .../internal/check/line.go | 9 ++++++-- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-checker/internal/check/binaries.go b/modules/mesh-delivery-checker/internal/check/binaries.go index a125367..c81dd29 100644 --- a/modules/mesh-delivery-checker/internal/check/binaries.go +++ b/modules/mesh-delivery-checker/internal/check/binaries.go @@ -23,6 +23,8 @@ func (st *state) checkBinariesOf(t *target) verdictPtr { } if t.fetched.Programs == nil { st.c.note(fmt.Sprintf("%s: %s (%s)", key, NoProgramsReported, t.module)) + st.c.warn(key, fmt.Sprintf("a compiled program is not refused: %s reported no programs", t.module)) + st.j.logf("%s: %s (%s)", key, NoProgramsReported, t.module) return nil } var found []string diff --git a/modules/mesh-delivery-checker/internal/check/binaries_test.go b/modules/mesh-delivery-checker/internal/check/binaries_test.go index 84b63ce..6b9c3b4 100644 --- a/modules/mesh-delivery-checker/internal/check/binaries_test.go +++ b/modules/mesh-delivery-checker/internal/check/binaries_test.go @@ -34,6 +34,10 @@ func TestAChangeWhoseFetchReportsProgramsFailsNamingEachFile(t *testing.T) { // if got := slices.ContainsFunc(cs.Notes(), func(n string) bool { return strings.Contains(n, NoProgramsReported) }); got != c.warned { t.Errorf("%s: warned = %v, want %v (%v)", c.name, got, c.warned, cs.Notes()) } + line := Line(v, cs, cs.Pulls[0], nil, nil, nil) + if got := strings.Contains(line, "a compiled program is not refused: mesh-build-go reported no programs"); got != c.warned { + t.Errorf("%s: the status line holds the warning = %v, want %v: %s", c.name, got, c.warned, line) + } if len(c.fail) == 0 { if v.State != delivery.VerdictPass { t.Errorf("%s: verdict = %+v", c.name, v) diff --git a/modules/mesh-delivery-checker/internal/check/case.go b/modules/mesh-delivery-checker/internal/check/case.go index 169d55e..7215adc 100644 --- a/modules/mesh-delivery-checker/internal/check/case.go +++ b/modules/mesh-delivery-checker/internal/check/case.go @@ -43,7 +43,9 @@ type Case struct { Try *TryOptions notesMu sync.Mutex - notes []string + // warnings are, by pull request, what part of its check did not run (Case.warn). + warnings map[string]string + notes []string // asks are the ids of the asks the check put on the build seats' streams, in order: a try names them (Try.Asks). asks []string // Progress says what the check is doing, so a check that ran past its bound names the step it was stuck at. @@ -186,6 +188,23 @@ func (c *Case) note(s string) { } } +// warn says of a pull request (pullKey) that a part of its check did not run, in words for its status line (issue 1577). +func (c *Case) warn(key, words string) { + c.notesMu.Lock() + defer c.notesMu.Unlock() + if c.warnings == nil { + c.warnings = map[string]string{} + } + c.warnings[key] = words +} + +// Warning is what warn said of a pull request, or "". +func (c *Case) Warning(key string) string { + c.notesMu.Lock() + defer c.notesMu.Unlock() + return c.warnings[key] +} + // Notes are the words noted on the case, in the order they were noted. func (c *Case) Notes() []string { c.notesMu.Lock() diff --git a/modules/mesh-delivery-checker/internal/check/line.go b/modules/mesh-delivery-checker/internal/check/line.go index f09b839..59d2da8 100644 --- a/modules/mesh-delivery-checker/internal/check/line.go +++ b/modules/mesh-delivery-checker/internal/check/line.go @@ -87,18 +87,20 @@ type pieces struct { judged string // carried says, of a carried verdict, the commits it was carried from (ADR 0548 ยง8); never dropped. carried string + // warning says that a part of the check did not run, for instance that an older build module could not refuse a compiled program; never dropped. + warning string } // pullKey names a pull request of a case: `#`. func pullKey(p Pull) string { return fmt.Sprintf("%s#%d", p.Repository, p.Number) } func (p pieces) join(drop int) string { - parts := []string{p.head, p.commits, p.carried, p.counts, p.judged} + parts := []string{p.head, p.commits, p.carried, p.warning, p.counts, p.judged} switch { case drop < 3 && p.times != "": parts = append(parts, p.times) case drop == 3 && p.shortTimes != "": - parts = []string{p.head, p.commits, p.carried, p.shortCounts, p.judged, p.shortTimes} + parts = []string{p.head, p.commits, p.carried, p.warning, p.shortCounts, p.judged, p.shortTimes} } if p.over != "" { parts = append(parts, p.over) @@ -210,6 +212,9 @@ func carriedWords(from map[string]string, v delivery.Verdict, cs *Case, p Pull) func parts(v delivery.Verdict, cs *Case, p Pull, builds []BuildNote, slowest []string, judged map[string]string) pieces { var pc pieces pc.judged = judged[pullKey(p)] + if cs != nil { + pc.warning = cs.Warning(pullKey(p)) + } commits := short12(p.Head) + " on " + short12(p.Trunk) switch v.State { case delivery.VerdictRunning: