The runner, the toolchain guard, the fetch, the parsers, buildcpu, the conformance kit and mesh-pack move from mesh-sdk's buildstep into modules/mesh-build-go/buildstep (own go.mod). mesh-build-go, mesh-build-node and mesh-build-image require it by a same-repository replace; what the delivery parts read (the failure contract, the fetch request, the stale sweep, the module tree shape, NewID, CapacitySetting) stays imported from mesh-sdk as sdkstep. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
30 lines
1.3 KiB
Go
30 lines
1.3 KiB
Go
package buildstep
|
|
|
|
import "fmt"
|
|
|
|
// Refusal is a step that is not run on purpose, as against one that failed: the toolchain installed is not the
|
|
// recipe's, the integration level's postgres major is not the one it is built for (novox/hq ADR 0469 §1, ADR 0470
|
|
// §4; issue 1473). A step's run returns one and the runner ends the step refused with its text.
|
|
type Refusal struct {
|
|
// Text is the reason, in words the operator reads.
|
|
Text string
|
|
// Want is the version the recipe asks for and Have the one found; either may be empty.
|
|
Want, Have string
|
|
}
|
|
|
|
func (r *Refusal) Error() string { return r.Text }
|
|
|
|
// Refuse is a Refusal with its text formatted.
|
|
func Refuse(format string, args ...any) *Refusal { return &Refusal{Text: fmt.Sprintf(format, args...)} }
|
|
|
|
// Declining is a step a node does not run because another node should: it ends refused as declined (delivery.StepDeclined),
|
|
// the ask's message is dropped, and the asker puts the ask again under a new id (issue 890). A build ask naming a
|
|
// toolchain other than this node's is one (novox/hq ADR 0584 clause 2): a node that is not in the toolchain majority
|
|
// sits out and never fails a build.
|
|
type Declining struct {
|
|
Text string
|
|
Lacks []string // what this node lacks, in words the operator reads
|
|
}
|
|
|
|
func (d *Declining) Error() string { return d.Text }
|