From 732238cb6a72bb4858b0140c3f1be4b56882320d Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 19 Oct 2026 13:46:36 +0200 Subject: [PATCH] Cite the controller's lines rightly, and say the newest key holds an id (issue 1223, review round 1) --- go/delivery/buildrecord.go | 6 ++++-- go/delivery/buildrecord_test.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/go/delivery/buildrecord.go b/go/delivery/buildrecord.go index ef8b874..cb48ec5 100644 --- a/go/delivery/buildrecord.go +++ b/go/delivery/buildrecord.go @@ -24,7 +24,7 @@ type BuildRecord struct { const BuildsBucket = "mesh-controller_builds" // BuildKey is a build's record under its module, a build that knew none under the request's key: copied from -// mesh-controller internal/chain/keys.go:35-41 (BuildKey, with RequestKey at line 43). +// mesh-controller internal/chain/keys.go:35-40 (BuildKey, with RequestKey at line 42). func BuildKey(module, id string) string { if module == "" { return "req." + id @@ -32,5 +32,7 @@ func BuildKey(module, id string) string { return module + ".build." + id } -// NewestKey is the key of a module's newest build, of any state: copied from mesh-controller internal/chain/keys.go:46. +// NewestKey is the key of a module's newest build, of any state: copied from mesh-controller internal/chain/keys.go:44. +// The key holds no record: its value is the newest build's id as raw bytes (internal/inventory/chain_builds.go:210 and +// :546), and the record lives at BuildKey(module, id). The pointer is a hint, checked against that record. func NewestKey(module string) string { return module + ".newest" } diff --git a/go/delivery/buildrecord_test.go b/go/delivery/buildrecord_test.go index fccddc2..4374234 100644 --- a/go/delivery/buildrecord_test.go +++ b/go/delivery/buildrecord_test.go @@ -70,7 +70,7 @@ func TestBuildRecordWithoutInputs(t *testing.T) { // 1223/AC2 func TestBuildKeys(t *testing.T) { // 1223/AC3 // Literal values of mesh-controller internal/broker/controller_buckets.go:101 (BucketName(ControllerSeat, ChainBuilds) - // is "mesh-controller_builds") and internal/chain/keys.go:35-46. + // is "mesh-controller_builds") and internal/chain/keys.go:35-44. if BuildsBucket != "mesh-controller_builds" { t.Errorf("BuildsBucket = %q", BuildsBucket) }