mesh-build-go reads a check's toolchain from the job, answers with the Delivery SDK's CheckAnswer and typed FetchAnswer, and takes the toolchains value from the Delivery SDK; askrun_gaps.go and toolchain.go are gone (B5j; ADR 0584 clause 2, ADR 0634 section 6; issue 1966)

Claude-Session: https://claude.ai/code/session_01NcbgfFSnn24M3GcqttoU7i
This commit is contained in:
2026-11-05 16:24:13 +01:00
parent 634abead7d
commit ef81dc2712
16 changed files with 54 additions and 237 deletions
@@ -11,7 +11,6 @@ import (
"testing"
"time"
buildstep "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep"
sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep"
"git.novox.be/novox/mesh-sdk/go/health"
)
@@ -19,17 +18,17 @@ import (
// keptStates stands in for the toolchains and the steps states.
type keptStates struct {
mu sync.Mutex
toolchains map[string]buildstep.Toolchain
toolchains map[string]sdkstep.Toolchain
steps map[string][]sdkstep.Step
ended chan string
}
func newStates() *keptStates {
return &keptStates{toolchains: map[string]buildstep.Toolchain{}, steps: map[string][]sdkstep.Step{}, ended: make(chan string, 16)}
return &keptStates{toolchains: map[string]sdkstep.Toolchain{}, steps: map[string][]sdkstep.Step{}, ended: make(chan string, 16)}
}
func (s *keptStates) putToolchain(key string, value any) (uint64, error) {
tc, err := buildstep.DecodeToolchain(value.(json.RawMessage))
tc, err := sdkstep.DecodeToolchain(value.(json.RawMessage))
if err != nil {
return 0, err
}
@@ -53,7 +52,7 @@ func (s *keptStates) putStep(key string, value any) (uint64, error) {
return 1, nil
}
func (s *keptStates) toolchain(key string) (buildstep.Toolchain, bool) {
func (s *keptStates) toolchain(key string) (sdkstep.Toolchain, bool) {
s.mu.Lock()
defer s.mu.Unlock()
tc, ok := s.toolchains[key]
@@ -88,7 +87,7 @@ func TestStartWritesTheToolchainAndHealthIsHealthy(t *testing.T) {
ctx, stop := context.WithCancel(context.Background())
defer stop()
go m.Start(ctx)
var tc buildstep.Toolchain
var tc sdkstep.Toolchain
for deadline := time.Now().Add(3 * time.Second); time.Now().Before(deadline); time.Sleep(5 * time.Millisecond) {
if got, ok := states.toolchain("ace.typescript"); ok {
tc = got
@@ -14,7 +14,6 @@ import (
"sync"
"time"
buildstep "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep"
sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep"
stdio "git.novox.be/novox/mesh-sdk/go"
)
@@ -192,7 +191,7 @@ func (m *Module) RecentSteps(limit int) (lines []StepLine, cut bool, err error)
}
// ReadToolchains is every key of the toolchains state (<node>.<language>) with its stored value.
func (m *Module) ReadToolchains() (map[string]buildstep.Toolchain, error) {
func (m *Module) ReadToolchains() (map[string]sdkstep.Toolchain, error) {
if m.ReadToolchainsState.Keys == nil || m.ReadToolchainsState.Get == nil {
return nil, fmt.Errorf("the toolchains state cannot be read here")
}
@@ -210,12 +209,12 @@ func (m *Module) ReadToolchains() (map[string]buildstep.Toolchain, error) {
if err != nil {
return nil, err
}
out := map[string]buildstep.Toolchain{}
out := map[string]sdkstep.Toolchain{}
for i, raw := range raws {
if len(raw) == 0 {
continue
}
t, err := buildstep.DecodeToolchain(raw)
t, err := sdkstep.DecodeToolchain(raw)
if err != nil {
return nil, fmt.Errorf("%s: %w", keys[i], err)
}
@@ -10,7 +10,6 @@ import (
"testing"
"time"
buildstep "git.novox.be/novox/mesh-catalog/modules/mesh-build-go/buildstep"
sdkstep "git.novox.be/novox/mesh-delivery/sdk/buildstep"
)
@@ -124,7 +123,7 @@ func TestStepsToolListsRecentStepsOfThisNode(t *testing.T) {
// 1562 (1483/AC5): build_node_toolchains answers each toolchains key as stored.
func TestToolchainsToolAnswersTheStoredKeys(t *testing.T) {
tcs := fakeState{}
b, err := buildstep.EncodeToolchain(buildstep.Toolchain{Language: "typescript", Version: "v22.1.0", Recipe: "1", At: time.Date(2026, 10, 21, 9, 0, 0, 0, time.UTC)})
b, err := sdkstep.EncodeToolchain(sdkstep.Toolchain{Language: "typescript", Version: "v22.1.0", Recipe: "1", At: time.Date(2026, 10, 21, 9, 0, 0, 0, time.UTC)})
if err != nil {
t.Fatal(err)
}
@@ -134,7 +133,7 @@ func TestToolchainsToolAnswersTheStoredKeys(t *testing.T) {
if err != nil {
t.Fatal(err)
}
got := out.(map[string]any)["toolchains"].(map[string]buildstep.Toolchain)
got := out.(map[string]any)["toolchains"].(map[string]sdkstep.Toolchain)
if got["ace.typescript"].Version != "v22.1.0" || got["ace.typescript"].Recipe != "1" {
t.Errorf("toolchains = %+v", got)
}