Let a walk wait for its delivery's word, and serve the delivery's owner (hq ADR 0239)
While the mesh-delivery seat has a holder on record, a merge that moves no core module opens its walk and asks nothing until mesh-delivery or a person says go; nothing of it is registered before its turn, so no other send carries it. The controller keeps the planner, the gate, sending and the walk, and gains the verbs the owner asks with: delivery-plan, -order, -check (a group composed as one future state), deliver, delivery-stop, delivery-walks; every walk kept is said as plan-moved.
This commit is contained in:
@@ -289,7 +289,7 @@ func (a *verbArguments) commandLine() ([]string, error) {
|
||||
}
|
||||
return argv, nil
|
||||
}
|
||||
for _, act := range []string{"stop", "close", "retry"} {
|
||||
for _, act := range []string{"stop", "close", "retry", "go"} {
|
||||
if id := str(act); id != "" {
|
||||
argv := []string{"plans", act, id}
|
||||
if act == "retry" {
|
||||
@@ -313,6 +313,58 @@ func (a *verbArguments) commandLine() ([]string, error) {
|
||||
argv = append(argv, "-n", n)
|
||||
}
|
||||
return argv, nil
|
||||
// The delivery's owner's verbs (novox/hq ADR 0239).
|
||||
case "delivery-plan":
|
||||
if err := need("repository", "paths"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
argv := []string{"delivery", "plan", "--repository", str("repository"), "--paths", str("paths")}
|
||||
for _, flag := range []string{"head", "base", "module-dirs", "removed"} {
|
||||
if v := str(flag); v != "" {
|
||||
argv = append(argv, "--"+flag, v)
|
||||
}
|
||||
}
|
||||
return argv, nil
|
||||
case "delivery-order":
|
||||
if err := need("members"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return []string{"delivery", "order", "--members", str("members")}, nil
|
||||
case "delivery-check":
|
||||
if err := need("members"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if g := str("group"); g != "" {
|
||||
return []string{"delivery", "check", "--group", g, "--members", str("members")}, nil
|
||||
}
|
||||
return []string{"delivery", "check", "--members", str("members")}, nil
|
||||
case "deliver":
|
||||
if err := need("plan"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
argv := []string{"delivery", "go", str("plan"), "--by", catalogue.DeliverySeat}
|
||||
if w := str("why"); w != "" {
|
||||
argv = append(argv, "--why", w)
|
||||
}
|
||||
return argv, nil
|
||||
case "delivery-stop":
|
||||
if err := need("plan", "why"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
argv := []string{"delivery", "stop", str("plan"), "--why", str("why")}
|
||||
if b := str("by"); b != "" {
|
||||
argv = append(argv, "--by", catalogue.DeliverySeat+" for "+b)
|
||||
}
|
||||
return argv, nil
|
||||
case "delivery-walks":
|
||||
argv := []string{"delivery", "walks"}
|
||||
if id := str("plan"); id != "" {
|
||||
return append(argv, "--plan", id), nil
|
||||
}
|
||||
if n := str("limit"); n != "" {
|
||||
argv = append(argv, "-n", n)
|
||||
}
|
||||
return argv, nil
|
||||
// The build queue (novox/hq ADR 0219).
|
||||
case "queue":
|
||||
return []string{"queue"}, nil
|
||||
@@ -657,7 +709,9 @@ func (a *verbArguments) commandLine() ([]string, error) {
|
||||
|
||||
// jsonVerbs are the verbs whose command speaks JSON, so the answer carries it as data as well.
|
||||
var jsonVerbs = map[string]bool{"status": true, "seats": true, "plan": true, "collection": true,
|
||||
"hand-acts": true, "durations": true, "conditions": true, "doctor": true, "retire": true, "cleanup": true, "data": true}
|
||||
"hand-acts": true, "durations": true, "conditions": true, "doctor": true, "retire": true, "cleanup": true, "data": true,
|
||||
// The delivery's owner's verbs answer JSON where they read (plan, order, check, walks) — novox/hq ADR 0239.
|
||||
"delivery": true}
|
||||
|
||||
// repairingCommand names a command line that repairs by hand, and so says why: a push, a plan stopped
|
||||
// or closed, a consumer re-made (novox/hq to-be 45 §7). Empty for any other.
|
||||
@@ -665,7 +719,7 @@ func repairingCommand(argv []string) string {
|
||||
switch {
|
||||
case argv[0] == "push":
|
||||
return "push"
|
||||
case argv[0] == "plans" && len(argv) > 1 && (argv[1] == "stop" || argv[1] == "close"):
|
||||
case argv[0] == "plans" && len(argv) > 1 && (argv[1] == "stop" || argv[1] == "close" || argv[1] == "go"):
|
||||
return "plans " + argv[1]
|
||||
case argv[0] == "broker" && len(argv) > 1 && argv[1] == "consumer-reset":
|
||||
return "broker consumer-reset"
|
||||
|
||||
Reference in New Issue
Block a user