Files
mesh-catalog/modules/mesh-build-image/cmd/mesh-build-image/steps.go
T
jschoubben 4ad5f40817 BLD7, BLD8: the Node and image build seats serve the verb steps
Node answers the type-check as lint always, unit where a package has a test
script and integration where it has test:integration, kept in detected-steps by
fingerprint as the Go module keeps it; the image answers none. The manifests
serve it. The step ask's end (step-ended) of BLD7 and BLD8 waits for BLD3 and
the build-step package of mesh-delivery-sdk.

Builds: design 47 G §22, §307, §326, §328

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
2026-11-11 11:06:40 +01:00

42 lines
1.8 KiB
Go

package main
// **The verb `steps`** (design 47 G §22, §307, §328): an image has no lint, unit or integration test step, so `steps`
// answers none for it and the seed has those steps `bypass` (*A module's registration*). The answer is the same for
// every fingerprint, so nothing is kept for it.
import (
"fmt"
seat "git.novox.be/novox/mesh-delivery/contracts/go/seats/nodebuildimage"
stdio "git.novox.be/novox/mesh-sdk/go"
)
// StepsAnswer is what `steps` answers.
type StepsAnswer struct {
Artifact string `json:"artifact"`
Fingerprint string `json:"fingerprint,omitempty"`
Steps []seat.DetectedStep `json:"steps"`
}
// stepsTool is the seat's verb `steps`.
func stepsTool() stdio.Tool {
return stdio.Tool{Name: Seat + "." + seat.VerbSteps,
Description: "Which pipeline steps an image artifact can run: none (an image has no lint, unit or integration test step).",
Input: map[string]any{"type": "object", "required": []string{"module", "artifact"}, "properties": map[string]any{
"module": map[string]any{"type": "string"},
"artifact": map[string]any{"type": "string", "description": "the artifact reference, <module>:<artifact>"},
"fingerprint": map[string]any{"type": "string"},
"fetch": map[string]any{"type": "object", "description": "not read: an image's steps need no tree"},
"again": map[string]any{"type": "boolean", "description": "not read: the answer is the same anew"},
}},
Run: steps}
}
func steps(args map[string]any) (any, error) {
str := func(k string) string { s, _ := args[k].(string); return s }
if str("artifact") == "" || str("module") == "" {
return nil, fmt.Errorf("steps: the module and the artifact are asked")
}
return StepsAnswer{Artifact: str("artifact"), Fingerprint: str("fingerprint"), Steps: []seat.DetectedStep{}}, nil
}