Runner: an image artifact's steps are asked of the seat on kind:image
Place named an image's build seat by "kind: image", a form no seat definition writes, so every
image artifact's lint, unit and integration steps ended could not run. It now uses the seat
definition's own form, seatdef.OnKindImage ("kind:image"). No other kind constant has the space.
Builds: design 47 G §324, §397
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
nodebuildgo "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildgo"
|
||||
nodebuildimage "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildimage"
|
||||
nodebuildnode "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildnode"
|
||||
"git.novox.be/novox/mesh-sdk/go/seatdef"
|
||||
)
|
||||
|
||||
// StepAsker puts one step's ask on a build seat's work queue, at the subject accept names (the seat's accepted kind `step`
|
||||
@@ -51,9 +52,6 @@ var buildSteps = []string{seat.StepResultStepLint, seat.StepResultStepUnit, seat
|
||||
// approval, asked last (§22, §26).
|
||||
var moduleSteps = []string{seat.StepResultStepComposition, seat.StepResultStepReview, seat.StepResultStepApproval}
|
||||
|
||||
// kindImage is the form of an acting rule's `on` naming an artifact kind (§324).
|
||||
const kindImage = "kind: image"
|
||||
|
||||
// AskID is a step's ask id in the usual ask id form the holders accept (buildstep.CheckAskID): base 36 of started in
|
||||
// milliseconds, then six hex digits of the sha256 of the pipeline, the artifact and the step, so the same placement makes
|
||||
// the same id at every start and the bus dedupes on it; started is the pipeline's start time, or a rerun's own (design 47
|
||||
@@ -105,7 +103,7 @@ func Place(p seat.Pipeline, reg catalog.Registration, entries map[string]catalog
|
||||
}
|
||||
on := a.Language
|
||||
if on == "" && a.Kind == "image" {
|
||||
on = kindImage
|
||||
on = seatdef.OnKindImage
|
||||
}
|
||||
bs, err := BuildSeat(entries, on)
|
||||
if err != nil {
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
wants "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/meshwants"
|
||||
nodebuildgo "git.novox.be/novox/mesh-delivery/modules/mesh-delivery-contracts/go/seats/nodebuildgo"
|
||||
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/buildstep"
|
||||
"git.novox.be/novox/mesh-sdk/go/seatdef"
|
||||
)
|
||||
|
||||
func stepSeatOf(t *testing.T, name string) StepSeat {
|
||||
@@ -278,3 +279,19 @@ func TestAStepAskCarriesTheKeptResultsAndTheToolchain(t *testing.T) {
|
||||
t.Errorf("ToolchainOf = %+v, %v", tc, err)
|
||||
}
|
||||
}
|
||||
|
||||
// An image artifact, which has no language, is asked of the build seat whose acting rule build is on kind:image, the form
|
||||
// the seat definitions write (design 47 G §324, §397).
|
||||
func TestAnImageArtifactsStepsAreAskedOfTheSeatOnKindImage(t *testing.T) {
|
||||
reg := catalog.Registration{Module: "app", Policy: catalog.Policy{Steps: catalog.StepStatuses{Lint: "required"}}}
|
||||
entries := map[string]catalog.CatalogEntry{
|
||||
"app": {Module: "app", Artifacts: []catalog.Artifact{{Ref: "app:server", Kind: "image"}}},
|
||||
"mesh-build-image": {Module: "mesh-build-image", Acts: []catalog.ActingRule{{Seat: "node-build-image", Step: "build", On: seatdef.OnKindImage}}},
|
||||
}
|
||||
steps, _ := Place(seat.Pipeline{Pipeline: "main.4.app", Module: "app"}, reg, entries, time.Unix(0, 0), "the-runner")
|
||||
for _, s := range steps {
|
||||
if s.Artifact == "app:server" && (s.Outcome != seat.StepResultOutcomeRunning || s.Seat != "node-build-image") {
|
||||
t.Errorf("the image's step %s is %s at %q (%s), want running at node-build-image", s.Step, s.Outcome, s.Seat, s.Why)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user