Skip to content

Commit

Permalink
fix: do more retry and ignore intermediate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlJi committed Dec 3, 2024
1 parent eed8899 commit 00592e1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/linters/go/golangci_lint/golangci_lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (g *gitConfigModifier) Modify(cfg *config.Linter) (*config.Linter, error) {
return 0
}
max_retries=3
max_retries=5
retry_delay=1
i=1
Expand All @@ -143,6 +143,10 @@ func (g *gitConfigModifier) Modify(cfg *config.Linter) (*config.Linter, error) {
fi
i=$((i+1))
done
if [ $i -gt $max_retries ]; then
echo "WARNING: failed to configure git globally after $max_retries retries"
fi
`,
deleteOldConfigCmd,
currentConfigCmd,
Expand Down Expand Up @@ -218,6 +222,11 @@ func parser(log *xlog.Logger, output []byte) (map[string][]linters.LinterOutput,
continue
}

// skip the git config error since it will retry 5 times
if strings.Contains(ex, "unable to read config file '/root/.gitconfig'") {
continue
}

unexpected = append(unexpected, strings.TrimSpace(ex))
}

Expand Down

0 comments on commit 00592e1

Please sign in to comment.