The tracker takes the view's per-repository reached head as it takes the whole-mesh one: a merge at or before it is delivered (issue 1280, ADR 0556 clause 6)
This commit is contained in:
@@ -130,6 +130,25 @@ func TestANewerRevisionCoversTheOlderMergesOfItsRepositoryAsTheForgeSaysAncestry
|
||||
if v, _ := h2.View(n); v.Delivery != "fix merged, not delivered: mesh-catalog#33" {
|
||||
t.Fatalf("another repository's head covered it: %q", v.Delivery)
|
||||
}
|
||||
// 1280 (ADR 0556 clauses 3 and 6): the view's per-repository form, a repository's reached head with no group, delivers the
|
||||
// merges at or before that head and not a later one.
|
||||
h3 := newHarness(t)
|
||||
reached, later := fixIssue(t, h3, "mesh-catalog#34"), fixIssue(t, h3, "mesh-catalog#35")
|
||||
mergedFix(t, h3, 34, "feat/e", "6666666666660000")
|
||||
mergedFix(t, h3, 35, "feat/f", "7777777777770000")
|
||||
h3.Contains = func(_, _, commit, in string) (bool, error) {
|
||||
return commit == "6666666666660000" && in == "8888888888880000", nil
|
||||
}
|
||||
raw, _ := json.Marshal(map[string]any{"revision": 15, "group": "", "repository": "novox/mesh-catalog",
|
||||
"heads": map[string]string{"novox/mesh-catalog": "8888888888880000"}})
|
||||
if err := h3.OnDelivered(stdio.Envelope{Key: DeliveredEvent, Body: raw}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for n, want := range map[uint64]string{reached: "delivered to every machine it should reach", later: "fix merged, not delivered: mesh-catalog#35"} {
|
||||
if v, _ := h3.View(n); v.Delivery != want {
|
||||
t.Errorf("per repository: issue %d reads %q, wanted %q", n, v.Delivery, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A fix kept with only its merged flag (heard through `checks`, or kept before release 6) is matched to a delivered revision
|
||||
|
||||
@@ -429,7 +429,8 @@ const DeliveredEvent = "mesh-delivery-view.delivered"
|
||||
// group moved, or whose merge is the head the revision holds for its repository, reached the machines at that revision. The same
|
||||
// revision twice changes nothing (a delivered fix stays delivered). A fix is matched by the group it merged in, by its own merge
|
||||
// commit, or because its merge is an ancestor of the head the revision holds for its repository (coveredBy): a newer revision
|
||||
// covers the older ones, which the view may never have said.
|
||||
// covers the older ones, which the view may never have said. The view also says each repository's reached head in this form,
|
||||
// with no group and that repository's head alone (novox/hq ADR 0556 clause 3): a merge at or before it is on the machines.
|
||||
func (t *Tracker) OnDelivered(e stdio.Envelope) error {
|
||||
var body struct {
|
||||
Revision uint64 `json:"revision"`
|
||||
|
||||
Reference in New Issue
Block a user