A run ask's step says which program it runs, from where, with which arguments, over how many heads (issue 1921)
Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
@@ -118,6 +118,12 @@ func AskWhat(a delivery.StepAsk) string {
|
||||
}
|
||||
case a.Compose != nil:
|
||||
parts = append(parts, "compose", str(a.Compose.Fetch, "repository")+"@"+short(str(a.Compose.Fetch, "commit")))
|
||||
case a.Run != nil:
|
||||
parts = append(parts, "run "+a.Run.Program.Package, a.Run.Program.Repository+"@"+short(a.Run.Program.Commit))
|
||||
if len(a.Run.Args) > 0 {
|
||||
parts = append(parts, strings.Join(a.Run.Args, " "))
|
||||
}
|
||||
parts = append(parts, fmt.Sprintf("%d heads", len(a.Run.Heads)))
|
||||
}
|
||||
return strings.Join(parts, ", ")
|
||||
}
|
||||
|
||||
@@ -159,4 +159,9 @@ func TestAskWhat(t *testing.T) {
|
||||
if got, want := AskWhat(build), "delivery ask, module mesh-x, fp abcdef012345"; got != want {
|
||||
t.Errorf("build = %q", got)
|
||||
}
|
||||
// 1921: a run ask's step names the program, where it is built, its arguments and how many heads it reads.
|
||||
run := delivery.StepAsk{Kind: "check", Run: &delivery.RunJob{Program: delivery.RunProgram{Repository: "novox/mesh-delivery", Commit: "fedcba9876543210", Package: "./cmd/mesh-checking-program"}, Heads: []delivery.RunHead{{}, {}}, Args: []string{"-verdict"}}}
|
||||
if got, want := AskWhat(run), "check ask, run ./cmd/mesh-checking-program, novox/mesh-delivery@fedcba987654, -verdict, 2 heads"; got != want {
|
||||
t.Errorf("run = %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user