Do not ask the operator to stop a delivery that is already stopped; say what ends it (issue 1581)
This commit is contained in:
@@ -951,6 +951,10 @@ func stalledWords(l stalledLine, o conditions.Observation) (headline, explanatio
|
||||
needs, actions = "release it, or stop it, "+FromMeshMCPServer, []conditions.Action{release, stop}
|
||||
case "ready", "checked":
|
||||
needs = "merge its pull request, or close it."
|
||||
case "stopped":
|
||||
// Already stopped: mesh-delivery.stop refuses it, so neither offer nor ask it (novox/hq issue 1581).
|
||||
// What ends it is the stalled line's own word, such as a later merge that delivers its modules.
|
||||
needs = stoppedNeeds(l)
|
||||
default:
|
||||
needs, actions = "stop it "+FromMeshMCPServer, []conditions.Action{stop}
|
||||
}
|
||||
@@ -960,6 +964,17 @@ func stalledWords(l stalledLine, o conditions.Observation) (headline, explanatio
|
||||
fmt.Sprintf("Delivery of %s is no longer %s", name, held), needs, actions
|
||||
}
|
||||
|
||||
// stoppedNeeds is what ends a delivery that is already stopped, from the stalled line's healer words ("none: a
|
||||
// merge that delivers its modules ends it — the operator's"): the part that says what ends it.
|
||||
func stoppedNeeds(l stalledLine) string {
|
||||
ends := strings.TrimSpace(strings.TrimPrefix(l.H2, "none:"))
|
||||
ends, _, _ = strings.Cut(ends, " — ")
|
||||
if ends == "" {
|
||||
ends = "a later merge that delivers its modules ends it"
|
||||
}
|
||||
return "nothing to stop, it is stopped already: " + ends + "."
|
||||
}
|
||||
|
||||
// unansweredWords are the plain words of a pull request's head whose merge check was asked and has not answered
|
||||
// within its bound (novox/hq issue 438): mesh-delivery holds no delivery of it, so there is nothing to stop, release
|
||||
// or close, and no action is offered. The operator's acts are a new commit, which asks the check again, or a look
|
||||
|
||||
Reference in New Issue
Block a user