Give every module of a failed send a verdict, and excuse only the wait a build's own send brought (hq issue 318 review)
This commit is contained in:
@@ -280,6 +280,13 @@ func (k *Keeper) Observe(ctx context.Context, o Observation) (Condition, error)
|
||||
|
||||
// Clear removes a condition an observation says is resolved, and says so. False when none was open.
|
||||
func (k *Keeper) Clear(ctx context.Context, key, why string) (bool, error) {
|
||||
return k.ClearSaying(ctx, key, why, "")
|
||||
}
|
||||
|
||||
// ClearSaying is Clear with the line the operator reads when it clears, in place of the condition's own
|
||||
// resolved line: for a condition that ends because it became another (novox/hq ADR 0254: a module not
|
||||
// working that now waits for a new login is not "working again"). Empty keeps the condition's own.
|
||||
func (k *Keeper) ClearSaying(ctx context.Context, key, why, resolved string) (bool, error) {
|
||||
for i := 0; i < tries; i++ {
|
||||
entry, found, err := k.store.Get(ctx, key)
|
||||
if err != nil {
|
||||
@@ -296,6 +303,9 @@ func (k *Keeper) Clear(ctx context.Context, key, why string) (bool, error) {
|
||||
if err := k.stamp(&c); err != nil {
|
||||
return false, err
|
||||
}
|
||||
if resolved != "" {
|
||||
c.Resolved = resolved
|
||||
}
|
||||
if err := k.store.Delete(ctx, key, entry.Revision); errors.Is(err, ErrMoved) {
|
||||
continue
|
||||
} else if err != nil {
|
||||
|
||||
@@ -152,6 +152,13 @@ type PlanGate struct {
|
||||
// Passing names the modules that passed on their own when the send failed (ADR 0254): each keeps its
|
||||
// pass, and is not put back.
|
||||
Passing []string `json:"passing,omitempty"`
|
||||
// HealthyAt is, per module, when its newest healthy judging was counted: a pass is counted only gateEvery
|
||||
// after the one before (issue 318 review).
|
||||
HealthyAt map[string]time.Time `json:"healthy_at,omitempty"`
|
||||
// Broken names the modules a judging found broken, kept for the rest of the judging, and BrokenWhy the
|
||||
// first reason: the send fails, and the modules beside them are judged to their own verdict first.
|
||||
Broken []string `json:"broken,omitempty"`
|
||||
BrokenWhy string `json:"broken_why,omitempty"`
|
||||
}
|
||||
|
||||
// CarriedMove is one module's build moving on a machine with a gated send.
|
||||
|
||||
Reference in New Issue
Block a user