mesh-grants moves to the same mesh-sdk (3203358c), so its shadow user list grants the checker and the builder the DEAD_LETTERS reads the controller's list will, and the take-over is not blocked by a difference. The checker and the builder hear DEAD_LETTERS through buildrun.DeadLetterHearing: in the background, again at every reconnect and every ask waited for while deaf, and keep whether they hear it in their new state hearing, which checker_status and builder_stuck say as dead_letters. checker_try says that a try ended by the not-taken bound leaves its ask in the stream. Not done as asked: a module health tool. The catalogue refuses a tool check on a module with no runtime of its own and no other check beside it (ADR 0227 rule 8, ADR 0366 §1), so the deaf state is said in the status tools and the log.
35 lines
1.9 KiB
Go
35 lines
1.9 KiB
Go
package check
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/delivery"
|
|
"git.novox.be/novox/mesh-sdk/go/delivery/buildrun"
|
|
)
|
|
|
|
// **An ask the build seat gave up on ends its step** (novox/hq issue 734): mesh-sdk buildrun.LostAskWaiter hands the
|
|
// waiting asker a failed step on the node buildrun.LostNode when DEAD_LETTERS keeps the ask's copy (buildrun.HearDeadLetters,
|
|
// granted by buscompose DeadLetterReads), and, under buildrun.NotTakenBound, when no build node took the ask within the
|
|
// bound. What follows is the checker's: a try ends as error (Tryer.run), with the not-taken bound at the step bound
|
|
// (Tryer.NotTaken); a check is asked again under its claim, at most LostAskTries times, then fails as not heard and is
|
|
// judged again when the nodes change (Checker.try). A check's ask has no not-taken bound: it waits in the stream as long as
|
|
// the backlog is (ADR 0525 §9), and a check ended for a backlog would owe its pull request a failure.
|
|
|
|
// LostAskTries is how often a check asks again whose ask was given up, before it fails as not heard (UnheardWords) and is
|
|
// judged again when the nodes change.
|
|
const LostAskTries = 3
|
|
|
|
// IsLostAsk says whether a verdict failed because the build seat gave its ask up (buildrun.LostWords).
|
|
func IsLostAsk(v delivery.Verdict) bool {
|
|
return v.State == delivery.VerdictFail && strings.Contains(v.Failed.Words, buildrun.LostWords)
|
|
}
|
|
|
|
// IsNotTaken says whether a verdict failed because no build node took its ask within the bound (buildrun.NotTakenWords).
|
|
func IsNotTaken(v delivery.Verdict) bool {
|
|
return v.State == delivery.VerdictFail && strings.Contains(v.Failed.Words, buildrun.NotTakenWords)
|
|
}
|
|
|
|
// HearingBucket is the checker's state hearing: whether it hears DEAD_LETTERS (buildrun.Hearing under
|
|
// buildrun.HearingKey), which checker_status says (dead_letters).
|
|
const HearingBucket = delivery.CheckerModule + "_" + buildrun.HearingState
|