Try a forge clone again when its name lookup fails (issue 1773)

A build or check failed now and then on 'Could not resolve host:
novox.internal' between clones that resolved the same name, and its
whole delivery failed with it. A clone whose lookup failed reached
nothing, so it is cloned again with a growing pause for up to 60 s,
each retry said in the build's log as the resolver not answering;
past the bound it fails saying so. Any other git failure fails at
once, as before. Covers a module's own clone, an artifact's context
and a check's repositories.
This commit is contained in:
2026-10-22 20:56:46 +02:00
parent 96441ea28a
commit acaf8830ec
4 changed files with 281 additions and 3 deletions
+2 -1
View File
@@ -428,7 +428,8 @@ func Check(ctx context.Context, run Runner, spec CheckSpec, workspace, registry
// clone clones a repository and checks out ref; readAt keeps which, by directory.
readAt := map[string]string{}
clone := func(repository, ref, dir string) error {
if _, err := run(ctx, root, "git", cloneWith(credentials, "clone", "--quiet", repository, dir)...); err != nil {
if err := cloneFromForge(ctx, run, root, redact.redact(repository), filepath.Join(root, dir),
cloneWith(credentials, "clone", "--quiet", repository, dir), say); err != nil {
return fmt.Errorf("cannot clone %s: %s", redact.redact(repository), redact.redact(err.Error()))
}
if err := recordedWithoutUserinfo(ctx, run, filepath.Join(root, dir), repository); err != nil {