From 4104143d165c9f04210ee5eecb0ab330da0f5c10 Mon Sep 17 00:00:00 2001 From: jochen Date: Thu, 5 Nov 2026 15:13:16 +0100 Subject: [PATCH] The writers of findings give the seat's time.Time (artifact-store-tools, distribution, gitea, mesh-config; B5d; ADR 0634; issue 1966) Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i --- .../artifact-store-tools/cmd/artifact-store-tools/holder.go | 4 ++-- .../cmd/artifact-store-tools/sweepseats.go | 5 ++--- modules/distribution/cmd/distribution-tools/main.go | 2 +- modules/distribution/cmd/distribution/windows.go | 2 +- modules/gitea/cmd/package-registry/seats.go | 2 +- modules/mesh-config/cmd/mesh-config/findings.go | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go b/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go index fda79f764..c34488e51 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/holder.go @@ -948,8 +948,8 @@ func imageMissing(node, module, image string, at time.Time) meshconditions.Findi "was not sent to %s. What runs there is untouched, and the rest of %s is sent as usual.", module, node, node), Needs: fmt.Sprintf("build %s again; the details name the image.", module), Resolved: "Resolved: the store holds the image of " + module + " again", - Evidence: []meshconditions.Evidence{{At: at.UTC().Format(time.RFC3339Nano), Said: "image " + image + " is not in the store"}}, - Source: "S25", Observer: Module, At: at.UTC().Format(time.RFC3339Nano)} + Evidence: []meshconditions.Evidence{{At: at.UTC(), Said: "image " + image + " is not in the store"}}, + Source: "S25", Observer: Module, At: at.UTC()} } func capital(s string) string { diff --git a/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go b/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go index ce98ef799..7ca0966fe 100644 --- a/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go +++ b/modules/artifact-store-tools/cmd/artifact-store-tools/sweepseats.go @@ -13,7 +13,6 @@ import ( "encoding/json" "fmt" "strings" - "time" "git.novox.be/novox/mesh-contracts/health-and-repair/go/clients/meshconditionsclient" meshconditions "git.novox.be/novox/mesh-contracts/health-and-repair/go/seats/meshconditions" @@ -124,8 +123,8 @@ func (h *Holder) sweepFinding(what string, err error) { "refused one of its asks, so it stopped before anything more was removed; what it kept stays kept.", Needs: "read the seat holder's journal for the refusal; the next sweep asks again.", Resolved: "Resolved: the artifact sweep ran through without a refusal", - Evidence: []meshconditions.Evidence{{At: at.UTC().Format(time.RFC3339Nano), Said: fmt.Sprintf("%s: %v", what, err)}}, - Source: "CAT-AS1", Observer: Module, At: at.Format(time.RFC3339Nano)} + Evidence: []meshconditions.Evidence{{At: at.UTC(), Said: fmt.Sprintf("%s: %v", what, err)}}, + Source: "CAT-AS1", Observer: Module, At: at} if werr := h.Bus.Put(FindingsState, sweepFindingKey, f); werr != nil { h.logf("the sweep's finding (%s: %v) could not be written: %v", what, err, werr) } diff --git a/modules/distribution/cmd/distribution-tools/main.go b/modules/distribution/cmd/distribution-tools/main.go index 19ae96160..49336087e 100644 --- a/modules/distribution/cmd/distribution-tools/main.go +++ b/modules/distribution/cmd/distribution-tools/main.go @@ -77,7 +77,7 @@ func finding(kind, subject, words string, raised bool) { f := meshconditions.FindingsByKeyValue{V: meshconditionsclient.FindingVersion, Key: key, Kind: kind, Ref: key[strings.LastIndex(key, ".")+1:], Subject: meshconditions.Subject{Scope: meshconditionsclient.ScopeSeat, ID: "distribution"}, Severity: meshconditionsclient.Warning, Summary: words, Headline: words, Explanation: words, Resolved: "cleared once it no longer holds", - Source: kind, Observer: "distribution", At: time.Now().UTC().Format(time.RFC3339Nano)} + Source: kind, Observer: "distribution", At: time.Now().UTC()} if _, err := stdio.State(meshconditions.StateFindings).Put(key, f); err != nil { logf("the finding %s could not be written: %v", key, err) } diff --git a/modules/distribution/cmd/distribution/windows.go b/modules/distribution/cmd/distribution/windows.go index e180b56bc..3d40e32b0 100644 --- a/modules/distribution/cmd/distribution/windows.go +++ b/modules/distribution/cmd/distribution/windows.go @@ -189,7 +189,7 @@ func findingsKV(kv jetstream.KeyValue, logf func(string, ...any)) func(kind, sub f := meshconditions.FindingsByKeyValue{V: meshconditionsclient.FindingVersion, Key: key, Kind: kind, Ref: key[strings.LastIndex(key, ".")+1:], Subject: meshconditions.Subject{Scope: meshconditionsclient.ScopeSeat, ID: holder.Self}, Severity: meshconditionsclient.Warning, Summary: words, Headline: words, Explanation: words + "; registry_old_name or registry_direct_writes drops a retired node by hand", - Resolved: "cleared when the window closes", Source: kind, Observer: holder.Self, At: time.Now().UTC().Format(time.RFC3339Nano)} + Resolved: "cleared when the window closes", Source: kind, Observer: holder.Self, At: time.Now().UTC()} b, _ := json.Marshal(f) if _, err := kv.Put(ctx, key, b); err != nil { logf("the finding %s could not be written: %v", key, err) diff --git a/modules/gitea/cmd/package-registry/seats.go b/modules/gitea/cmd/package-registry/seats.go index 5320e603d..3d34c67f5 100644 --- a/modules/gitea/cmd/package-registry/seats.go +++ b/modules/gitea/cmd/package-registry/seats.go @@ -259,7 +259,7 @@ func finding(kind, subject, words string, raised bool) { f := meshconditions.FindingsByKeyValue{V: meshconditionsclient.FindingVersion, Key: key, Kind: kind, Ref: key[strings.LastIndex(key, ".")+1:], Subject: meshconditions.Subject{Scope: meshconditionsclient.ScopeSeat, ID: packageseats.Self}, Severity: meshconditionsclient.Warning, Summary: words, Headline: words, Explanation: words, Resolved: "cleared once it no longer holds", - Source: kind, Observer: packageseats.Self, At: time.Now().UTC().Format(time.RFC3339Nano)} + Source: kind, Observer: packageseats.Self, At: time.Now().UTC()} if _, err := stdio.State(meshconditions.StateFindings).Put(key, f); err != nil { fmt.Fprintf(os.Stderr, "the finding %s could not be written: %v\n", key, err) } diff --git a/modules/mesh-config/cmd/mesh-config/findings.go b/modules/mesh-config/cmd/mesh-config/findings.go index 44966c775..3f9c1482d 100644 --- a/modules/mesh-config/cmd/mesh-config/findings.go +++ b/modules/mesh-config/cmd/mesh-config/findings.go @@ -49,7 +49,7 @@ func finding(kind, module, node, ref, summary, headline, explanation, needs, res Subject: meshconditions.Subject{Scope: meshconditionsclient.ScopeModule, ID: id, Machine: node}, Severity: meshconditionsclient.Warning, Resolver: meshconditionsclient.ResolverOperator, Summary: summary, Headline: headline, Explanation: explanation, Needs: needs, Resolved: resolved, - Evidence: []meshconditions.Evidence{{At: at.UTC().Format(time.RFC3339Nano), Said: said}}, Source: "config", Observer: Module, At: at.UTC().Format(time.RFC3339Nano)} + Evidence: []meshconditions.Evidence{{At: at.UTC(), Said: said}}, Source: "config", Observer: Module, At: at.UTC()} } // renameRefused is the finding of a move mesh-config refused.