Skip to content

Commit c28c014

Browse files
authored
fix(client): show a failed request's reason in the run summary
The final "N request(s) did not land" line printed only id=status, so a failure read as "demo-queue/630=error" with no reason — even once the orchestrator began recording one on the request's terminal log. Append the request's last error to each failed entry when it has one, so a watched or scripted run reports why a change did not land, not only that it did not.
1 parent 852b826 commit c28c014

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

submitqueue/client/view.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,11 @@ func summarize(rows []*Row) error {
272272
var failed []string
273273
for _, rw := range rows {
274274
if rw.Status != string(entity.RequestStatusLanded) {
275-
failed = append(failed, fmt.Sprintf("%s=%s", rw.SQID, rw.Status))
275+
entry := fmt.Sprintf("%s=%s", rw.SQID, rw.Status)
276+
if rw.Note != "" {
277+
entry += ": " + rw.Note
278+
}
279+
failed = append(failed, entry)
276280
}
277281
}
278282
if len(failed) > 0 {

submitqueue/client/view_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,12 @@ func TestOutcome(t *testing.T) {
504504
func TestSummarize(t *testing.T) {
505505
assert.NoError(t, summarize([]*Row{{SQID: "q/1", Status: "landed"}}))
506506
assert.Error(t, summarize([]*Row{{SQID: "q/1", Status: "landed"}, {SQID: "q/2", Status: "error"}}))
507+
508+
// A failure reason, when the request carries one, is part of the summary so a
509+
// scripted run reports why rather than only that.
510+
err := summarize([]*Row{{SQID: "q/2", Status: "error", Note: "merge failed: conflict in foo.go"}})
511+
require.Error(t, err)
512+
assert.Contains(t, err.Error(), "q/2=error: merge failed: conflict in foo.go")
507513
}
508514

509515
// TestRowLineAlignment is the column contract: on every row the stage begins at

0 commit comments

Comments
 (0)