C3: mesh-build-node and mesh-build-image say a failure of the network as a transport fault (npm ci, buildah bud, the image seat's mirror) (ADR 0664 §1, issue 1748)
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -173,7 +173,7 @@ func (m *Module) build(ctx context.Context, args map[string]any) (any, error) {
|
||||
argv = append(argv, contextDir)
|
||||
if r := m.Run(ctx, m.env(), "buildah", argv...); r.Status != 0 || r.Err != "" {
|
||||
m.sayFailure("buildah bud of "+art.Name+" of "+manifest.Module, r)
|
||||
return nil, fmt.Errorf("buildah bud of %s: %s", art.Name, cause(r))
|
||||
return nil, buildstep.Transport(fmt.Errorf("buildah bud of %s: %s", art.Name, cause(r)))
|
||||
}
|
||||
defer m.remove(local)
|
||||
digest, err := m.localDigest(ctx, local)
|
||||
|
||||
@@ -178,6 +178,8 @@ func TestBuildFailsWithBuildahsError(t *testing.T) {
|
||||
[]string{"Error: the end"}, []string{"early noise", long}},
|
||||
"nothing on stderr": {forgekey.Ran{Status: 2, Stdout: steps}, []string{"exit status 2", "nothing on stderr", "dl-cdn"}, nil},
|
||||
"never ran": {forgekey.Ran{Err: "ENOENT"}, []string{"ENOENT", "wrote nothing"}, nil},
|
||||
"a pull the network cut": {forgekey.Ran{Status: 125, Stdout: steps, Stderr: "Error: creating build container: initializing source docker://alpine: pinging container registry registry-1.docker.io: Get \"https://registry-1.docker.io/v2/\": dial tcp: lookup registry-1.docker.io on 10.10.0.3:53: i/o timeout\n"},
|
||||
[]string{"i/o timeout"}, nil},
|
||||
}
|
||||
for name, c := range cases {
|
||||
m, f, states := setup(t, same)
|
||||
@@ -200,6 +202,10 @@ func TestBuildFailsWithBuildahsError(t *testing.T) {
|
||||
if len(st.Reason) > CauseBytes+200 {
|
||||
t.Errorf("%s: the reason is %d bytes, more than its bound", name, len(st.Reason))
|
||||
}
|
||||
// ADR 0664 §1: a pull the network cut ends passing, for the bus to give the ask again; no other failure does.
|
||||
if st.Passing != strings.Contains(name, "the network cut") {
|
||||
t.Errorf("%s: passing = %v", name, st.Passing)
|
||||
}
|
||||
if len(f.called("push")) != 0 {
|
||||
t.Errorf("%s: a failed build pushed", name)
|
||||
}
|
||||
|
||||
@@ -112,7 +112,9 @@ func (m *Module) copy(ctx context.Context, args map[string]any) (any, error) {
|
||||
raw, err := m.call()("seat:"+buildstep.ImageSeat+"."+reg.VerbMirror, reg.MirrorInput{Name: module + "/" + name, Source: from, Digest: digest})
|
||||
if err != nil {
|
||||
said.Refused(err)
|
||||
return nil, fmt.Errorf("%s%s: %s's mirror: %v", builds.NotStored, name, buildstep.ImageSeat, err)
|
||||
// A seat verb's "no responders" with a holder named is a transport fault (ADR 0664 §1): the seat's tool runner is replaced.
|
||||
err = buildstep.HolderSilentOr(m.call(), buildstep.ImageSeat, err)
|
||||
return nil, fmt.Errorf("%s%s: %s's mirror: %w", builds.NotStored, name, buildstep.ImageSeat, err)
|
||||
}
|
||||
var answer reg.MirrorAnswer
|
||||
_ = json.Unmarshal(raw, &answer)
|
||||
|
||||
Reference in New Issue
Block a user