Skip to content

Conversation

@timhuynh94
Copy link
Contributor

No description provided.

@KellyMerrick KellyMerrick changed the title Feat test report 1 feat(test reports): test_report key functionality Apr 14, 2025
"sync"
"time"

"github.com/go-vela/server/storage"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gci)

"context"
"time"

"github.com/go-vela/server/storage"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gci)

"net/url"

"github.com/gin-gonic/gin"
"github.com/go-vela/server/storage"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gci)

//
//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker
//nolint:funlen // ignore returning nil - don't want to crash worker
func (w *Worker) exec(index int, config *api.Worker) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
cyclomatic complexity 35 of func (*Worker).exec is high (> 30) (gocyclo)


// CreateTestAttachment creates a test attachment record in the database
// after a file has been successfully uploaded to storage.
func (c *client) CreateTestAttachment(fileName, filePath string, size int64, tr *api.TestReport) error {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
unused-parameter: parameter 'filePath' seems to be unused, consider removing or renaming it as _ (revive)

Secure: false,
}
_sF, err := storage.New(_storageF)
if err != nil {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
only one cuddle assignment allowed before if statement (wsl)

if err != nil {
logger.Errorf("unable to create test attachment record for %s: %v", fileName, err)
// don't return error here to avoid blocking the upload process
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
block should not end with a whitespace (or comment) (wsl)

// Conditionally add storage option
if s.Storage != nil {
fmt.Printf("Adding storage to linux executor\n")
opts = append(opts, linux.WithStorage(s.Storage))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
append only allowed to cuddle with appended value (wsl)

if &storage == nil {
return true, nil
}
if !storage.StorageEnable() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
if statements should only be cuddled with assignments (wsl)

if !storage.StorageEnable() {
return true, nil
}
return false, nil

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
return statements should not be cuddled if block has more than two lines (wsl)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants