From 065ecd85f53e70b7bee0cbc5a6f3eccafe76a47c Mon Sep 17 00:00:00 2001 From: mesh-tools Date: Fri, 16 Oct 2026 23:05:10 +0000 Subject: [PATCH] Let gitea's forge-account provider read the assignments it learns its consumers from (issue 955) --- .../cmd/forge-account-provider/main_test.go | 24 +++++++++++++++++++ modules/gitea/module.json | 1 + 2 files changed, 25 insertions(+) diff --git a/modules/gitea/cmd/forge-account-provider/main_test.go b/modules/gitea/cmd/forge-account-provider/main_test.go index d8e04990..024b5f6d 100644 --- a/modules/gitea/cmd/forge-account-provider/main_test.go +++ b/modules/gitea/cmd/forge-account-provider/main_test.go @@ -1,6 +1,9 @@ package main import ( + "encoding/json" + "os" + "slices" "strings" "testing" ) @@ -20,3 +23,24 @@ func TestConfigFromEnvNamesWhatIsMissing(t *testing.T) { t.Fatalf("%v", err) } } + +// Issue 955: the runtime grants a module only the states its manifest `reads`, and the provider watches the machines' +// keys and, through the SDK's provider, the controller's assignments (where it learns its consumers). Run as the +// bus test does, with every bucket made, a missing grant passes unseen; the manifest is read here instead. +func TestTheManifestReadsEveryStateTheProviderWatches(t *testing.T) { + raw, err := os.ReadFile("../../module.json") + if err != nil { + t.Fatal(err) + } + var m struct { + Reads []string `json:"reads"` + } + if err := json.Unmarshal(raw, &m); err != nil { + t.Fatal(err) + } + for _, state := range []string{"mesh-controller.assignments", "ssh-client.keys"} { + if !slices.Contains(m.Reads, state) { + t.Errorf("gitea's reads %v lack %q, so the runtime refuses its watch", m.Reads, state) + } + } +} diff --git a/modules/gitea/module.json b/modules/gitea/module.json index 6277d97e..ce0dbf71 100644 --- a/modules/gitea/module.json +++ b/modules/gitea/module.json @@ -501,6 +501,7 @@ "bound" ], "reads": [ + "mesh-controller.assignments", "ssh-client.keys" ] } -- 2.54.0