From 71b520ad0ad1e8bdee5c55dde2ac3484a99bbe4b Mon Sep 17 00:00:00 2001 From: Antoine Toussaint <312536060+antoinetoussaint-byte@users.noreply.github.com> Date: Wed, 21 Oct 2026 15:18:57 -0400 Subject: [PATCH] =?UTF-8?q?fix(builder):=20answer=20BuildCapabilities=20?= =?UTF-8?q?=E2=80=94=20a=20selected=20Buildx=20builder=20is=20honoured,=20?= =?UTF-8?q?so=20a=20render=20that=20mirrors=20a=20registry=20no=20longer?= =?UTF-8?q?=20fails=20on=20this=20agent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An environment that mirrors a registry builds on a dedicated Buildx builder and core verifies every agent's BuildCapabilities before dispatching a build to it (core 2b1406f2). This agent never implemented the RPC, so the first mirrored render refused with "method BuildCapabilities not implemented" and the whole module render failed. The agent executes no docker build of its own, so a selected builder is always honoured by the CLI that runs its recipes. Co-Authored-By: Claude Fable 5.1 --- build_capabilities_test.go | 21 +++++++++++++++++++++ builder.go | 11 +++++++++++ 2 files changed, 32 insertions(+) create mode 100644 build_capabilities_test.go diff --git a/build_capabilities_test.go b/build_capabilities_test.go new file mode 100644 index 0000000..db8da51 --- /dev/null +++ b/build_capabilities_test.go @@ -0,0 +1,21 @@ +package main + +import ( + "context" + "testing" + + builderv0 "github.com/codefly-dev/core/generated/go/codefly/services/builder/v0" +) + +// The CLI verifies every agent before dispatching a build to a selected Buildx +// builder (an environment that mirrors a registry builds on one of its own); +// an agent that cannot answer fails the whole render. +func TestBuildCapabilitiesHonourASelectedBuilder(t *testing.T) { + capabilities, err := NewBuilder().BuildCapabilities(context.Background(), &builderv0.BuildCapabilitiesRequest{}) + if err != nil { + t.Fatal(err) + } + if !capabilities.GetBuildxSelection() { + t.Fatal("a selected Buildx builder must be honoured") + } +} diff --git a/builder.go b/builder.go index c1a23df..f9f6c34 100644 --- a/builder.go +++ b/builder.go @@ -53,6 +53,17 @@ type deploymentTemplateParameters struct { External bool } +// BuildCapabilities answers the CLI's check before a build that names a Buildx +// builder: this agent executes no docker build of its own — its Build hands +// the CLI a recipe or no image at all — so a selected builder is always +// honoured, by the CLI, which runs every recipe on the builder it selected. +// Without this answer core refuses the whole render of any environment that +// mirrors a registry, because such an environment builds on a dedicated +// builder and core verifies every agent before dispatching to it. +func (s *Builder) BuildCapabilities(context.Context, *builderv0.BuildCapabilitiesRequest) (*builderv0.BuildCapabilitiesResponse, error) { + return &builderv0.BuildCapabilitiesResponse{BuildxSelection: true}, nil +} + func NewBuilder() *Builder { return &Builder{ Service: NewService(),