Give the condition of a merge not heard plain words the operator can act on (ADR 0253, ADR 0457)
mesh/merge-gate head 3c7048f24e55 merged into trunk 1816e8753b07 — pass: builds mesh-controller → novox; no bus step; every machine composes with the chang…
mesh/repo-check head 3c7048f24e55 merged into trunk 1816e8753b07 — pass: its merge-check.sh passed
mesh/delivery delivered
mesh/merge-gate head 3c7048f24e55 merged into trunk 1816e8753b07 — pass: builds mesh-controller → novox; no bus step; every machine composes with the chang…
mesh/repo-check head 3c7048f24e55 merged into trunk 1816e8753b07 — pass: its merge-check.sh passed
mesh/delivery delivered
This commit is contained in:
@@ -544,11 +544,11 @@ func (f following) raiseMergeNotHeard(ctx context.Context, repository, branch st
|
||||
Said: fmt.Sprintf("%s %.8s (pull request %d, head %.8s, merged %s): %s", repository, tm.Commit, m.Number, tm.Head,
|
||||
tm.At.Format(time.RFC3339), reason),
|
||||
Headline: fmt.Sprintf("A merge into %s was never delivered", repository),
|
||||
Explanation: fmt.Sprintf("The merge %.8s into %s was made while the controller did not hear it, and the router holds no "+
|
||||
"Approve of yours for it that the controller can plan it on: %s. It stays open while the merge is among the last %d "+
|
||||
"of the trunk.", tm.Commit, repository, reason, catchUpWindow),
|
||||
Needs: "decide whether it is delivered: build its modules by hand, or leave it",
|
||||
Resolved: "the merge is planned, or is no longer among the last merges of its trunk"}
|
||||
Explanation: fmt.Sprintf("A merge into %s was made while the controller did not hear it, and no Approve of yours for it is on "+
|
||||
"record that the controller can plan it on. It stays open while the merge is among the latest %d merges of that repository. "+
|
||||
"The details say what was looked for.", repository, catchUpWindow),
|
||||
Needs: "decide whether that merge should be delivered, and say so if it should.",
|
||||
Resolved: "the merge is planned, or is no longer among the latest merges of its repository"}
|
||||
if _, err := conditionsFrom.Observe(ctx, o); err != nil {
|
||||
fmt.Printf("catch-up: the condition of %s %.8s could not be kept: %v\n", repository, tm.Commit, err)
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ import (
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/asks"
|
||||
sdkdelivery "git.novox.be/novox/mesh-sdk/go/delivery"
|
||||
|
||||
"github.com/novox/mesh-controller/internal/conditions"
|
||||
"github.com/novox/mesh-controller/internal/link"
|
||||
)
|
||||
|
||||
// The pieces of the catch-up that need no store (novox/hq ADR 0457, issue 1336).
|
||||
@@ -272,3 +275,20 @@ func TestAShortTrunkIsReadWholeAndAnEmptyOneIsNoMerges(t *testing.T) {
|
||||
t.Fatalf("an empty trunk read as %+v %v", got, err)
|
||||
}
|
||||
}
|
||||
|
||||
// ADR 0253: what the operator reads of a merge not heard is plain: no hash, no identifier, nothing to do "by hand".
|
||||
func TestTheConditionOfAMergeNotHeardIsInPlainWords(t *testing.T) {
|
||||
keeper, _ := withConditionsInMemory(t)
|
||||
tm := trunkMerge{Commit: "c0880c4d1f2e3a4b5c6d7e8f9a0b1c2d3e4f5a6b", Head: "b9104454f9a5e0c4d3b2a1f0e9d8c7b6a5948372"}
|
||||
(following{}).raiseMergeNotHeard(t.Context(), "novox/mesh-catalog", "main", tm, link.SourceMoved{Number: 378},
|
||||
"the router holds no chosen merge ask of mesh-delivery-teller or mesh-delivery that covers the head b9104454f9a5")
|
||||
open, err := keeper.Open(t.Context())
|
||||
if err != nil || len(open) != 1 {
|
||||
t.Fatalf("opened %d conditions, %v", len(open), err)
|
||||
}
|
||||
c := open[0]
|
||||
if why, ok := conditions.PlainWords(conditions.Words{Headline: c.Headline, Explanation: c.Explanation, Needs: c.Needs,
|
||||
Resolved: c.Resolved}); !ok {
|
||||
t.Fatalf("the condition's words are not plain: %s\n%q\n%q\n%q", why, c.Headline, c.Explanation, c.Needs)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user