enhance: retry build processing on failed server comms #594
reviewdog [golangci] report
reported by reviewdog 🐶
Findings (40)
runtime/docker/build.go|13 col 31| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
runtime/docker/build.go|21 col 29| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
runtime/docker/build.go|29 col 30| unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
internal/context/context_test.go|132 col 4| if statements should only be cuddled with assignments (wsl)
internal/context/context_test.go|148 col 4| assignments should only be cuddled with other assignments (wsl)
internal/context/context_test.go|149 col 4| only one cuddle assignment allowed before if statement (wsl)
executor/local/build_test.go|470 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/local/build_test.go|515 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/linux/build.go|709| Function 'loadLazySecrets' is too long (164 > 160) (funlen)
executor/linux/build_test.go|1928 col 19| unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
executor/linux/secret.go|209 col 37| non-wrapping format verb for fmt.Errorf. Use %w
to format errors (errorlint)
executor/linux/secret.go|226 col 37| non-wrapping format verb for fmt.Errorf. Use %w
to format errors (errorlint)
executor/linux/secret.go|243 col 37| non-wrapping format verb for fmt.Errorf. Use %w
to format errors (errorlint)
executor/linux/build_test.go|212 col 4| if statements should only be cuddled with assignments (wsl)
executor/linux/build_test.go|1526 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|1810 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|1820 col 4| if statements should only be cuddled with assignments (wsl)
executor/linux/build_test.go|2674 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|1669 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|1815 col 6| if statements should only be cuddled with assignments used in the if statement itself (wsl)
executor/linux/build_test.go|2585 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|2605 col 5| only one cuddle assignment allowed before if statement (wsl)
executor/linux/build_test.go|202 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
executor/linux/build_test.go|1152 col 4| defer statements should only be cuddled with expressions on same variable (wsl)
executor/linux/build_test.go|1773 col 6| only one cuddle assignment allowed before range statement (wsl)
executor/linux/build_test.go|1172 col 5| only one cuddle assignment allowed before if statement (wsl)
executor/linux/build_test.go|1214 col 4| ranges should only be cuddled with assignments used in the iteration (wsl)
internal/service/snapshot_test.go|138 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
internal/service/upload_test.go|166 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
runtime/kubernetes/mock.go|143 col 53| Error return value of (k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler
is not checked (errcheck)
runtime/kubernetes/pod_tracker.go|226 col 40| Error return value of (k8s.io/client-go/tools/cache.SharedInformer).AddEventHandler
is not checked (errcheck)
runtime/kubernetes/pod_tracker_test.go|184 col 25| unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
runtime/kubernetes/pod_tracker_test.go|373 col 4| expressions should not be cuddled with blocks (wsl)
cmd/vela-worker/exec.go|30 col 1| cyclomatic complexity 31 of func (*Worker).exec
is high (> 30) (gocyclo)
cmd/vela-worker/start.go|50 col 4| assignments should only be cuddled with other assignments (wsl)
cmd/vela-worker/start.go|54 col 4| expressions should not be cuddled with blocks (wsl)
cmd/vela-worker/start.go|57 col 4| assignments should only be cuddled with other assignments (wsl)
cmd/vela-worker/start.go|61 col 4| return statements should not be cuddled if block has more than two lines (wsl)
cmd/vela-worker/start.go|70 col 3| expressions should not be cuddled with declarations or returns (wsl)
cmd/vela-worker/exec.go|29 col 1| directive //nolint:nilerr,funlen // ignore returning nil - don't want to crash worker
is unused for linter "nilerr" (nolintlint)
Filtered Findings (0)
Annotations
Check failure on line 13 in runtime/docker/build.go
github-actions / golangci
[golangci] runtime/docker/build.go#L13
unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/docker/build.go:13:31: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (c *client) InspectBuild(ctx context.Context, b *pipeline.Build) ([]byte, error) {
^
Check failure on line 21 in runtime/docker/build.go
github-actions / golangci
[golangci] runtime/docker/build.go#L21
unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/docker/build.go:21:29: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (c *client) SetupBuild(ctx context.Context, b *pipeline.Build) error {
^
Check failure on line 29 in runtime/docker/build.go
github-actions / golangci
[golangci] runtime/docker/build.go#L29
unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
runtime/docker/build.go:29:30: unused-parameter: parameter 'ctx' seems to be unused, consider removing or renaming it as _ (revive)
func (c *client) StreamBuild(ctx context.Context, b *pipeline.Build) error {
^
Check failure on line 132 in internal/context/context_test.go
github-actions / golangci
[golangci] internal/context/context_test.go#L132
if statements should only be cuddled with assignments (wsl)
Raw output
internal/context/context_test.go:132:4: if statements should only be cuddled with assignments (wsl)
if e := ctx.Err(); e != nil {
^
Check failure on line 148 in internal/context/context_test.go
github-actions / golangci
[golangci] internal/context/context_test.go#L148
assignments should only be cuddled with other assignments (wsl)
Raw output
internal/context/context_test.go:148:4: assignments should only be cuddled with other assignments (wsl)
lastLogEntry := loggerHook.LastEntry()
^
Check failure on line 149 in internal/context/context_test.go
github-actions / golangci
[golangci] internal/context/context_test.go#L149
only one cuddle assignment allowed before if statement (wsl)
Raw output
internal/context/context_test.go:149:4: only one cuddle assignment allowed before if statement (wsl)
if lastLogEntry.Message != test.lastLogMessage {
^
Check failure on line 470 in executor/local/build_test.go
github-actions / golangci
[golangci] executor/local/build_test.go#L470
unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
executor/local/build_test.go:470:19: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
planFunc: func(c *client) planFuncType {
^
Check failure on line 515 in executor/local/build_test.go
github-actions / golangci
[golangci] executor/local/build_test.go#L515
unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
executor/local/build_test.go:515:19: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
planFunc: func(c *client) planFuncType {
^
Check failure on line 709 in executor/linux/build.go
github-actions / golangci
[golangci] executor/linux/build.go#L709
Function 'loadLazySecrets' is too long (164 > 160) (funlen)
Raw output
executor/linux/build.go:709: Function 'loadLazySecrets' is too long (164 > 160) (funlen)
func loadLazySecrets(c *client, _step *pipeline.Container) error {
Check failure on line 1928 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1928
unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
Raw output
executor/linux/build_test.go:1928:19: unused-parameter: parameter 'c' seems to be unused, consider removing or renaming it as _ (revive)
planFunc: func(c *client) planFuncType {
^
Check failure on line 209 in executor/linux/secret.go
github-actions / golangci
[golangci] executor/linux/secret.go#L209
non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:209:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
^
Check failure on line 226 in executor/linux/secret.go
github-actions / golangci
[golangci] executor/linux/secret.go#L226
non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:226:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
^
Check failure on line 243 in executor/linux/secret.go
github-actions / golangci
[golangci] executor/linux/secret.go#L243
non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
Raw output
executor/linux/secret.go:243:37: non-wrapping format verb for fmt.Errorf. Use `%w` to format errors (errorlint)
return nil, fmt.Errorf("%s: %w", ErrUnableToRetrieve, err)
^
Check failure on line 212 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L212
if statements should only be cuddled with assignments (wsl)
Raw output
executor/linux/build_test.go:212:4: if statements should only be cuddled with assignments (wsl)
if test.logError && !loggedError {
^
Check failure on line 1526 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1526
if statements should only be cuddled with assignments used in the if statement itself (wsl)
Raw output
executor/linux/build_test.go:1526:6: if statements should only be cuddled with assignments used in the if statement itself (wsl)
if !test.logError {
^
Check failure on line 1810 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1810
ranges should only be cuddled with assignments used in the iteration (wsl)
Raw output
executor/linux/build_test.go:1810:4: ranges should only be cuddled with assignments used in the iteration (wsl)
for _, logEntry := range loggerHook.AllEntries() {
^
Check failure on line 1820 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1820
if statements should only be cuddled with assignments (wsl)
Raw output
executor/linux/build_test.go:1820:4: if statements should only be cuddled with assignments (wsl)
if test.logError && !loggedError {
^
Check failure on line 2674 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L2674
if statements should only be cuddled with assignments used in the if statement itself (wsl)
Raw output
executor/linux/build_test.go:2674:6: if statements should only be cuddled with assignments used in the if statement itself (wsl)
if !test.logError {
^
Check failure on line 1669 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1669
defer statements should only be cuddled with expressions on same variable (wsl)
Raw output
executor/linux/build_test.go:1669:4: defer statements should only be cuddled with expressions on same variable (wsl)
defer loggerHook.Reset()
^
Check failure on line 1815 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1815
if statements should only be cuddled with assignments used in the if statement itself (wsl)
Raw output
executor/linux/build_test.go:1815:6: if statements should only be cuddled with assignments used in the if statement itself (wsl)
if !test.logError {
^
Check failure on line 2585 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L2585
defer statements should only be cuddled with expressions on same variable (wsl)
Raw output
executor/linux/build_test.go:2585:4: defer statements should only be cuddled with expressions on same variable (wsl)
defer loggerHook.Reset()
^
Check failure on line 2605 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L2605
only one cuddle assignment allowed before if statement (wsl)
Raw output
executor/linux/build_test.go:2605:5: only one cuddle assignment allowed before if statement (wsl)
if err != nil {
^
Check failure on line 202 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L202
ranges should only be cuddled with assignments used in the iteration (wsl)
Raw output
executor/linux/build_test.go:202:4: ranges should only be cuddled with assignments used in the iteration (wsl)
for _, logEntry := range loggerHook.AllEntries() {
^
Check failure on line 1152 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1152
defer statements should only be cuddled with expressions on same variable (wsl)
Raw output
executor/linux/build_test.go:1152:4: defer statements should only be cuddled with expressions on same variable (wsl)
defer loggerHook.Reset()
^
Check failure on line 1773 in executor/linux/build_test.go
github-actions / golangci
[golangci] executor/linux/build_test.go#L1773
only one cuddle assignment allowed before range statement (wsl)
Raw output
executor/linux/build_test.go:1773:6: only one cuddle assignment allowed before range statement (wsl)
for index, stepsCompletedPercent := range percents {
^