diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr350_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr350_test.go index 05075466..9aba0cd9 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr350_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/adr350_test.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "strings" "testing" "time" @@ -10,14 +9,15 @@ import ( // One build per change (novox/hq ADR 0350): a pull request closed unmerged has its check builds let go of, and a // walk's record says per module whether its build reused a check's build or built, and why. -// A pull request closed unmerged asks the controller to let go of what its checks built for its merge (§5); one -// the controller cannot answer is said, never fatal. -func TestAPullRequestClosedUnmergedLetsGoOfItsCheckBuilds(t *testing.T) { +// A pull request closed unmerged is stopped. Since issue 1318 (ADR 0503 §3) the controller is no longer asked to let go +// of what its checks built (§5's forget-checks goes with the merge gate's checks); a controller that is down changes +// nothing. +func TestAPullRequestClosedUnmergedIsStoppedAndAsksTheControllerNothing(t *testing.T) { w := newWorldOver(t, newMemStore(), newFakeController(), newFakeForge(), atCC) cc := pr(cat, 101, headCC, "feat/claude-code", "modules/claude-code/module.json") w.h.PullUpdated(cc) w.h.PullClosed(cc) - if want := []string{"novox/mesh-catalog#101"}; !reflect.DeepEqual(w.ctl.forgot, want) { + if len(w.ctl.forgot) != 0 { t.Fatalf("closed unmerged, the controller was asked to let go of %v", w.ctl.forgot) } if s := w.state(IDOf(cat, headCC)); s != Stopped { diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/holder.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/holder.go index b3660c23..55e7cbdb 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/holder.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/holder.go @@ -864,9 +864,8 @@ func verdictOfState(s string) string { // PullClosed takes a pull request closed unmerged: its open deliveries are stopped. // -// **And what its checks built for its merge goes** (novox/hq ADR 0350 §5): nothing will take it now. Asked of the -// controller once the deliveries are settled, outside the lock; a refusal is said, and the build seat's holders let -// go of it within the week anyway. +// What its checks built is no longer asked to be let go of here (issue 1318): the controller's forget-checks goes with +// the merge gate's checks (ADR 0503 §3), and the build seat's holders let go of it within the week. func (h *Holder) PullClosed(p PullEvent) { h.mu.Lock() h.forgetUnchecked(p.Owner, p.Repo, p.Number) @@ -903,15 +902,6 @@ func (h *Holder) PullClosed(p PullEvent) { h.pullUpdated(*over) } h.mu.Unlock() - if h.Controller == nil || p.Owner == "" || p.Repo == "" || p.Number <= 0 { - return - } - if err := h.Controller.ForgetChecks(p.Owner, p.Repo, p.Number); err != nil { - h.mu.Lock() - h.refuse(fmt.Errorf("%s#%d closed, and its check builds stay until the week's sweep: %w", p.repository(), - p.Number, err)) - h.mu.Unlock() - } } // CheckedEvent is the controller's `checked`. diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/manifest_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/manifest_test.go index 029a5dd7..30f76f7c 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/manifest_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/manifest_test.go @@ -89,10 +89,11 @@ func TestItClaimsTheDeliverySeatAndFollowsWhatItHandles(t *testing.T) { "mesh-delivery-teller.answers", "mesh-delivery-checker.verdicts", "mesh-controller.assignments", "node-engine.have"}) { t.Fatalf("reads %v", m.Reads) } - // It calls exactly the controller's seven verbs (ADR 0450 §7) and reads the forge with three tools; the forge's + // It calls exactly the controller's seven verbs (ADR 0450 §7; queue since issue 1274, forget-checks no more since issue 1318) and reads the forge with + // three tools; the forge's // writes are the bridge's (ADR 0437 §8). It uses no operator-channel: the teller asks (ADR 0437 §6). want := []string{} - for _, v := range []string{"deliver", "delivery-stop", "delivery-backups-again", "delivery-walks", "delivery-check", "forget-checks", "queue", "plans"} { + for _, v := range []string{"deliver", "delivery-stop", "delivery-backups-again", "delivery-walks", "delivery-check", "queue", "plans"} { want = append(want, "seat:"+ControllerSeat+"."+v) } want = append(want, "gitea.gitea_commit_statuses", "gitea.gitea_contains", "gitea.gitea_open_pulls") diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_bus_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_bus_test.go index 0c44c294..f81cd9c8 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_bus_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_bus_test.go @@ -67,7 +67,7 @@ func TestADeliveryOnMeshCheckGoesReadyAskedAndMergedOverARealBus(t *testing.T) { if len(handed.Pulls) != 1 || handed.Pulls[0].Head.Head != head || handed.Pulls[0].State != sdk.MergeMerging { t.Fatalf("the merge handed is %+v", handed) } - for _, verb := range []string{"delivery-check"} { + for _, verb := range []string{"delivery-check", "forget-checks"} { if n := len(rt.asksOf("seat:" + ControllerSeat + "." + verb)); n != 0 { t.Fatalf("the controller was asked %s %d times on a mesh/check base", verb, n) } diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_test.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_test.go index b5f17590..6bfb3c26 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_test.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/onestatus_test.go @@ -208,6 +208,17 @@ func TestRecheckRefusesAMeshCheckDelivery(t *testing.T) { } } +// 1318 (the gate's part): a pull request closed unmerged asks the controller to forget nothing: forget-checks is not called. +func TestAClosedPullRequestAsksNoForgetChecks(t *testing.T) { + w := newWorld(t) + p := pr(oneRepo, 1, oneHead, "feat/one") + w.h.PullUpdated(p) + w.h.PullClosed(p) + if len(w.ctl.forgot) != 0 { + t.Fatalf("forget-checks was called: %v", w.ctl.forgot) + } +} + // 1302: the mesh/check line gives the head and the trunk it judged. func TestTheCheckLineGivesHeadAndTrunk(t *testing.T) { head, trunk := checkLine("pass " + oneHead[:12] + " on " + oneTrunk[:12] + " | unit 4 run, 0 kept | group g of 2 pull requests") diff --git a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go index c2af77b7..b416fa9c 100644 --- a/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go +++ b/modules/mesh-delivery-gate/cmd/mesh-delivery-gate/ports.go @@ -6,7 +6,6 @@ import ( "fmt" "slices" "sort" - "strconv" "strings" stdio "git.novox.be/novox/mesh-sdk/go" @@ -65,8 +64,6 @@ type Controller interface { StopWithout(walk, why, by string, without []string) (StopAnswer, error) // Walks are the walks the controller keeps — one, given its id — and whether this seat has a holder on record. Walks(walk string) (bool, []Walk, error) - // ForgetChecks lets go of the builds a pull request's merge checks made for its merge (novox/hq ADR 0350 §5). - ForgetChecks(owner, repo string, number int) error // Queue is every ask the build queue holds, waiting or in flight (the controller's `queue`, novox/hq issue 455): what // tells a check still on its way from one the queue lost (issue 1274). A dead ask is not held. Queue() ([]QueuedAsk, error) @@ -290,11 +287,6 @@ func (c seatController) BackupsAgain(walk, why string) error { return err } -func (c seatController) ForgetChecks(owner, repo string, number int) error { - _, err := c.verb("forget-checks", map[string]any{"owner": owner, "repo": repo, "number": strconv.Itoa(number)}) - return err -} - func (c seatController) Stop(walk, why, by string) error { _, err := c.verb("delivery-stop", map[string]any{"plan": walk, "why": why, "by": by}) return err diff --git a/modules/mesh-delivery-gate/module.json b/modules/mesh-delivery-gate/module.json index baf8d3b6..0ac8e281 100644 --- a/modules/mesh-delivery-gate/module.json +++ b/modules/mesh-delivery-gate/module.json @@ -46,7 +46,6 @@ "seat:mesh-controller.delivery-backups-again", "seat:mesh-controller.delivery-walks", "seat:mesh-controller.delivery-check", - "seat:mesh-controller.forget-checks", "seat:mesh-controller.queue", "seat:mesh-controller.plans", "gitea.gitea_commit_statuses",