diff --git a/.golangci.yml b/.golangci.yml index 48151b3e9..5e05f9822 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -32,6 +32,18 @@ linters-settings: lines: 160 statements: 70 + # https://github.com/daixiang0/gci + # ensure import order is consistent + # gci write --custom-order -s standard -s default -s blank -s dot -s "prefix(github.com/go-vela)" . + gci: + custom-order: true + sections: + - standard + - default + - blank + - dot + - prefix(github.com/go-vela) + # https://github.com/denis-tingaikin/go-header goheader: template: |- @@ -43,10 +55,9 @@ linters-settings: # https://github.com/golangci/golangci-lint/blob/master/pkg/golinters/nolintlint nolintlint: - allow-leading-space: true # allow non-"machine-readable" format (ie. with leading space) - allow-unused: false # allow nolint directives that don't address a linting issue - require-explanation: true # require an explanation for nolint directives - require-specific: true # require nolint directives to be specific about which linter is being skipped + allow-unused: false # allow nolint directives that don't address a linting issue + require-explanation: true # require an explanation for nolint directives + require-specific: true # require nolint directives to be specific about which linter is being skipped # This section provides the configuration for which linters # golangci will execute. Several of them were disabled by @@ -57,46 +68,47 @@ linters: # enable a specific set of linters to run enable: - - bidichk # checks for dangerous unicode character sequences - - bodyclose # checks whether HTTP response body is closed successfully - - contextcheck # check the function whether use a non-inherited context - - deadcode # finds unused code - - dupl # code clone detection - - errcheck # checks for unchecked errors - - errorlint # find misuses of errors - - exportloopref # check for exported loop vars - - funlen # detects long functions - - goconst # finds repeated strings that could be replaced by a constant - - gocyclo # computes and checks the cyclomatic complexity of functions - - godot # checks if comments end in a period - - gofmt # checks whether code was gofmt-ed - - goheader # checks is file header matches to pattern - - goimports # fixes imports and formats code in same style as gofmt - - gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod - - goprintffuncname # checks that printf-like functions are named with f at the end - - gosec # inspects code for security problems - - gosimple # linter that specializes in simplifying a code - - govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string - - ineffassign # detects when assignments to existing variables aren't used - - makezero # finds slice declarations with non-zero initial length - - misspell # finds commonly misspelled English words in comments - - nakedret # finds naked returns in functions greater than a specified function length - - nilerr # finds the code that returns nil even if it checks that the error is not nil - - noctx # noctx finds sending http request without context.Context - - nolintlint # reports ill-formed or insufficient nolint directives - - revive # linter for go - - staticcheck # applies static analysis checks, go vet on steroids - - structcheck # finds unused struct fields - - stylecheck # replacement for golint - - tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 - - typecheck # parses and type-checks go code, like the front-end of a go compiler - - unconvert # remove unnecessary type conversions - - unparam # reports unused function parameters - - unused # checks for unused constants, variables, functions and types - - varcheck # finds unused global variables and constants - - whitespace # detects leading and trailing whitespace - - wsl # forces code to use empty lines - + - bidichk # checks for dangerous unicode character sequences + - bodyclose # checks whether HTTP response body is closed successfully + - contextcheck # check the function whether use a non-inherited context + - deadcode # finds unused code + - dupl # code clone detection + - errcheck # checks for unchecked errors + - errorlint # find misuses of errors + - exportloopref # check for exported loop vars + - funlen # detects long functions + - gci # consistent import ordering + - goconst # finds repeated strings that could be replaced by a constant + - gocyclo # computes and checks the cyclomatic complexity of functions + - godot # checks if comments end in a period + - gofmt # checks whether code was gofmt-ed + - goheader # checks is file header matches to pattern + - goimports # fixes imports and formats code in same style as gofmt + - gomoddirectives # manage the use of 'replace', 'retract', and 'excludes' directives in go.mod + - goprintffuncname # checks that printf-like functions are named with f at the end + - gosec # inspects code for security problems + - gosimple # linter that specializes in simplifying a code + - govet # reports suspicious constructs, ex. Printf calls whose arguments don't align with the format string + - ineffassign # detects when assignments to existing variables aren't used + - makezero # finds slice declarations with non-zero initial length + - misspell # finds commonly misspelled English words in comments + - nakedret # finds naked returns in functions greater than a specified function length + - nilerr # finds the code that returns nil even if it checks that the error is not nil + - noctx # noctx finds sending http request without context.Context + - nolintlint # reports ill-formed or insufficient nolint directives + - revive # linter for go + - staticcheck # applies static analysis checks, go vet on steroids + - structcheck # finds unused struct fields + - stylecheck # replacement for golint + - tenv # analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 + - typecheck # parses and type-checks go code, like the front-end of a go compiler + - unconvert # remove unnecessary type conversions + - unparam # reports unused function parameters + - unused # checks for unused constants, variables, functions and types + - varcheck # finds unused global variables and constants + - whitespace # detects leading and trailing whitespace + - wsl # forces code to use empty lines + # static list of linters we know golangci can run but we've # chosen to leave disabled for now # - asciicheck - non-critical @@ -109,13 +121,13 @@ linters: # - exhaustivestruct - style preference # - forbidigo - unused # - forcetypeassert - unused - # - gci - use goimports # - gochecknoinits - unused # - gochecknoglobals - global variables allowed - # - gocognit - unused complexity metric + # - gocognit - unused complexity metric # - gocritic - style preference # - godox - to be used in the future # - goerr113 - to be used in the future + # - goimports - use gci # - golint - archived, replaced with revive # - gofumpt - use gofmt # - gomnd - get too many false-positives @@ -123,7 +135,7 @@ linters: # - ifshort - use both styles # - ireturn - allow interfaces to be returned # - importas - want flexibility with naming - # - lll - not too concerned about line length + # - lll - not too concerned about line length # - interfacer - archived # - nestif - non-critical # - nilnil - style preference @@ -132,7 +144,7 @@ linters: # - paralleltest - false-positives # - prealloc - don't use # - predeclared - unused - # - promlinter - style preference + # - promlinter - style preference # - rowserrcheck - unused # - scopelint - deprecated - replaced with exportloopref # - sqlclosecheck - unused diff --git a/Makefile b/Makefile index 0df0c3fe9..83527e308 100644 --- a/Makefile +++ b/Makefile @@ -336,3 +336,14 @@ lint: @echo @echo "### Linting Go Code" @golangci-lint run ./... + +# The `lintfix` target is intended to lint the +# Go source code with golangci-lint and apply +# any fixes that can be automatically applied. +# +# Usage: `make lintfix` +.PHONY: lintfix +lintfix: + @echo + @echo "### Fixing Go code with linter" + @golangci-lint run ./... --fix diff --git a/api/admin/build.go b/api/admin/build.go index a56cdbd16..d77d3f4b2 100644 --- a/api/admin/build.go +++ b/api/admin/build.go @@ -9,13 +9,12 @@ import ( "strconv" "time" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/util" - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/admin/builds/queue admin AllBuildsQueue diff --git a/api/admin/clean.go b/api/admin/clean.go index 5078a217b..9813a7fc7 100644 --- a/api/admin/clean.go +++ b/api/admin/clean.go @@ -8,14 +8,14 @@ import ( "strconv" "time" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types" "github.com/go-vela/types/constants" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/admin/clean admin AdminCleanResources diff --git a/api/admin/hook.go b/api/admin/hook.go index 4336a0744..156110880 100644 --- a/api/admin/hook.go +++ b/api/admin/hook.go @@ -8,10 +8,11 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/admin/hook admin AdminUpdateHook diff --git a/api/admin/repo.go b/api/admin/repo.go index 46eb3ccc2..52da52301 100644 --- a/api/admin/repo.go +++ b/api/admin/repo.go @@ -7,12 +7,12 @@ import ( "fmt" "net/http" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/util" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/admin/repo admin AdminUpdateRepo diff --git a/api/admin/secret.go b/api/admin/secret.go index 9c00c830c..f9573d9dd 100644 --- a/api/admin/secret.go +++ b/api/admin/secret.go @@ -7,13 +7,12 @@ import ( "fmt" "net/http" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/util" - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/admin/secret admin AdminUpdateSecret diff --git a/api/admin/service.go b/api/admin/service.go index 190d4f902..4d74fb388 100644 --- a/api/admin/service.go +++ b/api/admin/service.go @@ -7,13 +7,12 @@ import ( "fmt" "net/http" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/util" - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/admin/service admin AdminUpdateService diff --git a/api/admin/step.go b/api/admin/step.go index 9fd909414..aeb2e1f4b 100644 --- a/api/admin/step.go +++ b/api/admin/step.go @@ -6,13 +6,12 @@ import ( "fmt" "net/http" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/util" - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/admin/step admin AdminUpdateStep diff --git a/api/admin/user.go b/api/admin/user.go index 416cd2e09..cc276220d 100644 --- a/api/admin/user.go +++ b/api/admin/user.go @@ -7,13 +7,12 @@ import ( "fmt" "net/http" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/util" - "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/admin/user admin AdminUpdateUser diff --git a/api/admin/worker.go b/api/admin/worker.go index 1966d7d25..e09d0b046 100644 --- a/api/admin/worker.go +++ b/api/admin/worker.go @@ -6,14 +6,14 @@ import ( "fmt" "net/http" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/admin/workers/{worker}/register-token admin RegisterToken diff --git a/api/auth/get_token.go b/api/auth/get_token.go index 16b4334ae..d1d076631 100644 --- a/api/auth/get_token.go +++ b/api/auth/get_token.go @@ -7,6 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/scm" diff --git a/api/auth/login.go b/api/auth/login.go index a6e026fc2..3c6edcaa4 100644 --- a/api/auth/login.go +++ b/api/auth/login.go @@ -8,9 +8,10 @@ import ( "net/url" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/internal" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /login authenticate GetLogin diff --git a/api/auth/logout.go b/api/auth/logout.go index 2c1cf9a33..ad21740ed 100644 --- a/api/auth/logout.go +++ b/api/auth/logout.go @@ -7,15 +7,14 @@ import ( "net/http" "net/url" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/go-vela/types/constants" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // swagger:operation GET /logout authenticate GetLogout diff --git a/api/auth/post_token.go b/api/auth/post_token.go index 2f68af691..40ffbf99a 100644 --- a/api/auth/post_token.go +++ b/api/auth/post_token.go @@ -7,6 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/scm" diff --git a/api/auth/redirect.go b/api/auth/redirect.go index 2e96b3482..dcaba1844 100644 --- a/api/auth/redirect.go +++ b/api/auth/redirect.go @@ -7,9 +7,10 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/internal" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /authenticate/web authenticate GetAuthenticateTypeWeb diff --git a/api/auth/refresh.go b/api/auth/refresh.go index 65a7626b7..0dc10b7e7 100644 --- a/api/auth/refresh.go +++ b/api/auth/refresh.go @@ -7,6 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/auth" "github.com/go-vela/server/util" diff --git a/api/auth/validate.go b/api/auth/validate.go index 6485fe9f9..3282baafb 100644 --- a/api/auth/validate.go +++ b/api/auth/validate.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/server/router/middleware/claims" "github.com/go-vela/server/util" ) diff --git a/api/auth/validate_oauth.go b/api/auth/validate_oauth.go index 5a31c0069..399d3e2e2 100644 --- a/api/auth/validate_oauth.go +++ b/api/auth/validate_oauth.go @@ -7,6 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/go-vela/server/scm" "github.com/go-vela/server/util" ) diff --git a/api/badge.go b/api/badge.go index df4fcd97a..4f3dfc380 100644 --- a/api/badge.go +++ b/api/badge.go @@ -6,12 +6,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // swagger:operation GET /badge/{org}/{repo}/status.svg base GetBadge diff --git a/api/build/approve.go b/api/build/approve.go index 30006ab1c..c530a6e41 100644 --- a/api/build/approve.go +++ b/api/build/approve.go @@ -9,6 +9,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/queue" "github.com/go-vela/server/queue/models" @@ -18,7 +20,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos/{org}/{repo}/builds/{build}/approve builds ApproveBuild diff --git a/api/build/auto_cancel.go b/api/build/auto_cancel.go index 53dc1b3eb..3e219d4b4 100644 --- a/api/build/auto_cancel.go +++ b/api/build/auto_cancel.go @@ -12,6 +12,7 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" diff --git a/api/build/cancel.go b/api/build/cancel.go index 0126f819c..ad0ea30e7 100644 --- a/api/build/cancel.go +++ b/api/build/cancel.go @@ -12,6 +12,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/build" @@ -21,7 +23,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/repos/{org}/{repo}/builds/{build}/cancel builds CancelBuild diff --git a/api/build/clean.go b/api/build/clean.go index 96a186821..645b0bef3 100644 --- a/api/build/clean.go +++ b/api/build/clean.go @@ -7,10 +7,11 @@ import ( "fmt" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // cleanBuild is a helper function to kill the build diff --git a/api/build/compile_publish.go b/api/build/compile_publish.go index e23e6d8b3..69d6098e0 100644 --- a/api/build/compile_publish.go +++ b/api/build/compile_publish.go @@ -11,6 +11,8 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler" "github.com/go-vela/server/database" @@ -22,7 +24,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // CompileAndPublishConfig is a struct that contains information for the CompileAndPublish function. diff --git a/api/build/create.go b/api/build/create.go index 08027545e..2801ce0db 100644 --- a/api/build/create.go +++ b/api/build/create.go @@ -8,6 +8,8 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/database" "github.com/go-vela/server/internal" @@ -19,7 +21,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos/{org}/{repo}/builds builds CreateBuild diff --git a/api/build/delete.go b/api/build/delete.go index c1ce1de82..3da622da0 100644 --- a/api/build/delete.go +++ b/api/build/delete.go @@ -7,13 +7,14 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/repos/{org}/{repo}/builds/{build} builds DeleteBuild diff --git a/api/build/enqueue.go b/api/build/enqueue.go index 4edce866c..cbc2054b5 100644 --- a/api/build/enqueue.go +++ b/api/build/enqueue.go @@ -7,10 +7,11 @@ import ( "encoding/json" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/queue" "github.com/go-vela/server/queue/models" - "github.com/sirupsen/logrus" ) // Enqueue is a helper function that pushes a queue item (build, repo, user) to the queue. diff --git a/api/build/executable.go b/api/build/executable.go index 351314043..b855ee7bc 100644 --- a/api/build/executable.go +++ b/api/build/executable.go @@ -9,6 +9,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/claims" @@ -17,7 +19,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/executable builds GetBuildExecutable diff --git a/api/build/get.go b/api/build/get.go index 135ca1bb4..afa0994d6 100644 --- a/api/build/get.go +++ b/api/build/get.go @@ -6,11 +6,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build} builds GetBuild diff --git a/api/build/get_id.go b/api/build/get_id.go index b3adbea95..b53827c47 100644 --- a/api/build/get_id.go +++ b/api/build/get_id.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/search/builds/{id} builds GetBuildByID diff --git a/api/build/graph.go b/api/build/graph.go index fe6c9cf0d..454cdd27a 100644 --- a/api/build/graph.go +++ b/api/build/graph.go @@ -9,6 +9,8 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/database" "github.com/go-vela/server/internal" @@ -21,7 +23,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // Graph contains nodes, and relationships between nodes, or edges. diff --git a/api/build/list_org.go b/api/build/list_org.go index 673879bc4..ed2c4e929 100644 --- a/api/build/list_org.go +++ b/api/build/list_org.go @@ -8,6 +8,8 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/builds builds ListBuildsForOrg diff --git a/api/build/list_repo.go b/api/build/list_repo.go index a1a51d023..e8ed29845 100644 --- a/api/build/list_repo.go +++ b/api/build/list_repo.go @@ -9,6 +9,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" @@ -17,7 +19,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds builds ListBuildsForRepo diff --git a/api/build/restart.go b/api/build/restart.go index 6043b4fde..f52cf9c69 100644 --- a/api/build/restart.go +++ b/api/build/restart.go @@ -8,6 +8,8 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/database" "github.com/go-vela/server/internal" @@ -20,7 +22,6 @@ import ( "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos/{org}/{repo}/builds/{build} builds RestartBuild diff --git a/api/build/token.go b/api/build/token.go index 7365a72d4..4c6de18ec 100644 --- a/api/build/token.go +++ b/api/build/token.go @@ -9,6 +9,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/claims" @@ -17,7 +19,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/token builds GetBuildToken diff --git a/api/build/update.go b/api/build/update.go index 6a09e397f..be3f0cdec 100644 --- a/api/build/update.go +++ b/api/build/update.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/claims" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/repos/{org}/{repo}/builds/{build} builds UpdateBuild diff --git a/api/deployment/create.go b/api/deployment/create.go index 4f5d0faf1..b0fb02156 100644 --- a/api/deployment/create.go +++ b/api/deployment/create.go @@ -8,6 +8,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/deployments/{org}/{repo} deployments CreateDeployment diff --git a/api/deployment/get.go b/api/deployment/get.go index 72456e79a..c881bc800 100644 --- a/api/deployment/get.go +++ b/api/deployment/get.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/deployments/{org}/{repo}/{deployment} deployments GetDeployment diff --git a/api/deployment/list.go b/api/deployment/list.go index 8b8c24798..55667fdac 100644 --- a/api/deployment/list.go +++ b/api/deployment/list.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/deployments/{org}/{repo} deployments ListDeployments diff --git a/api/hook/create.go b/api/hook/create.go index 569e43664..a039371c5 100644 --- a/api/hook/create.go +++ b/api/hook/create.go @@ -8,13 +8,14 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/hooks/{org}/{repo} webhook CreateHook diff --git a/api/hook/delete.go b/api/hook/delete.go index 86ef22312..e31909a9f 100644 --- a/api/hook/delete.go +++ b/api/hook/delete.go @@ -8,12 +8,13 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/hooks/{org}/{repo}/{hook} webhook DeleteHook diff --git a/api/hook/get.go b/api/hook/get.go index d3ff18793..849aa60f7 100644 --- a/api/hook/get.go +++ b/api/hook/get.go @@ -8,12 +8,13 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/hooks/{org}/{repo}/{hook} webhook GetHook diff --git a/api/hook/list.go b/api/hook/list.go index 902cd33cc..e7235dba2 100644 --- a/api/hook/list.go +++ b/api/hook/list.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/hooks/{org}/{repo} webhook ListHooks diff --git a/api/hook/redeliver.go b/api/hook/redeliver.go index 50f68e6eb..a860c1718 100644 --- a/api/hook/redeliver.go +++ b/api/hook/redeliver.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/hooks/{org}/{repo}/{hook}/redeliver webhook RedeliverHook diff --git a/api/hook/update.go b/api/hook/update.go index 74954dde1..8d662b31c 100644 --- a/api/hook/update.go +++ b/api/hook/update.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/hooks/{org}/{repo}/{hook} webhook UpdateHook diff --git a/api/log/create_service.go b/api/log/create_service.go index fb188aead..442714c27 100644 --- a/api/log/create_service.go +++ b/api/log/create_service.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos/{org}/{repo}/builds/{build}/services/{service}/logs services CreateServiceLog diff --git a/api/log/create_step.go b/api/log/create_step.go index 19c8030ef..c5ed5f49f 100644 --- a/api/log/create_step.go +++ b/api/log/create_step.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step}/logs steps CreateStepLog diff --git a/api/log/delete_service.go b/api/log/delete_service.go index 788fe1f8d..9893d60d3 100644 --- a/api/log/delete_service.go +++ b/api/log/delete_service.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/service" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/repos/{org}/{repo}/builds/{build}/services/{service}/logs services DeleteServiceLog diff --git a/api/log/delete_step.go b/api/log/delete_step.go index 7209637ff..ebf505f1f 100644 --- a/api/log/delete_step.go +++ b/api/log/delete_step.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/step" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step}/logs steps DeleteStepLog diff --git a/api/log/get_service.go b/api/log/get_service.go index 62500eb3c..193850e90 100644 --- a/api/log/get_service.go +++ b/api/log/get_service.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/service" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/services/{service}/logs services GetServiceLog diff --git a/api/log/get_step.go b/api/log/get_step.go index 2e2798918..2e8b524be 100644 --- a/api/log/get_step.go +++ b/api/log/get_step.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/step" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step}/logs steps GetStepLog diff --git a/api/log/list_build.go b/api/log/list_build.go index 6cb2e5130..5fc996ef0 100644 --- a/api/log/list_build.go +++ b/api/log/list_build.go @@ -8,6 +8,8 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/logs builds ListLogsForBuild diff --git a/api/log/update_service.go b/api/log/update_service.go index 7e1ca5a5b..6d36b9bea 100644 --- a/api/log/update_service.go +++ b/api/log/update_service.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/repos/{org}/{repo}/builds/{build}/services/{service}/logs services UpdateServiceLog diff --git a/api/log/update_step.go b/api/log/update_step.go index d6f0370ec..c34596a0f 100644 --- a/api/log/update_step.go +++ b/api/log/update_step.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step}/logs steps UpdateStepLog diff --git a/api/metrics.go b/api/metrics.go index b562f7a1d..4a3323315 100644 --- a/api/metrics.go +++ b/api/metrics.go @@ -7,13 +7,14 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/go-vela/server/database" - "github.com/go-vela/server/queue" - "github.com/go-vela/types/constants" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/sirupsen/logrus" + + "github.com/go-vela/server/database" + "github.com/go-vela/server/queue" + "github.com/go-vela/types/constants" ) // MetricsQueryParameters holds query parameter information pertaining to requested metrics. diff --git a/api/pipeline/compile.go b/api/pipeline/compile.go index c3027edcf..4585451ba 100644 --- a/api/pipeline/compile.go +++ b/api/pipeline/compile.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/internal" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/pipelines/{org}/{repo}/{pipeline}/compile pipelines CompilePipeline diff --git a/api/pipeline/compile_test.go b/api/pipeline/compile_test.go index c65ce1d0b..e1ebd89d4 100644 --- a/api/pipeline/compile_test.go +++ b/api/pipeline/compile_test.go @@ -9,8 +9,9 @@ import ( "testing" "github.com/gin-gonic/gin" - "github.com/go-vela/types/pipeline" "github.com/google/go-cmp/cmp" + + "github.com/go-vela/types/pipeline" ) // TestPrepareRuleData tests the prepareRuleData function. diff --git a/api/pipeline/create.go b/api/pipeline/create.go index 240b59c57..1092a4051 100644 --- a/api/pipeline/create.go +++ b/api/pipeline/create.go @@ -7,13 +7,14 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/pipelines/{org}/{repo} pipelines CreatePipeline diff --git a/api/pipeline/delete.go b/api/pipeline/delete.go index d6ca9936e..b59f1adc3 100644 --- a/api/pipeline/delete.go +++ b/api/pipeline/delete.go @@ -7,13 +7,14 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/pipeline" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/pipelines/{org}/{repo}/{pipeline} pipelines DeletePipeline diff --git a/api/pipeline/expand.go b/api/pipeline/expand.go index a47ca84d6..17e62181c 100644 --- a/api/pipeline/expand.go +++ b/api/pipeline/expand.go @@ -8,6 +8,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/internal" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/pipelines/{org}/{repo}/{pipeline}/expand pipelines ExpandPipeline diff --git a/api/pipeline/get.go b/api/pipeline/get.go index 8e8b9cf16..69739f523 100644 --- a/api/pipeline/get.go +++ b/api/pipeline/get.go @@ -6,11 +6,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/pipeline" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/pipelines/{org}/{repo}/{pipeline} pipelines GetPipeline diff --git a/api/pipeline/list.go b/api/pipeline/list.go index ebb83ad54..0ffdcff95 100644 --- a/api/pipeline/list.go +++ b/api/pipeline/list.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/pipelines/{org}/{repo} pipelines ListPipelines diff --git a/api/pipeline/output.go b/api/pipeline/output.go index b7e260ed3..e9d49483f 100644 --- a/api/pipeline/output.go +++ b/api/pipeline/output.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/server/util" ) diff --git a/api/pipeline/template.go b/api/pipeline/template.go index 8114d7f72..66c8cd627 100644 --- a/api/pipeline/template.go +++ b/api/pipeline/template.go @@ -8,6 +8,8 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/compiler/registry/github" "github.com/go-vela/server/internal" @@ -19,7 +21,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/library" "github.com/go-vela/types/yaml" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/pipelines/{org}/{repo}/{pipeline}/templates pipelines GetTemplates diff --git a/api/pipeline/update.go b/api/pipeline/update.go index 075d00265..f5230fbe8 100644 --- a/api/pipeline/update.go +++ b/api/pipeline/update.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/pipeline" @@ -14,7 +16,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/pipelines/{org}/{repo}/{pipeline} pipelines UpdatePipeline diff --git a/api/pipeline/validate.go b/api/pipeline/validate.go index 2754b24c9..b7f43664d 100644 --- a/api/pipeline/validate.go +++ b/api/pipeline/validate.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/internal" "github.com/go-vela/server/router/middleware/org" @@ -14,7 +16,6 @@ import ( "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/pipelines/{org}/{repo}/{pipeline}/validate pipelines ValidatePipeline diff --git a/api/queue/queue.go b/api/queue/queue.go index 78d4c170b..5c861572e 100644 --- a/api/queue/queue.go +++ b/api/queue/queue.go @@ -6,9 +6,10 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/claims" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/queue/info queue Info diff --git a/api/repo/chown.go b/api/repo/chown.go index 9e1bf98ab..f68a4fac6 100644 --- a/api/repo/chown.go +++ b/api/repo/chown.go @@ -7,12 +7,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation PATCH /api/v1/repos/{org}/{repo}/chown repos ChownRepo diff --git a/api/repo/create.go b/api/repo/create.go index 636b955b3..824f7d0f5 100644 --- a/api/repo/create.go +++ b/api/repo/create.go @@ -9,6 +9,9 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/google/uuid" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/api/types/actions" "github.com/go-vela/server/database" @@ -17,8 +20,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/google/uuid" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos repos CreateRepo diff --git a/api/repo/delete.go b/api/repo/delete.go index 445a9af92..7a70ceac4 100644 --- a/api/repo/delete.go +++ b/api/repo/delete.go @@ -7,13 +7,14 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/repos/{org}/{repo} repos DeleteRepo diff --git a/api/repo/get.go b/api/repo/get.go index d8b1fdebb..61df846d4 100644 --- a/api/repo/get.go +++ b/api/repo/get.go @@ -6,10 +6,11 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo} repos GetRepo diff --git a/api/repo/list.go b/api/repo/list.go index 7b7f788f6..010ae0cfe 100644 --- a/api/repo/list.go +++ b/api/repo/list.go @@ -8,11 +8,12 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos repos ListRepos diff --git a/api/repo/list_org.go b/api/repo/list_org.go index e2b5b411b..565082f97 100644 --- a/api/repo/list_org.go +++ b/api/repo/list_org.go @@ -8,6 +8,8 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org} repos ListReposForOrg diff --git a/api/repo/repair.go b/api/repo/repair.go index 9d6e99b32..1e3eefb33 100644 --- a/api/repo/repair.go +++ b/api/repo/repair.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + wh "github.com/go-vela/server/api/webhook" "github.com/go-vela/server/database" "github.com/go-vela/server/internal" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation PATCH /api/v1/repos/{org}/{repo}/repair repos RepairRepo diff --git a/api/repo/update.go b/api/repo/update.go index db179371a..82fd02922 100644 --- a/api/repo/update.go +++ b/api/repo/update.go @@ -9,6 +9,9 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/google/uuid" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" @@ -17,8 +20,6 @@ import ( "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/google/uuid" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/repos/{org}/{repo} repos UpdateRepo diff --git a/api/schedule/create.go b/api/schedule/create.go index 88df46a75..7a9439b8c 100644 --- a/api/schedule/create.go +++ b/api/schedule/create.go @@ -9,12 +9,13 @@ import ( "github.com/adhocore/gronx" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/schedules/{org}/{repo} schedules CreateSchedule diff --git a/api/schedule/delete.go b/api/schedule/delete.go index 3e7eea10d..73c60a8c0 100644 --- a/api/schedule/delete.go +++ b/api/schedule/delete.go @@ -7,13 +7,14 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/schedule" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/repos/{org}/{repo}/{schedule} schedules DeleteSchedule diff --git a/api/schedule/get.go b/api/schedule/get.go index 902b06b21..d9ff954b2 100644 --- a/api/schedule/get.go +++ b/api/schedule/get.go @@ -6,11 +6,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/schedule" "github.com/go-vela/server/router/middleware/user" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/schedules/{org}/{repo}/{schedule} schedules GetSchedule diff --git a/api/schedule/list.go b/api/schedule/list.go index cd47a56e1..c6c424647 100644 --- a/api/schedule/list.go +++ b/api/schedule/list.go @@ -8,11 +8,12 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/schedules/{org}/{repo} schedules ListSchedules diff --git a/api/schedule/update.go b/api/schedule/update.go index d1ff1e44f..41da289ec 100644 --- a/api/schedule/update.go +++ b/api/schedule/update.go @@ -8,13 +8,14 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/schedule" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/schedules/{org}/{repo}/{schedule} schedules UpdateSchedule diff --git a/api/scm/sync.go b/api/scm/sync.go index 2033c9a49..9520fb143 100644 --- a/api/scm/sync.go +++ b/api/scm/sync.go @@ -8,13 +8,14 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation PATCH /api/v1/scm/repos/{org}/{repo}/sync scm SyncRepo diff --git a/api/scm/sync_org.go b/api/scm/sync_org.go index 0c5628bef..b1162503c 100644 --- a/api/scm/sync_org.go +++ b/api/scm/sync_org.go @@ -7,13 +7,14 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation PATCH /api/v1/scm/orgs/{org}/sync scm SyncReposForOrg diff --git a/api/secret/create.go b/api/secret/create.go index e398647c6..fd44f1779 100644 --- a/api/secret/create.go +++ b/api/secret/create.go @@ -9,6 +9,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/secret" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/library/actions" - "github.com/sirupsen/logrus" ) // diff --git a/api/secret/delete.go b/api/secret/delete.go index 5257b82a9..dd4db4145 100644 --- a/api/secret/delete.go +++ b/api/secret/delete.go @@ -8,11 +8,12 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/secret" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // diff --git a/api/secret/get.go b/api/secret/get.go index 74cad449f..44c379f8b 100644 --- a/api/secret/get.go +++ b/api/secret/get.go @@ -8,12 +8,13 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/claims" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/secret" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // diff --git a/api/secret/list.go b/api/secret/list.go index a3870597f..c142b89a6 100644 --- a/api/secret/list.go +++ b/api/secret/list.go @@ -9,6 +9,8 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // diff --git a/api/secret/update.go b/api/secret/update.go index aecadcc86..cb012c719 100644 --- a/api/secret/update.go +++ b/api/secret/update.go @@ -9,12 +9,13 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/secret" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // diff --git a/api/service/create.go b/api/service/create.go index e43f66a0f..2ccb9e314 100644 --- a/api/service/create.go +++ b/api/service/create.go @@ -8,6 +8,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos/{org}/{repo}/builds/{build}/services services CreateService diff --git a/api/service/delete.go b/api/service/delete.go index ff885e440..915804a27 100644 --- a/api/service/delete.go +++ b/api/service/delete.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -14,7 +16,6 @@ import ( "github.com/go-vela/server/router/middleware/service" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // diff --git a/api/service/get.go b/api/service/get.go index 5ac4503b8..b81b69735 100644 --- a/api/service/get.go +++ b/api/service/get.go @@ -6,12 +6,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/service" "github.com/go-vela/server/router/middleware/user" - "github.com/sirupsen/logrus" ) // diff --git a/api/service/list.go b/api/service/list.go index d5e37cfef..6697a7282 100644 --- a/api/service/list.go +++ b/api/service/list.go @@ -8,6 +8,8 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/services services ListServices diff --git a/api/service/update.go b/api/service/update.go index c391e6a86..a539270e3 100644 --- a/api/service/update.go +++ b/api/service/update.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // diff --git a/api/step/create.go b/api/step/create.go index f8b9ef2f8..2218d214d 100644 --- a/api/step/create.go +++ b/api/step/create.go @@ -8,6 +8,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/repos/{org}/{repo}/builds/{build}/steps steps CreateStep diff --git a/api/step/delete.go b/api/step/delete.go index 574e873c7..8d735717a 100644 --- a/api/step/delete.go +++ b/api/step/delete.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -14,7 +16,6 @@ import ( "github.com/go-vela/server/router/middleware/step" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step} steps DeleteStep diff --git a/api/step/get.go b/api/step/get.go index 51f1894c6..9582b5928 100644 --- a/api/step/get.go +++ b/api/step/get.go @@ -6,12 +6,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/step" "github.com/go-vela/server/router/middleware/user" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step} steps GetStep diff --git a/api/step/list.go b/api/step/list.go index 42c45cac8..603d7083b 100644 --- a/api/step/list.go +++ b/api/step/list.go @@ -8,6 +8,8 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/repos/{org}/{repo}/builds/{build}/steps steps ListSteps diff --git a/api/step/plan.go b/api/step/plan.go index eb7d9dda9..7e493aab6 100644 --- a/api/step/plan.go +++ b/api/step/plan.go @@ -7,13 +7,14 @@ import ( "fmt" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/scm" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "github.com/sirupsen/logrus" ) // PlanSteps is a helper function to plan all steps diff --git a/api/step/update.go b/api/step/update.go index 7dc97efac..cb767de4e 100644 --- a/api/step/update.go +++ b/api/step/update.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -17,7 +19,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step} steps UpdateStep diff --git a/api/types/events_test.go b/api/types/events_test.go index 45b003398..447a84c54 100644 --- a/api/types/events_test.go +++ b/api/types/events_test.go @@ -6,9 +6,10 @@ import ( "reflect" "testing" + "github.com/google/go-cmp/cmp" + "github.com/go-vela/server/api/types/actions" "github.com/go-vela/types/constants" - "github.com/google/go-cmp/cmp" ) func TestTypes_Events_Getters(t *testing.T) { diff --git a/api/types/repo_test.go b/api/types/repo_test.go index b0554d742..bbbd6ee91 100644 --- a/api/types/repo_test.go +++ b/api/types/repo_test.go @@ -7,9 +7,10 @@ import ( "reflect" "testing" + "github.com/google/go-cmp/cmp" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/google/go-cmp/cmp" ) func TestTypes_Repo_Environment(t *testing.T) { diff --git a/api/user/create.go b/api/user/create.go index 575e73c88..43d7037bc 100644 --- a/api/user/create.go +++ b/api/user/create.go @@ -7,11 +7,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/users users CreateUser diff --git a/api/user/create_token.go b/api/user/create_token.go index 9f57fde9a..e1b8fa9c0 100644 --- a/api/user/create_token.go +++ b/api/user/create_token.go @@ -8,12 +8,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/user/token users CreateToken diff --git a/api/user/delete.go b/api/user/delete.go index 36393d24a..fd32d75d0 100644 --- a/api/user/delete.go +++ b/api/user/delete.go @@ -7,10 +7,11 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/users/{user} users DeleteUser diff --git a/api/user/delete_token.go b/api/user/delete_token.go index adb554015..b0caa2ac1 100644 --- a/api/user/delete_token.go +++ b/api/user/delete_token.go @@ -8,12 +8,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/user/token users DeleteToken diff --git a/api/user/get.go b/api/user/get.go index e888ff804..488cd9705 100644 --- a/api/user/get.go +++ b/api/user/get.go @@ -7,10 +7,11 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/users/{user} users GetUser diff --git a/api/user/get_current.go b/api/user/get_current.go index 641576df0..455a4e8e7 100644 --- a/api/user/get_current.go +++ b/api/user/get_current.go @@ -6,8 +6,9 @@ import ( "net/http" "github.com/gin-gonic/gin" - "github.com/go-vela/server/router/middleware/user" "github.com/sirupsen/logrus" + + "github.com/go-vela/server/router/middleware/user" ) // swagger:operation GET /api/v1/user users GetCurrentUser diff --git a/api/user/get_source.go b/api/user/get_source.go index b52e3950f..d0b666090 100644 --- a/api/user/get_source.go +++ b/api/user/get_source.go @@ -7,12 +7,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/user/source/repos users GetSourceRepos diff --git a/api/user/list.go b/api/user/list.go index a62ae57aa..55f67f64e 100644 --- a/api/user/list.go +++ b/api/user/list.go @@ -8,11 +8,12 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/users users ListUsers diff --git a/api/user/update.go b/api/user/update.go index 0535da1f5..09767d94c 100644 --- a/api/user/update.go +++ b/api/user/update.go @@ -7,11 +7,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/users/{user} users UpdateUser diff --git a/api/user/update_current.go b/api/user/update_current.go index ab56023ad..bd3cb9a85 100644 --- a/api/user/update_current.go +++ b/api/user/update_current.go @@ -7,11 +7,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/user users UpdateCurrentUser diff --git a/api/webhook/post.go b/api/webhook/post.go index 3f1b3bba7..82db4a899 100644 --- a/api/webhook/post.go +++ b/api/webhook/post.go @@ -14,6 +14,9 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "gorm.io/gorm" + "github.com/go-vela/server/api/build" "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler" @@ -24,8 +27,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" - "gorm.io/gorm" ) var baseErr = "unable to process webhook" diff --git a/api/worker/create.go b/api/worker/create.go index 38f9eb786..557cb1858 100644 --- a/api/worker/create.go +++ b/api/worker/create.go @@ -9,6 +9,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" @@ -17,7 +19,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/workers workers CreateWorker diff --git a/api/worker/delete.go b/api/worker/delete.go index cde6c743a..ebb718aeb 100644 --- a/api/worker/delete.go +++ b/api/worker/delete.go @@ -7,11 +7,12 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/router/middleware/worker" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation DELETE /api/v1/workers/{worker} workers DeleteWorker diff --git a/api/worker/get.go b/api/worker/get.go index b7bebd149..ab277514f 100644 --- a/api/worker/get.go +++ b/api/worker/get.go @@ -7,12 +7,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/router/middleware/worker" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/workers/{worker} workers GetWorker diff --git a/api/worker/list.go b/api/worker/list.go index 82673eccf..656745efa 100644 --- a/api/worker/list.go +++ b/api/worker/list.go @@ -9,11 +9,12 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation GET /api/v1/workers workers ListWorkers diff --git a/api/worker/refresh.go b/api/worker/refresh.go index 15826f6d6..4aff87a17 100644 --- a/api/worker/refresh.go +++ b/api/worker/refresh.go @@ -9,6 +9,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/claims" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/workers/{worker}/refresh workers RefreshWorkerAuth diff --git a/api/worker/update.go b/api/worker/update.go index e5b842a0d..db187b7c0 100644 --- a/api/worker/update.go +++ b/api/worker/update.go @@ -7,12 +7,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/router/middleware/worker" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // swagger:operation PUT /api/v1/workers/{worker} workers UpdateWorker diff --git a/cmd/vela-server/compiler.go b/cmd/vela-server/compiler.go index 4e85f046a..872f3fbd0 100644 --- a/cmd/vela-server/compiler.go +++ b/cmd/vela-server/compiler.go @@ -3,14 +3,12 @@ package main import ( + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/compiler/native" - "github.com/go-vela/types/constants" - - "github.com/sirupsen/logrus" - - "github.com/urfave/cli/v2" ) // helper function to setup the queue from the CLI arguments. diff --git a/cmd/vela-server/main.go b/cmd/vela-server/main.go index 715c821a2..5ce4c7bd7 100644 --- a/cmd/vela-server/main.go +++ b/cmd/vela-server/main.go @@ -8,17 +8,17 @@ import ( "os" "time" - "github.com/go-vela/types/constants" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + + _ "github.com/joho/godotenv/autoload" "github.com/go-vela/server/database" "github.com/go-vela/server/queue" "github.com/go-vela/server/scm" "github.com/go-vela/server/secret" "github.com/go-vela/server/version" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" - - _ "github.com/joho/godotenv/autoload" + "github.com/go-vela/types/constants" ) //nolint:funlen // ignore line length diff --git a/cmd/vela-server/metadata.go b/cmd/vela-server/metadata.go index 4e24723cb..f14d9ee12 100644 --- a/cmd/vela-server/metadata.go +++ b/cmd/vela-server/metadata.go @@ -5,11 +5,10 @@ package main import ( "net/url" - "github.com/go-vela/server/internal" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" + + "github.com/go-vela/server/internal" ) // helper function to setup the metadata from the CLI arguments. diff --git a/cmd/vela-server/queue.go b/cmd/vela-server/queue.go index 8b8767e56..7a3a74c41 100644 --- a/cmd/vela-server/queue.go +++ b/cmd/vela-server/queue.go @@ -3,11 +3,10 @@ package main import ( - "github.com/go-vela/server/queue" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" + + "github.com/go-vela/server/queue" ) // helper function to setup the queue from the CLI arguments. diff --git a/cmd/vela-server/schedule.go b/cmd/vela-server/schedule.go index 89a0abece..dda61bdea 100644 --- a/cmd/vela-server/schedule.go +++ b/cmd/vela-server/schedule.go @@ -9,6 +9,9 @@ import ( "time" "github.com/adhocore/gronx" + "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/util/wait" + "github.com/go-vela/server/api/build" "github.com/go-vela/server/compiler" "github.com/go-vela/server/database" @@ -18,9 +21,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" - - "k8s.io/apimachinery/pkg/util/wait" ) const ( diff --git a/cmd/vela-server/scm.go b/cmd/vela-server/scm.go index 3a7e0ef73..4cf76a740 100644 --- a/cmd/vela-server/scm.go +++ b/cmd/vela-server/scm.go @@ -3,10 +3,10 @@ package main import ( - "github.com/go-vela/server/scm" "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" + + "github.com/go-vela/server/scm" ) // helper function to setup the scm from the CLI arguments. diff --git a/cmd/vela-server/secret.go b/cmd/vela-server/secret.go index 1b0e22ef8..88312bd6d 100644 --- a/cmd/vela-server/secret.go +++ b/cmd/vela-server/secret.go @@ -3,13 +3,12 @@ package main import ( + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + "github.com/go-vela/server/database" "github.com/go-vela/server/secret" "github.com/go-vela/types/constants" - - "github.com/sirupsen/logrus" - - "github.com/urfave/cli/v2" ) // helper function to setup the secrets engines from the CLI arguments. diff --git a/cmd/vela-server/server.go b/cmd/vela-server/server.go index 1910c2d70..7f25a43df 100644 --- a/cmd/vela-server/server.go +++ b/cmd/vela-server/server.go @@ -13,14 +13,14 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/go-vela/server/database" - "github.com/go-vela/server/router" - "github.com/go-vela/server/router/middleware" "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" "golang.org/x/sync/errgroup" - "k8s.io/apimachinery/pkg/util/wait" + + "github.com/go-vela/server/database" + "github.com/go-vela/server/router" + "github.com/go-vela/server/router/middleware" ) func server(c *cli.Context) error { diff --git a/cmd/vela-server/token.go b/cmd/vela-server/token.go index 39b1600a6..04a756fca 100644 --- a/cmd/vela-server/token.go +++ b/cmd/vela-server/token.go @@ -4,9 +4,7 @@ package main import ( "github.com/golang-jwt/jwt/v5" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" "github.com/go-vela/server/internal/token" diff --git a/cmd/vela-server/validate.go b/cmd/vela-server/validate.go index 26b8eda89..3ceb2b330 100644 --- a/cmd/vela-server/validate.go +++ b/cmd/vela-server/validate.go @@ -6,10 +6,10 @@ import ( "fmt" "strings" - "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" + + "github.com/go-vela/types/constants" ) func validate(c *cli.Context) error { diff --git a/compiler/native/clone_test.go b/compiler/native/clone_test.go index 662576d53..120e3524f 100644 --- a/compiler/native/clone_test.go +++ b/compiler/native/clone_test.go @@ -7,8 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/yaml" "github.com/urfave/cli/v2" + + "github.com/go-vela/types/yaml" ) const defaultCloneImage = "target/vela-git:latest" diff --git a/compiler/native/compile.go b/compiler/native/compile.go index cbea8185e..d5cb1d49b 100644 --- a/compiler/native/compile.go +++ b/compiler/native/compile.go @@ -12,17 +12,16 @@ import ( "strings" "time" - "github.com/go-vela/types/constants" - yml "github.com/buildkite/yaml" - api "github.com/go-vela/server/api/types" + "github.com/hashicorp/go-cleanhttp" + "github.com/hashicorp/go-retryablehttp" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" - "github.com/hashicorp/go-cleanhttp" - "github.com/hashicorp/go-retryablehttp" ) // ModifyRequest contains the payload passed to the modification endpoint. @@ -300,8 +299,6 @@ func (c *client) compileInline(p *yaml.Build, depth int) (*yaml.Build, error) { } // compileSteps executes the workflow for converting a YAML pipeline into an executable struct. -// -//nolint:dupl,lll // linter thinks the steps and stages workflows are identical func (c *client) compileSteps(p *yaml.Build, _pipeline *library.Pipeline, tmpls map[string]*yaml.Template, r *pipeline.RuleData) (*pipeline.Build, *library.Pipeline, error) { var err error @@ -397,8 +394,6 @@ func (c *client) compileSteps(p *yaml.Build, _pipeline *library.Pipeline, tmpls } // compileStages executes the workflow for converting a YAML pipeline into an executable struct. -// -//nolint:dupl,lll // linter thinks the steps and stages workflows are identical func (c *client) compileStages(p *yaml.Build, _pipeline *library.Pipeline, tmpls map[string]*yaml.Template, r *pipeline.RuleData) (*pipeline.Build, *library.Pipeline, error) { var err error diff --git a/compiler/native/compile_test.go b/compiler/native/compile_test.go index 4d77cd148..86db5f595 100644 --- a/compiler/native/compile_test.go +++ b/compiler/native/compile_test.go @@ -9,28 +9,22 @@ import ( "net/http/httptest" "os" "path/filepath" - - api "github.com/go-vela/server/api/types" - "github.com/go-vela/server/internal" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/raw" - - "github.com/google/go-github/v61/github" - "testing" "time" + yml "github.com/buildkite/yaml" + "github.com/gin-gonic/gin" "github.com/google/go-cmp/cmp" + "github.com/google/go-github/v61/github" + "github.com/urfave/cli/v2" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/internal" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/go-vela/types/yaml" - "github.com/go-vela/types/pipeline" - - "github.com/gin-gonic/gin" - "github.com/urfave/cli/v2" - - yml "github.com/buildkite/yaml" + "github.com/go-vela/types/raw" + "github.com/go-vela/types/yaml" ) func TestNative_Compile_StagesPipeline(t *testing.T) { diff --git a/compiler/native/environment_test.go b/compiler/native/environment_test.go index cfacbd880..2d715ae8a 100644 --- a/compiler/native/environment_test.go +++ b/compiler/native/environment_test.go @@ -8,15 +8,14 @@ import ( "strings" "testing" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/server/internal" - "github.com/go-vela/types/raw" "github.com/google/go-cmp/cmp" + "github.com/urfave/cli/v2" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/internal" "github.com/go-vela/types/library" + "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" - - "github.com/urfave/cli/v2" ) func TestNative_EnvironmentStages(t *testing.T) { diff --git a/compiler/native/expand.go b/compiler/native/expand.go index f3bac6edc..e69066ef7 100644 --- a/compiler/native/expand.go +++ b/compiler/native/expand.go @@ -6,17 +6,16 @@ import ( "fmt" "strings" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/pipeline" + "github.com/sirupsen/logrus" + "github.com/spf13/afero" "github.com/go-vela/server/compiler/registry" "github.com/go-vela/server/compiler/template/native" "github.com/go-vela/server/compiler/template/starlark" - "github.com/spf13/afero" - + "github.com/go-vela/types/constants" + "github.com/go-vela/types/pipeline" "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" - "github.com/sirupsen/logrus" ) // ExpandStages injects the template for each diff --git a/compiler/native/expand_test.go b/compiler/native/expand_test.go index 8400bd6a4..c43eb14bd 100644 --- a/compiler/native/expand_test.go +++ b/compiler/native/expand_test.go @@ -9,15 +9,15 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin" + "github.com/google/go-cmp/cmp" + "github.com/urfave/cli/v2" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" - "github.com/google/go-cmp/cmp" - - "github.com/gin-gonic/gin" - "github.com/urfave/cli/v2" ) func TestNative_ExpandStages(t *testing.T) { diff --git a/compiler/native/initialize_test.go b/compiler/native/initialize_test.go index 6a0b2d31c..33276ffdb 100644 --- a/compiler/native/initialize_test.go +++ b/compiler/native/initialize_test.go @@ -7,8 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/yaml" "github.com/urfave/cli/v2" + + "github.com/go-vela/types/yaml" ) func TestNative_InitStage(t *testing.T) { diff --git a/compiler/native/native.go b/compiler/native/native.go index 04db6b72c..b4b756c52 100644 --- a/compiler/native/native.go +++ b/compiler/native/native.go @@ -5,17 +5,15 @@ package native import ( "time" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler" - "github.com/go-vela/server/internal" - "github.com/go-vela/server/compiler/registry" "github.com/go-vela/server/compiler/registry/github" - + "github.com/go-vela/server/internal" "github.com/go-vela/types/library" - - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" ) type ModificationConfig struct { diff --git a/compiler/native/native_test.go b/compiler/native/native_test.go index db0859c02..a426aa3e9 100644 --- a/compiler/native/native_test.go +++ b/compiler/native/native_test.go @@ -7,13 +7,12 @@ import ( "reflect" "testing" + "github.com/urfave/cli/v2" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler/registry/github" "github.com/go-vela/server/internal" - "github.com/go-vela/types/library" - - "github.com/urfave/cli/v2" ) func TestNative_New(t *testing.T) { diff --git a/compiler/native/parse.go b/compiler/native/parse.go index 83a401ddf..9ccd525f1 100644 --- a/compiler/native/parse.go +++ b/compiler/native/parse.go @@ -7,12 +7,12 @@ import ( "io" "os" + "github.com/buildkite/yaml" + "github.com/go-vela/server/compiler/template/native" "github.com/go-vela/server/compiler/template/starlark" "github.com/go-vela/types/constants" types "github.com/go-vela/types/yaml" - - "github.com/buildkite/yaml" ) // ParseRaw converts an object to a string. diff --git a/compiler/native/parse_test.go b/compiler/native/parse_test.go index a24d3bf34..dfe691fdb 100644 --- a/compiler/native/parse_test.go +++ b/compiler/native/parse_test.go @@ -10,14 +10,13 @@ import ( "reflect" "testing" + "github.com/google/go-cmp/cmp" + "github.com/urfave/cli/v2" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" - "github.com/google/go-cmp/cmp" - - "github.com/urfave/cli/v2" ) func TestNative_Parse_Metadata_Bytes(t *testing.T) { diff --git a/compiler/native/script_test.go b/compiler/native/script_test.go index 2ce2ada59..308023e77 100644 --- a/compiler/native/script_test.go +++ b/compiler/native/script_test.go @@ -7,10 +7,10 @@ import ( "reflect" "testing" - "github.com/go-vela/types/yaml" "github.com/google/go-cmp/cmp" - "github.com/urfave/cli/v2" + + "github.com/go-vela/types/yaml" ) func TestNative_ScriptStages(t *testing.T) { diff --git a/compiler/native/substitute.go b/compiler/native/substitute.go index e143cfc1b..9bbc717cd 100644 --- a/compiler/native/substitute.go +++ b/compiler/native/substitute.go @@ -7,7 +7,6 @@ import ( "strings" "github.com/buildkite/yaml" - "github.com/drone/envsubst" types "github.com/go-vela/types/yaml" diff --git a/compiler/native/substitute_test.go b/compiler/native/substitute_test.go index a02d59f8f..459bb2896 100644 --- a/compiler/native/substitute_test.go +++ b/compiler/native/substitute_test.go @@ -6,10 +6,10 @@ import ( "flag" "testing" + "github.com/google/go-cmp/cmp" "github.com/urfave/cli/v2" "github.com/go-vela/types/yaml" - "github.com/google/go-cmp/cmp" ) func Test_client_SubstituteStages(t *testing.T) { diff --git a/compiler/native/transform_test.go b/compiler/native/transform_test.go index 82ec72d3d..e8d596be3 100644 --- a/compiler/native/transform_test.go +++ b/compiler/native/transform_test.go @@ -7,11 +7,11 @@ import ( "reflect" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/server/internal" "github.com/go-vela/types/pipeline" "github.com/go-vela/types/yaml" - - "github.com/urfave/cli/v2" ) func TestNative_TransformStages(t *testing.T) { diff --git a/compiler/native/validate_test.go b/compiler/native/validate_test.go index 453af288a..85896b4a1 100644 --- a/compiler/native/validate_test.go +++ b/compiler/native/validate_test.go @@ -7,10 +7,10 @@ import ( "fmt" "testing" + "github.com/urfave/cli/v2" + "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" - - "github.com/urfave/cli/v2" ) func TestNative_Validate_NoVersion(t *testing.T) { diff --git a/compiler/registry/github/parse.go b/compiler/registry/github/parse.go index 45657ed0a..30908e75b 100644 --- a/compiler/registry/github/parse.go +++ b/compiler/registry/github/parse.go @@ -6,9 +6,9 @@ import ( "fmt" "strings" - "github.com/go-vela/server/compiler/registry" - "github.com/goware/urlx" + + "github.com/go-vela/server/compiler/registry" ) // Parse creates the registry source object from diff --git a/compiler/registry/github/template.go b/compiler/registry/github/template.go index b375c151f..f0e26e489 100644 --- a/compiler/registry/github/template.go +++ b/compiler/registry/github/template.go @@ -7,11 +7,10 @@ import ( "fmt" "net/http" - "github.com/go-vela/server/compiler/registry" + "github.com/google/go-github/v61/github" + "github.com/go-vela/server/compiler/registry" "github.com/go-vela/types/library" - - "github.com/google/go-github/v61/github" ) // Template captures the templated pipeline configuration from the GitHub repo. diff --git a/compiler/registry/github/template_test.go b/compiler/registry/github/template_test.go index dd55fda7d..9e2ce6562 100644 --- a/compiler/registry/github/template_test.go +++ b/compiler/registry/github/template_test.go @@ -9,11 +9,10 @@ import ( "reflect" "testing" - "github.com/go-vela/server/compiler/registry" + "github.com/gin-gonic/gin" + "github.com/go-vela/server/compiler/registry" "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" ) func TestGithub_Template(t *testing.T) { diff --git a/compiler/template/native/render.go b/compiler/template/native/render.go index d4185a3d3..a31f642b6 100644 --- a/compiler/template/native/render.go +++ b/compiler/template/native/render.go @@ -7,13 +7,11 @@ import ( "fmt" "text/template" - "github.com/go-vela/types/raw" - - types "github.com/go-vela/types/yaml" - "github.com/Masterminds/sprig/v3" - "github.com/buildkite/yaml" + + "github.com/go-vela/types/raw" + types "github.com/go-vela/types/yaml" ) // Render combines the template with the step in the yaml pipeline. diff --git a/compiler/template/starlark/convert.go b/compiler/template/starlark/convert.go index 9e7bfa70a..d571cd0ef 100644 --- a/compiler/template/starlark/convert.go +++ b/compiler/template/starlark/convert.go @@ -5,8 +5,9 @@ package starlark import ( "strings" - "github.com/go-vela/types/raw" "go.starlark.net/starlark" + + "github.com/go-vela/types/raw" ) // convertTemplateVars takes template variables and converts diff --git a/compiler/template/starlark/convert_test.go b/compiler/template/starlark/convert_test.go index 49101117e..3e868a4ba 100644 --- a/compiler/template/starlark/convert_test.go +++ b/compiler/template/starlark/convert_test.go @@ -6,8 +6,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/raw" "go.starlark.net/starlark" + + "github.com/go-vela/types/raw" ) func TestStarlark_Render_convertTemplateVars(t *testing.T) { diff --git a/compiler/template/starlark/render.go b/compiler/template/starlark/render.go index 4ff2c59ed..93b37cd78 100644 --- a/compiler/template/starlark/render.go +++ b/compiler/template/starlark/render.go @@ -7,12 +7,12 @@ import ( "errors" "fmt" - "github.com/go-vela/types/raw" + yaml "github.com/buildkite/yaml" + "go.starlark.net/starlark" "go.starlark.net/starlarkstruct" - yaml "github.com/buildkite/yaml" + "github.com/go-vela/types/raw" types "github.com/go-vela/types/yaml" - "go.starlark.net/starlark" ) var ( diff --git a/compiler/template/starlark/render_test.go b/compiler/template/starlark/render_test.go index d07a74a6f..a730f1088 100644 --- a/compiler/template/starlark/render_test.go +++ b/compiler/template/starlark/render_test.go @@ -7,9 +7,10 @@ import ( "testing" goyaml "github.com/buildkite/yaml" + "github.com/google/go-cmp/cmp" + "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" - "github.com/google/go-cmp/cmp" ) func TestStarlark_Render(t *testing.T) { diff --git a/database/build/build.go b/database/build/build.go index 8342471e7..1d1a42d97 100644 --- a/database/build/build.go +++ b/database/build/build.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/build/build_test.go b/database/build/build_test.go index 419e9443c..5971b5d48 100644 --- a/database/build/build_test.go +++ b/database/build/build_test.go @@ -10,14 +10,14 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" - "github.com/go-vela/types/raw" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + api "github.com/go-vela/server/api/types" + "github.com/go-vela/types/library" + "github.com/go-vela/types/raw" ) func TestBuild_New(t *testing.T) { diff --git a/database/build/clean.go b/database/build/clean.go index 8e8f17836..4559bac5f 100644 --- a/database/build/clean.go +++ b/database/build/clean.go @@ -6,10 +6,11 @@ import ( "context" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CleanBuilds updates builds to an error with a provided message with a created timestamp prior to a defined moment. diff --git a/database/build/count_deployment.go b/database/build/count_deployment.go index da3b23927..08cf80951 100644 --- a/database/build/count_deployment.go +++ b/database/build/count_deployment.go @@ -5,9 +5,10 @@ package build import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CountBuildsForDeployment gets the count of builds by deployment URL from the database. diff --git a/database/build/count_org.go b/database/build/count_org.go index 1d01a2cde..2f2a93119 100644 --- a/database/build/count_org.go +++ b/database/build/count_org.go @@ -5,8 +5,9 @@ package build import ( "context" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // CountBuildsForOrg gets the count of builds by org name from the database. diff --git a/database/build/count_org_test.go b/database/build/count_org_test.go index 968b1d7c2..fb6461261 100644 --- a/database/build/count_org_test.go +++ b/database/build/count_org_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/server/database/repo" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" diff --git a/database/build/count_repo.go b/database/build/count_repo.go index 342e49491..cb12e4fdc 100644 --- a/database/build/count_repo.go +++ b/database/build/count_repo.go @@ -5,9 +5,10 @@ package build import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CountBuildsForRepo gets the count of builds by repo ID from the database. diff --git a/database/build/create.go b/database/build/create.go index 02b09ab2d..1c04548b5 100644 --- a/database/build/create.go +++ b/database/build/create.go @@ -6,10 +6,11 @@ package build import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateBuild creates a new build in the database. diff --git a/database/build/delete.go b/database/build/delete.go index 9d49f3c12..78bc11f71 100644 --- a/database/build/delete.go +++ b/database/build/delete.go @@ -5,10 +5,11 @@ package build import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteBuild deletes an existing build from the database. diff --git a/database/build/get_repo.go b/database/build/get_repo.go index 17dfdcb41..3b3ae9998 100644 --- a/database/build/get_repo.go +++ b/database/build/get_repo.go @@ -5,11 +5,12 @@ package build import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetBuildForRepo gets a build by repo ID and number from the database. diff --git a/database/build/get_repo_test.go b/database/build/get_repo_test.go index ca714d017..906f35aee 100644 --- a/database/build/get_repo_test.go +++ b/database/build/get_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/build/get_test.go b/database/build/get_test.go index d48efa243..4df407ef7 100644 --- a/database/build/get_test.go +++ b/database/build/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/build/last_repo.go b/database/build/last_repo.go index d92e3eea5..3900e62d0 100644 --- a/database/build/last_repo.go +++ b/database/build/last_repo.go @@ -6,13 +6,13 @@ import ( "context" "errors" + "github.com/sirupsen/logrus" + "gorm.io/gorm" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" - - "gorm.io/gorm" ) // LastBuildForRepo gets the last build by repo ID and branch from the database. diff --git a/database/build/last_repo_test.go b/database/build/last_repo_test.go index 5e3d9d216..5755d1318 100644 --- a/database/build/last_repo_test.go +++ b/database/build/last_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/build/list_org.go b/database/build/list_org.go index 6fed59519..ef7ef140a 100644 --- a/database/build/list_org.go +++ b/database/build/list_org.go @@ -5,10 +5,11 @@ package build import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListBuildsForOrg gets a list of builds by org name from the database. diff --git a/database/build/list_org_test.go b/database/build/list_org_test.go index 6b8df4c19..925acbf96 100644 --- a/database/build/list_org_test.go +++ b/database/build/list_org_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/server/database/repo" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" diff --git a/database/build/list_pending_running_repo_test.go b/database/build/list_pending_running_repo_test.go index d6b2d5a4f..76a04b5de 100644 --- a/database/build/list_pending_running_repo_test.go +++ b/database/build/list_pending_running_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/server/database/repo" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" diff --git a/database/build/list_pending_running_test.go b/database/build/list_pending_running_test.go index b7144a815..006c13184 100644 --- a/database/build/list_pending_running_test.go +++ b/database/build/list_pending_running_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/server/database/repo" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" diff --git a/database/build/list_repo.go b/database/build/list_repo.go index f8d7a0c00..87f8c3389 100644 --- a/database/build/list_repo.go +++ b/database/build/list_repo.go @@ -5,11 +5,12 @@ package build import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListBuildsForRepo gets a list of builds by repo ID from the database. diff --git a/database/build/list_repo_test.go b/database/build/list_repo_test.go index 90b54988a..1f0e0fb9d 100644 --- a/database/build/list_repo_test.go +++ b/database/build/list_repo_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/build/list_test.go b/database/build/list_test.go index 2579ac937..ec645ace1 100644 --- a/database/build/list_test.go +++ b/database/build/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/build/opts.go b/database/build/opts.go index 7792f9a12..b3a68e3c7 100644 --- a/database/build/opts.go +++ b/database/build/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/build/opts_test.go b/database/build/opts_test.go index 43fea307f..949651dac 100644 --- a/database/build/opts_test.go +++ b/database/build/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/build/update.go b/database/build/update.go index ec647a879..ff5519fc9 100644 --- a/database/build/update.go +++ b/database/build/update.go @@ -6,10 +6,11 @@ package build import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateBuild updates an existing build in the database. diff --git a/database/close_test.go b/database/close_test.go index 7813513aa..f89d93451 100644 --- a/database/close_test.go +++ b/database/close_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/database.go b/database/database.go index 3fc1adb94..8f873f776 100644 --- a/database/database.go +++ b/database/database.go @@ -7,6 +7,11 @@ import ( "fmt" "time" + "github.com/sirupsen/logrus" + "gorm.io/driver/postgres" + "gorm.io/driver/sqlite" + "gorm.io/gorm" + "github.com/go-vela/server/database/build" "github.com/go-vela/server/database/deployment" "github.com/go-vela/server/database/executable" @@ -21,11 +26,6 @@ import ( "github.com/go-vela/server/database/user" "github.com/go-vela/server/database/worker" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" - - "gorm.io/driver/postgres" - "gorm.io/driver/sqlite" - "gorm.io/gorm" ) type ( diff --git a/database/database_test.go b/database/database_test.go index a2ea86848..26ea7e471 100644 --- a/database/database_test.go +++ b/database/database_test.go @@ -8,7 +8,6 @@ import ( "github.com/DATA-DOG/go-sqlmock" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" diff --git a/database/deployment/count_repo.go b/database/deployment/count_repo.go index c9eef1aad..6b70fff8f 100644 --- a/database/deployment/count_repo.go +++ b/database/deployment/count_repo.go @@ -5,9 +5,10 @@ package deployment import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CountDeploymentsForRepo gets the count of deployments by repo ID from the database. diff --git a/database/deployment/count_repo_test.go b/database/deployment/count_repo_test.go index 586ca6ffb..d358aad3f 100644 --- a/database/deployment/count_repo_test.go +++ b/database/deployment/count_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/deployment/count_test.go b/database/deployment/count_test.go index 5576be750..78a07afeb 100644 --- a/database/deployment/count_test.go +++ b/database/deployment/count_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" "github.com/go-vela/types/raw" ) diff --git a/database/deployment/create.go b/database/deployment/create.go index 467ca7cbd..6ce17e9a8 100644 --- a/database/deployment/create.go +++ b/database/deployment/create.go @@ -5,10 +5,11 @@ package deployment import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateDeployment creates a new deployment in the database. diff --git a/database/deployment/create_test.go b/database/deployment/create_test.go index 5f584f3b7..f915eea0b 100644 --- a/database/deployment/create_test.go +++ b/database/deployment/create_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/deployment/delete.go b/database/deployment/delete.go index 73e2658b9..f50cb9033 100644 --- a/database/deployment/delete.go +++ b/database/deployment/delete.go @@ -4,10 +4,12 @@ package deployment import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteDeployment deletes an existing deployment from the database. diff --git a/database/deployment/delete_test.go b/database/deployment/delete_test.go index 2fcd4c68f..5b984bbd7 100644 --- a/database/deployment/delete_test.go +++ b/database/deployment/delete_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/deployment/deployment.go b/database/deployment/deployment.go index 20df5e838..63f661452 100644 --- a/database/deployment/deployment.go +++ b/database/deployment/deployment.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/deployment/deployment_test.go b/database/deployment/deployment_test.go index 60265211d..1aabcb6c3 100644 --- a/database/deployment/deployment_test.go +++ b/database/deployment/deployment_test.go @@ -7,14 +7,14 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" - "github.com/go-vela/types/raw" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + api "github.com/go-vela/server/api/types" + "github.com/go-vela/types/library" + "github.com/go-vela/types/raw" ) func TestDeployment_New(t *testing.T) { diff --git a/database/deployment/get_repo.go b/database/deployment/get_repo.go index a359bbcb7..f000afcda 100644 --- a/database/deployment/get_repo.go +++ b/database/deployment/get_repo.go @@ -6,11 +6,12 @@ import ( "context" "strconv" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetDeploymentForRepo gets a deployment by repo ID and number from the database. diff --git a/database/deployment/get_repo_test.go b/database/deployment/get_repo_test.go index 289b3ad87..72f258182 100644 --- a/database/deployment/get_repo_test.go +++ b/database/deployment/get_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/deployment/get_test.go b/database/deployment/get_test.go index b557e9330..0fdb289c9 100644 --- a/database/deployment/get_test.go +++ b/database/deployment/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/deployment/list_repo.go b/database/deployment/list_repo.go index 76c973e6d..71fe1ebe5 100644 --- a/database/deployment/list_repo.go +++ b/database/deployment/list_repo.go @@ -6,11 +6,12 @@ import ( "context" "strconv" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListDeploymentsForRepo gets a list of deployments by repo ID from the database. diff --git a/database/deployment/list_repo_test.go b/database/deployment/list_repo_test.go index a62948b17..377ee8af3 100644 --- a/database/deployment/list_repo_test.go +++ b/database/deployment/list_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/deployment/list_test.go b/database/deployment/list_test.go index 203bebbe3..8b620eda4 100644 --- a/database/deployment/list_test.go +++ b/database/deployment/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/deployment/opts.go b/database/deployment/opts.go index db719b39d..95354e098 100644 --- a/database/deployment/opts.go +++ b/database/deployment/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/deployment/opts_test.go b/database/deployment/opts_test.go index ad393db84..a2dd298b7 100644 --- a/database/deployment/opts_test.go +++ b/database/deployment/opts_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/deployment/update.go b/database/deployment/update.go index b163516ff..191753cbf 100644 --- a/database/deployment/update.go +++ b/database/deployment/update.go @@ -4,10 +4,12 @@ package deployment import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateDeployment updates an existing deployment in the database. diff --git a/database/deployment/update_test.go b/database/deployment/update_test.go index ca9b2548e..d8aaa574d 100644 --- a/database/deployment/update_test.go +++ b/database/deployment/update_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/executable/clean.go b/database/executable/clean.go index 34579f778..b6bd2580a 100644 --- a/database/executable/clean.go +++ b/database/executable/clean.go @@ -5,8 +5,9 @@ package executable import ( "context" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) const CleanExecutablesPostgres = ` diff --git a/database/executable/clean_test.go b/database/executable/clean_test.go index edcb0cf21..92c8be8e8 100644 --- a/database/executable/clean_test.go +++ b/database/executable/clean_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/executable/create.go b/database/executable/create.go index 1e240c495..b619da068 100644 --- a/database/executable/create.go +++ b/database/executable/create.go @@ -6,10 +6,11 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateBuildExecutable creates a new build executable in the database. diff --git a/database/executable/executable.go b/database/executable/executable.go index 6160cd39a..8ac0475ef 100644 --- a/database/executable/executable.go +++ b/database/executable/executable.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/executable/executable_test.go b/database/executable/executable_test.go index 665ca6da5..2869001a8 100644 --- a/database/executable/executable_test.go +++ b/database/executable/executable_test.go @@ -8,13 +8,13 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" ) func TestExecutable_New(t *testing.T) { diff --git a/database/executable/opts.go b/database/executable/opts.go index 3f3bde340..c7beb136d 100644 --- a/database/executable/opts.go +++ b/database/executable/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/executable/opts_test.go b/database/executable/opts_test.go index a2e1331bd..43626c093 100644 --- a/database/executable/opts_test.go +++ b/database/executable/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/executable/pop.go b/database/executable/pop.go index bd8e19ddb..2696e565e 100644 --- a/database/executable/pop.go +++ b/database/executable/pop.go @@ -5,10 +5,11 @@ package executable import ( "context" + "gorm.io/gorm/clause" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "gorm.io/gorm/clause" ) // PopBuildExecutable pops a build executable by build_id from the database. diff --git a/database/executable/pop_test.go b/database/executable/pop_test.go index 1f6954316..6826b2feb 100644 --- a/database/executable/pop_test.go +++ b/database/executable/pop_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/flags.go b/database/flags.go index 852387b39..8655c1808 100644 --- a/database/flags.go +++ b/database/flags.go @@ -5,8 +5,9 @@ package database import ( "time" - "github.com/go-vela/types/constants" "github.com/urfave/cli/v2" + + "github.com/go-vela/types/constants" ) // Flags represents all supported command line interface (CLI) flags for the database. diff --git a/database/hook/count_repo.go b/database/hook/count_repo.go index 28549dec9..62bee12a4 100644 --- a/database/hook/count_repo.go +++ b/database/hook/count_repo.go @@ -5,9 +5,10 @@ package hook import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CountHooksForRepo gets the count of hooks by repo ID from the database. diff --git a/database/hook/create.go b/database/hook/create.go index 3ddbd4a9b..d71e89e51 100644 --- a/database/hook/create.go +++ b/database/hook/create.go @@ -5,10 +5,11 @@ package hook import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateHook creates a new hook in the database. diff --git a/database/hook/delete.go b/database/hook/delete.go index 96b00b12c..dca1f900e 100644 --- a/database/hook/delete.go +++ b/database/hook/delete.go @@ -5,10 +5,11 @@ package hook import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteHook deletes an existing hook from the database. diff --git a/database/hook/get_repo.go b/database/hook/get_repo.go index af5d2b9bc..26fe2c0fb 100644 --- a/database/hook/get_repo.go +++ b/database/hook/get_repo.go @@ -5,11 +5,12 @@ package hook import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetHookForRepo gets a hook by repo ID and number from the database. diff --git a/database/hook/get_repo_test.go b/database/hook/get_repo_test.go index f52eb1bd4..2ee8de362 100644 --- a/database/hook/get_repo_test.go +++ b/database/hook/get_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/hook/get_test.go b/database/hook/get_test.go index e5183fd62..004baa3fe 100644 --- a/database/hook/get_test.go +++ b/database/hook/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/hook/get_webhook_test.go b/database/hook/get_webhook_test.go index 57ced48f5..57bd3628f 100644 --- a/database/hook/get_webhook_test.go +++ b/database/hook/get_webhook_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/hook/hook.go b/database/hook/hook.go index ff0358f23..22816ac83 100644 --- a/database/hook/hook.go +++ b/database/hook/hook.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/hook/hook_test.go b/database/hook/hook_test.go index 50b689c00..cb66db823 100644 --- a/database/hook/hook_test.go +++ b/database/hook/hook_test.go @@ -7,13 +7,13 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + api "github.com/go-vela/server/api/types" + "github.com/go-vela/types/library" ) func TestHook_New(t *testing.T) { diff --git a/database/hook/last_repo.go b/database/hook/last_repo.go index 76fb7cbf0..388e8e464 100644 --- a/database/hook/last_repo.go +++ b/database/hook/last_repo.go @@ -6,13 +6,13 @@ import ( "context" "errors" + "github.com/sirupsen/logrus" + "gorm.io/gorm" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" - - "gorm.io/gorm" ) // LastHookForRepo gets the last hook by repo ID from the database. diff --git a/database/hook/last_repo_test.go b/database/hook/last_repo_test.go index d7409cc8e..a9366d259 100644 --- a/database/hook/last_repo_test.go +++ b/database/hook/last_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/hook/list_repo.go b/database/hook/list_repo.go index 3a2ec497f..b8afd447f 100644 --- a/database/hook/list_repo.go +++ b/database/hook/list_repo.go @@ -5,11 +5,12 @@ package hook import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListHooksForRepo gets a list of hooks by repo ID from the database. diff --git a/database/hook/list_repo_test.go b/database/hook/list_repo_test.go index b2967a1f0..c9698c0eb 100644 --- a/database/hook/list_repo_test.go +++ b/database/hook/list_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/hook/list_test.go b/database/hook/list_test.go index 299585167..79c788e0a 100644 --- a/database/hook/list_test.go +++ b/database/hook/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/hook/opts.go b/database/hook/opts.go index e91c5ec6b..36b88b499 100644 --- a/database/hook/opts.go +++ b/database/hook/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/hook/opts_test.go b/database/hook/opts_test.go index cb3c37760..834717e40 100644 --- a/database/hook/opts_test.go +++ b/database/hook/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/hook/update.go b/database/hook/update.go index e990bbc9c..6c24bfd24 100644 --- a/database/hook/update.go +++ b/database/hook/update.go @@ -5,10 +5,11 @@ package hook import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateHook updates an existing hook in the database. diff --git a/database/integration_test.go b/database/integration_test.go index e1a0c1432..e7cf44571 100644 --- a/database/integration_test.go +++ b/database/integration_test.go @@ -10,6 +10,8 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database/build" "github.com/go-vela/server/database/deployment" @@ -27,7 +29,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/raw" - "github.com/google/go-cmp/cmp" ) // Resources represents the object containing test resources. diff --git a/database/log/create_test.go b/database/log/create_test.go index 80514837c..9f6852ab9 100644 --- a/database/log/create_test.go +++ b/database/log/create_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/log/get_service_test.go b/database/log/get_service_test.go index e6c9cde8c..6b7c89529 100644 --- a/database/log/get_service_test.go +++ b/database/log/get_service_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/log/get_step_test.go b/database/log/get_step_test.go index 5eea62f56..5606ef79b 100644 --- a/database/log/get_step_test.go +++ b/database/log/get_step_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/log/get_test.go b/database/log/get_test.go index db88112b0..33028ad7d 100644 --- a/database/log/get_test.go +++ b/database/log/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/log/list_build_test.go b/database/log/list_build_test.go index f18765ec3..04f4f6efc 100644 --- a/database/log/list_build_test.go +++ b/database/log/list_build_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/log/list_test.go b/database/log/list_test.go index 1bcf1759e..605ed26df 100644 --- a/database/log/list_test.go +++ b/database/log/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/log/log.go b/database/log/log.go index 0b8378d8f..a0fa23e5f 100644 --- a/database/log/log.go +++ b/database/log/log.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/log/log_test.go b/database/log/log_test.go index f8b5bcadf..86862bbc2 100644 --- a/database/log/log_test.go +++ b/database/log/log_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + "github.com/go-vela/types/library" ) func TestLog_New(t *testing.T) { diff --git a/database/log/opts.go b/database/log/opts.go index 03a913d2b..8ad73c6dd 100644 --- a/database/log/opts.go +++ b/database/log/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/log/opts_test.go b/database/log/opts_test.go index d2a098e15..6e63d0736 100644 --- a/database/log/opts_test.go +++ b/database/log/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/log/update_test.go b/database/log/update_test.go index 3550e0c94..67f3313bc 100644 --- a/database/log/update_test.go +++ b/database/log/update_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/pipeline/count_repo.go b/database/pipeline/count_repo.go index 00cecda46..e2d5a2285 100644 --- a/database/pipeline/count_repo.go +++ b/database/pipeline/count_repo.go @@ -5,9 +5,10 @@ package pipeline import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CountPipelinesForRepo gets the count of pipelines by repo ID from the database. diff --git a/database/pipeline/count_repo_test.go b/database/pipeline/count_repo_test.go index d4776cd77..729b25955 100644 --- a/database/pipeline/count_repo_test.go +++ b/database/pipeline/count_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" ) diff --git a/database/pipeline/create.go b/database/pipeline/create.go index d3ba17711..4ee770b52 100644 --- a/database/pipeline/create.go +++ b/database/pipeline/create.go @@ -5,10 +5,11 @@ package pipeline import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreatePipeline creates a new pipeline in the database. diff --git a/database/pipeline/delete.go b/database/pipeline/delete.go index 1f62c3048..bba60b2bd 100644 --- a/database/pipeline/delete.go +++ b/database/pipeline/delete.go @@ -5,10 +5,11 @@ package pipeline import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeletePipeline deletes an existing pipeline from the database. diff --git a/database/pipeline/get_repo.go b/database/pipeline/get_repo.go index b5581df56..428e1d84a 100644 --- a/database/pipeline/get_repo.go +++ b/database/pipeline/get_repo.go @@ -5,11 +5,12 @@ package pipeline import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetPipelineForRepo gets a pipeline by number and repo ID from the database. diff --git a/database/pipeline/get_repo_test.go b/database/pipeline/get_repo_test.go index fd4a5dea8..69ffe7751 100644 --- a/database/pipeline/get_repo_test.go +++ b/database/pipeline/get_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" ) diff --git a/database/pipeline/get_test.go b/database/pipeline/get_test.go index d90404c33..614b6a7c9 100644 --- a/database/pipeline/get_test.go +++ b/database/pipeline/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/pipeline/list_repo.go b/database/pipeline/list_repo.go index f4ccc6a3e..9893ee499 100644 --- a/database/pipeline/list_repo.go +++ b/database/pipeline/list_repo.go @@ -5,11 +5,12 @@ package pipeline import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListPipelinesForRepo gets a list of pipelines by repo ID from the database. diff --git a/database/pipeline/list_repo_test.go b/database/pipeline/list_repo_test.go index 909605f19..7daa96547 100644 --- a/database/pipeline/list_repo_test.go +++ b/database/pipeline/list_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" ) diff --git a/database/pipeline/list_test.go b/database/pipeline/list_test.go index 02779e483..f356afe82 100644 --- a/database/pipeline/list_test.go +++ b/database/pipeline/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/pipeline/opts.go b/database/pipeline/opts.go index a05c92633..609181652 100644 --- a/database/pipeline/opts.go +++ b/database/pipeline/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/pipeline/opts_test.go b/database/pipeline/opts_test.go index 782c9af93..168bfef46 100644 --- a/database/pipeline/opts_test.go +++ b/database/pipeline/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/pipeline/pipeline.go b/database/pipeline/pipeline.go index c900123ae..0860a64f6 100644 --- a/database/pipeline/pipeline.go +++ b/database/pipeline/pipeline.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/pipeline/pipeline_test.go b/database/pipeline/pipeline_test.go index 01582a62a..76abee9ed 100644 --- a/database/pipeline/pipeline_test.go +++ b/database/pipeline/pipeline_test.go @@ -9,12 +9,12 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + "github.com/go-vela/types/library" ) func TestPipeline_New(t *testing.T) { diff --git a/database/pipeline/update.go b/database/pipeline/update.go index 5b12db3b1..37353d853 100644 --- a/database/pipeline/update.go +++ b/database/pipeline/update.go @@ -5,10 +5,11 @@ package pipeline import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdatePipeline updates an existing pipeline in the database. diff --git a/database/repo/count_org.go b/database/repo/count_org.go index 145042b55..339dfd664 100644 --- a/database/repo/count_org.go +++ b/database/repo/count_org.go @@ -5,8 +5,9 @@ package repo import ( "context" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // CountReposForOrg gets the count of repos by org name from the database. diff --git a/database/repo/count_user.go b/database/repo/count_user.go index 5cd71f2f0..20963a311 100644 --- a/database/repo/count_user.go +++ b/database/repo/count_user.go @@ -5,9 +5,10 @@ package repo import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CountReposForUser gets the count of repos by user ID from the database. diff --git a/database/repo/count_user_test.go b/database/repo/count_user_test.go index f62b43ff6..0fff8c479 100644 --- a/database/repo/count_user_test.go +++ b/database/repo/count_user_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/repo/create.go b/database/repo/create.go index f716bf518..fcfd837c6 100644 --- a/database/repo/create.go +++ b/database/repo/create.go @@ -7,9 +7,10 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CreateRepo creates a new repo in the database. diff --git a/database/repo/delete.go b/database/repo/delete.go index c31dd43e3..357404048 100644 --- a/database/repo/delete.go +++ b/database/repo/delete.go @@ -5,9 +5,10 @@ package repo import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // DeleteRepo deletes an existing repo from the database. diff --git a/database/repo/get_org.go b/database/repo/get_org.go index 186624276..889b5b812 100644 --- a/database/repo/get_org.go +++ b/database/repo/get_org.go @@ -5,9 +5,10 @@ package repo import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // GetRepoForOrg gets a repo by org and repo name from the database. diff --git a/database/repo/get_org_test.go b/database/repo/get_org_test.go index 9df07c42d..327201876 100644 --- a/database/repo/get_org_test.go +++ b/database/repo/get_org_test.go @@ -7,10 +7,11 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/google/go-cmp/cmp" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" - "github.com/google/go-cmp/cmp" ) func TestRepo_Engine_GetRepoForOrg(t *testing.T) { diff --git a/database/repo/get_test.go b/database/repo/get_test.go index 281d079b5..600f2a830 100644 --- a/database/repo/get_test.go +++ b/database/repo/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" diff --git a/database/repo/list_org.go b/database/repo/list_org.go index 646f9b184..32529268e 100644 --- a/database/repo/list_org.go +++ b/database/repo/list_org.go @@ -5,9 +5,10 @@ package repo import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // ListReposForOrg gets a list of repos by org name from the database. diff --git a/database/repo/list_org_test.go b/database/repo/list_org_test.go index 8f790d72b..ca93ca17e 100644 --- a/database/repo/list_org_test.go +++ b/database/repo/list_org_test.go @@ -8,11 +8,12 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" + "github.com/google/go-cmp/cmp" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/google/go-cmp/cmp" ) func TestRepo_Engine_ListReposForOrg(t *testing.T) { diff --git a/database/repo/list_test.go b/database/repo/list_test.go index 8d3dd2c76..68d426897 100644 --- a/database/repo/list_test.go +++ b/database/repo/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" diff --git a/database/repo/list_user.go b/database/repo/list_user.go index 76c5d8d7d..75e1904c8 100644 --- a/database/repo/list_user.go +++ b/database/repo/list_user.go @@ -5,10 +5,11 @@ package repo import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListReposForUser gets a list of repos by user ID from the database. diff --git a/database/repo/list_user_test.go b/database/repo/list_user_test.go index 4ac0112c0..49db2638e 100644 --- a/database/repo/list_user_test.go +++ b/database/repo/list_user_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" diff --git a/database/repo/opts.go b/database/repo/opts.go index f65dcc368..5dcf5be98 100644 --- a/database/repo/opts.go +++ b/database/repo/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/repo/opts_test.go b/database/repo/opts_test.go index b9788a457..8641eaf57 100644 --- a/database/repo/opts_test.go +++ b/database/repo/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/repo/repo.go b/database/repo/repo.go index 40a755723..1e920f181 100644 --- a/database/repo/repo.go +++ b/database/repo/repo.go @@ -9,14 +9,14 @@ import ( "errors" "fmt" + "github.com/lib/pq" + "github.com/sirupsen/logrus" + "gorm.io/gorm" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" - "github.com/lib/pq" - "github.com/sirupsen/logrus" - - "gorm.io/gorm" ) var ( diff --git a/database/repo/repo_test.go b/database/repo/repo_test.go index 92d1228a4..5de5f9177 100644 --- a/database/repo/repo_test.go +++ b/database/repo/repo_test.go @@ -8,14 +8,14 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/server/api/types/actions" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/api/types/actions" + "github.com/go-vela/types/library" ) func TestRepo_New(t *testing.T) { diff --git a/database/repo/update.go b/database/repo/update.go index 14ff985f7..8bbcefbc9 100644 --- a/database/repo/update.go +++ b/database/repo/update.go @@ -7,9 +7,10 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // UpdateRepo updates an existing repo in the database. diff --git a/database/repo/update_test.go b/database/repo/update_test.go index e36a44ad2..2d2a61f4a 100644 --- a/database/repo/update_test.go +++ b/database/repo/update_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" ) diff --git a/database/resource_test.go b/database/resource_test.go index 6f20fb4f5..5819739c4 100644 --- a/database/resource_test.go +++ b/database/resource_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/server/database/build" "github.com/go-vela/server/database/deployment" "github.com/go-vela/server/database/executable" diff --git a/database/schedule/count.go b/database/schedule/count.go index e86b99a41..b61b6d028 100644 --- a/database/schedule/count.go +++ b/database/schedule/count.go @@ -4,6 +4,7 @@ package schedule import ( "context" + "github.com/go-vela/types/constants" ) diff --git a/database/schedule/count_active.go b/database/schedule/count_active.go index cc78e37a6..6e46ee253 100644 --- a/database/schedule/count_active.go +++ b/database/schedule/count_active.go @@ -4,6 +4,7 @@ package schedule import ( "context" + "github.com/go-vela/types/constants" ) diff --git a/database/schedule/count_repo.go b/database/schedule/count_repo.go index e876dda57..80c1cd47a 100644 --- a/database/schedule/count_repo.go +++ b/database/schedule/count_repo.go @@ -5,9 +5,10 @@ package schedule import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CountSchedulesForRepo gets the count of schedules by repo ID from the database. diff --git a/database/schedule/create.go b/database/schedule/create.go index 9bc2079eb..4822adca5 100644 --- a/database/schedule/create.go +++ b/database/schedule/create.go @@ -6,10 +6,11 @@ package schedule import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateSchedule creates a new schedule in the database. diff --git a/database/schedule/delete.go b/database/schedule/delete.go index 66e489d25..0d3386da1 100644 --- a/database/schedule/delete.go +++ b/database/schedule/delete.go @@ -4,10 +4,12 @@ package schedule import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteSchedule deletes an existing schedule from the database. diff --git a/database/schedule/get.go b/database/schedule/get.go index 9f352d72b..518bbd339 100644 --- a/database/schedule/get.go +++ b/database/schedule/get.go @@ -4,6 +4,7 @@ package schedule import ( "context" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/schedule/get_repo.go b/database/schedule/get_repo.go index 3d8efbf0d..6bc362e3d 100644 --- a/database/schedule/get_repo.go +++ b/database/schedule/get_repo.go @@ -5,11 +5,12 @@ package schedule import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetScheduleForRepo gets a schedule by repo ID and name from the database. diff --git a/database/schedule/get_repo_test.go b/database/schedule/get_repo_test.go index 3745976b7..0d6a6184c 100644 --- a/database/schedule/get_repo_test.go +++ b/database/schedule/get_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/schedule/get_test.go b/database/schedule/get_test.go index d229f8cf1..3c62b8908 100644 --- a/database/schedule/get_test.go +++ b/database/schedule/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/schedule/list.go b/database/schedule/list.go index 4904a1149..f3196651f 100644 --- a/database/schedule/list.go +++ b/database/schedule/list.go @@ -4,6 +4,7 @@ package schedule import ( "context" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/schedule/list_active.go b/database/schedule/list_active.go index 07616a7de..b91ad63e8 100644 --- a/database/schedule/list_active.go +++ b/database/schedule/list_active.go @@ -4,6 +4,7 @@ package schedule import ( "context" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/schedule/list_active_test.go b/database/schedule/list_active_test.go index 7c604f10f..8154780bd 100644 --- a/database/schedule/list_active_test.go +++ b/database/schedule/list_active_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/schedule/list_repo.go b/database/schedule/list_repo.go index 6c4435a03..9f3de5e5a 100644 --- a/database/schedule/list_repo.go +++ b/database/schedule/list_repo.go @@ -5,11 +5,12 @@ package schedule import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListSchedulesForRepo gets a list of schedules by repo ID from the database. diff --git a/database/schedule/list_repo_test.go b/database/schedule/list_repo_test.go index 890f0f393..4753a2b34 100644 --- a/database/schedule/list_repo_test.go +++ b/database/schedule/list_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/schedule/list_test.go b/database/schedule/list_test.go index 463a9dfd9..d8a5b2ae8 100644 --- a/database/schedule/list_test.go +++ b/database/schedule/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/schedule/opts.go b/database/schedule/opts.go index f5f596d26..7eb9c2adb 100644 --- a/database/schedule/opts.go +++ b/database/schedule/opts.go @@ -4,8 +4,8 @@ package schedule import ( "context" - "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus" "gorm.io/gorm" ) diff --git a/database/schedule/opts_test.go b/database/schedule/opts_test.go index 93a2d3565..05e63ca54 100644 --- a/database/schedule/opts_test.go +++ b/database/schedule/opts_test.go @@ -7,7 +7,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/schedule/schedule.go b/database/schedule/schedule.go index a55bd2eb9..b338d2f95 100644 --- a/database/schedule/schedule.go +++ b/database/schedule/schedule.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/schedule/schedule_test.go b/database/schedule/schedule_test.go index 45663008b..5c227f4c2 100644 --- a/database/schedule/schedule_test.go +++ b/database/schedule/schedule_test.go @@ -10,13 +10,13 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + api "github.com/go-vela/server/api/types" + "github.com/go-vela/types/library" ) func TestSchedule_New(t *testing.T) { diff --git a/database/schedule/update.go b/database/schedule/update.go index 87a0e5a9e..ca90e13b4 100644 --- a/database/schedule/update.go +++ b/database/schedule/update.go @@ -5,10 +5,11 @@ package schedule import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateSchedule updates an existing schedule in the database. diff --git a/database/secret/count_org.go b/database/secret/count_org.go index 79dec8c44..e6fdc7fcb 100644 --- a/database/secret/count_org.go +++ b/database/secret/count_org.go @@ -5,8 +5,9 @@ package secret import ( "context" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // CountSecretsForOrg gets the count of secrets by org name from the database. diff --git a/database/secret/count_org_test.go b/database/secret/count_org_test.go index 500d29878..22f8543f8 100644 --- a/database/secret/count_org_test.go +++ b/database/secret/count_org_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/constants" ) diff --git a/database/secret/count_repo.go b/database/secret/count_repo.go index c248e5ee5..f734054a5 100644 --- a/database/secret/count_repo.go +++ b/database/secret/count_repo.go @@ -5,9 +5,10 @@ package secret import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CountSecretsForRepo gets the count of secrets by org and repo name from the database. diff --git a/database/secret/count_repo_test.go b/database/secret/count_repo_test.go index fd5afacb4..c925853f8 100644 --- a/database/secret/count_repo_test.go +++ b/database/secret/count_repo_test.go @@ -7,9 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/constants" - "github.com/DATA-DOG/go-sqlmock" + + "github.com/go-vela/types/constants" ) func TestSecret_Engine_CountSecretsForRepo(t *testing.T) { diff --git a/database/secret/count_team.go b/database/secret/count_team.go index 2dcce27ef..55445b504 100644 --- a/database/secret/count_team.go +++ b/database/secret/count_team.go @@ -6,8 +6,9 @@ import ( "context" "strings" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // CountSecretsForTeam gets the count of secrets by org and team name from the database. diff --git a/database/secret/count_team_test.go b/database/secret/count_team_test.go index 07db848e9..071e7902f 100644 --- a/database/secret/count_team_test.go +++ b/database/secret/count_team_test.go @@ -7,9 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/constants" - "github.com/DATA-DOG/go-sqlmock" + + "github.com/go-vela/types/constants" ) func TestSecret_Engine_CountSecretsForTeam(t *testing.T) { diff --git a/database/secret/create.go b/database/secret/create.go index 4c8853bd8..c8b0400d1 100644 --- a/database/secret/create.go +++ b/database/secret/create.go @@ -7,10 +7,11 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateSecret creates a new secret in the database. diff --git a/database/secret/create_test.go b/database/secret/create_test.go index 210a57b99..7ec36795b 100644 --- a/database/secret/create_test.go +++ b/database/secret/create_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/secret/delete.go b/database/secret/delete.go index b4068faec..5b3653ba1 100644 --- a/database/secret/delete.go +++ b/database/secret/delete.go @@ -5,10 +5,11 @@ package secret import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteSecret deletes an existing secret from the database. diff --git a/database/secret/delete_test.go b/database/secret/delete_test.go index 0c078c98f..57db11e88 100644 --- a/database/secret/delete_test.go +++ b/database/secret/delete_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/secret/get_org.go b/database/secret/get_org.go index 950368735..fec7ff1ef 100644 --- a/database/secret/get_org.go +++ b/database/secret/get_org.go @@ -5,10 +5,11 @@ package secret import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetSecretForOrg gets a secret by org name from the database. diff --git a/database/secret/get_org_test.go b/database/secret/get_org_test.go index 51ca298d2..af127fab3 100644 --- a/database/secret/get_org_test.go +++ b/database/secret/get_org_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" ) diff --git a/database/secret/get_repo.go b/database/secret/get_repo.go index d1ae48e7f..6edacafd1 100644 --- a/database/secret/get_repo.go +++ b/database/secret/get_repo.go @@ -5,11 +5,12 @@ package secret import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetSecretForRepo gets a secret by org and repo name from the database. diff --git a/database/secret/get_repo_test.go b/database/secret/get_repo_test.go index fb1c1ca9b..99ea7610d 100644 --- a/database/secret/get_repo_test.go +++ b/database/secret/get_repo_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" ) diff --git a/database/secret/get_team.go b/database/secret/get_team.go index b11a9fd41..74e4a57f9 100644 --- a/database/secret/get_team.go +++ b/database/secret/get_team.go @@ -5,10 +5,11 @@ package secret import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetSecretForTeam gets a secret by org and team name from the database. diff --git a/database/secret/get_team_test.go b/database/secret/get_team_test.go index f34e6f2b6..96e3bf880 100644 --- a/database/secret/get_team_test.go +++ b/database/secret/get_team_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" ) diff --git a/database/secret/get_test.go b/database/secret/get_test.go index 16e456c12..0d38aa679 100644 --- a/database/secret/get_test.go +++ b/database/secret/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/secret/list_org.go b/database/secret/list_org.go index bb57d4eb3..63cf5f899 100644 --- a/database/secret/list_org.go +++ b/database/secret/list_org.go @@ -5,10 +5,11 @@ package secret import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListSecretsForOrg gets a list of secrets by org name from the database. diff --git a/database/secret/list_org_test.go b/database/secret/list_org_test.go index 14493ef38..f3a95f0cd 100644 --- a/database/secret/list_org_test.go +++ b/database/secret/list_org_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" ) diff --git a/database/secret/list_repo.go b/database/secret/list_repo.go index a2731e321..0be77454c 100644 --- a/database/secret/list_repo.go +++ b/database/secret/list_repo.go @@ -5,11 +5,12 @@ package secret import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListSecretsForRepo gets a list of secrets by org name from the database. diff --git a/database/secret/list_repo_test.go b/database/secret/list_repo_test.go index 304520c3e..1b70c1bda 100644 --- a/database/secret/list_repo_test.go +++ b/database/secret/list_repo_test.go @@ -7,9 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/constants" - "github.com/DATA-DOG/go-sqlmock" + + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" ) diff --git a/database/secret/list_team.go b/database/secret/list_team.go index 1f5e317c5..f9a17c2fd 100644 --- a/database/secret/list_team.go +++ b/database/secret/list_team.go @@ -6,10 +6,11 @@ import ( "context" "strings" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListSecretsForTeam gets a list of secrets by org and team name from the database. diff --git a/database/secret/list_team_test.go b/database/secret/list_team_test.go index 89b40b237..81708949a 100644 --- a/database/secret/list_team_test.go +++ b/database/secret/list_team_test.go @@ -7,9 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/constants" - "github.com/DATA-DOG/go-sqlmock" + + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" ) diff --git a/database/secret/list_test.go b/database/secret/list_test.go index c050d452d..aa72d5baf 100644 --- a/database/secret/list_test.go +++ b/database/secret/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/secret/opts.go b/database/secret/opts.go index cb1589d32..2a6216989 100644 --- a/database/secret/opts.go +++ b/database/secret/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/secret/opts_test.go b/database/secret/opts_test.go index f446c09f2..7865daef9 100644 --- a/database/secret/opts_test.go +++ b/database/secret/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/secret/secret.go b/database/secret/secret.go index 7cf9981c8..55e20b59f 100644 --- a/database/secret/secret.go +++ b/database/secret/secret.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/secret/secret_test.go b/database/secret/secret_test.go index cbbefd9e2..fdc10818c 100644 --- a/database/secret/secret_test.go +++ b/database/secret/secret_test.go @@ -9,14 +9,14 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" - "github.com/go-vela/types/library/actions" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + api "github.com/go-vela/server/api/types" + "github.com/go-vela/types/library" + "github.com/go-vela/types/library/actions" ) func TestSecret_New(t *testing.T) { diff --git a/database/secret/update.go b/database/secret/update.go index 04fc98b84..641a8a3e3 100644 --- a/database/secret/update.go +++ b/database/secret/update.go @@ -7,10 +7,11 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateSecret updates an existing secret in the database. diff --git a/database/secret/update_test.go b/database/secret/update_test.go index 0502de911..11b6245a1 100644 --- a/database/secret/update_test.go +++ b/database/secret/update_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/service/clean.go b/database/service/clean.go index e9e42de58..b4becb0ad 100644 --- a/database/service/clean.go +++ b/database/service/clean.go @@ -6,10 +6,11 @@ import ( "context" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CleanServices updates services to an error with a created timestamp prior to a defined moment. diff --git a/database/service/count_build.go b/database/service/count_build.go index a70c326d2..f1d9f1e36 100644 --- a/database/service/count_build.go +++ b/database/service/count_build.go @@ -5,9 +5,10 @@ package service import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CountServicesForBuild gets the count of services by build ID from the database. diff --git a/database/service/create.go b/database/service/create.go index dc5726dea..6d2ec8f74 100644 --- a/database/service/create.go +++ b/database/service/create.go @@ -5,10 +5,11 @@ package service import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateService creates a new service in the database. diff --git a/database/service/delete.go b/database/service/delete.go index 90fc552f6..5762fbb8d 100644 --- a/database/service/delete.go +++ b/database/service/delete.go @@ -5,10 +5,11 @@ package service import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteService deletes an existing service from the database. diff --git a/database/service/get_build.go b/database/service/get_build.go index 8822743f8..cc4109762 100644 --- a/database/service/get_build.go +++ b/database/service/get_build.go @@ -5,10 +5,11 @@ package service import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetServiceForBuild gets a service by number and build ID from the database. diff --git a/database/service/get_build_test.go b/database/service/get_build_test.go index b8f859649..af26ee7d0 100644 --- a/database/service/get_build_test.go +++ b/database/service/get_build_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/service/get_test.go b/database/service/get_test.go index 8aa8961e5..edeb82b9e 100644 --- a/database/service/get_test.go +++ b/database/service/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/service/list_build.go b/database/service/list_build.go index b273835f8..020f53fa0 100644 --- a/database/service/list_build.go +++ b/database/service/list_build.go @@ -5,10 +5,11 @@ package service import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListServicesForBuild gets a list of all services from the database. diff --git a/database/service/list_build_test.go b/database/service/list_build_test.go index f33e98ac3..283f7fe5b 100644 --- a/database/service/list_build_test.go +++ b/database/service/list_build_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/service/list_test.go b/database/service/list_test.go index 24f718e94..6fcecdfd4 100644 --- a/database/service/list_test.go +++ b/database/service/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/service/opts.go b/database/service/opts.go index c06c6a931..6ed08ed22 100644 --- a/database/service/opts.go +++ b/database/service/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/service/opts_test.go b/database/service/opts_test.go index 043d1e290..f34c53126 100644 --- a/database/service/opts_test.go +++ b/database/service/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/service/service.go b/database/service/service.go index 0f1b92b7d..f02f6ae6b 100644 --- a/database/service/service.go +++ b/database/service/service.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/service/service_test.go b/database/service/service_test.go index e1f6f92f3..73a113568 100644 --- a/database/service/service_test.go +++ b/database/service/service_test.go @@ -9,12 +9,12 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + "github.com/go-vela/types/library" ) func TestService_New(t *testing.T) { diff --git a/database/service/update.go b/database/service/update.go index 677a2c71c..da6417aab 100644 --- a/database/service/update.go +++ b/database/service/update.go @@ -5,10 +5,11 @@ package service import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateService updates an existing service in the database. diff --git a/database/step/clean.go b/database/step/clean.go index 0dc685709..3e75c906b 100644 --- a/database/step/clean.go +++ b/database/step/clean.go @@ -6,10 +6,11 @@ import ( "context" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CleanSteps updates steps to an error with a created timestamp prior to a defined moment. diff --git a/database/step/count.go b/database/step/count.go index b47668bd0..12ef7afc4 100644 --- a/database/step/count.go +++ b/database/step/count.go @@ -4,6 +4,7 @@ package step import ( "context" + "github.com/go-vela/types/constants" ) diff --git a/database/step/count_build.go b/database/step/count_build.go index 8da485331..595811112 100644 --- a/database/step/count_build.go +++ b/database/step/count_build.go @@ -4,9 +4,11 @@ package step import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CountStepsForBuild gets the count of steps by build ID from the database. diff --git a/database/step/create.go b/database/step/create.go index a4ab98cfe..99c9987b4 100644 --- a/database/step/create.go +++ b/database/step/create.go @@ -4,10 +4,12 @@ package step import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateStep creates a new step in the database. diff --git a/database/step/delete.go b/database/step/delete.go index 5b185a447..98e895def 100644 --- a/database/step/delete.go +++ b/database/step/delete.go @@ -4,10 +4,12 @@ package step import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteStep deletes an existing step from the database. diff --git a/database/step/get.go b/database/step/get.go index 8884fe51a..d75217f58 100644 --- a/database/step/get.go +++ b/database/step/get.go @@ -4,6 +4,7 @@ package step import ( "context" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/step/get_build.go b/database/step/get_build.go index 6be0d3cb1..99ed00026 100644 --- a/database/step/get_build.go +++ b/database/step/get_build.go @@ -4,10 +4,12 @@ package step import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetStepForBuild gets a step by number and build ID from the database. diff --git a/database/step/get_build_test.go b/database/step/get_build_test.go index b372a0c50..1906dc3f1 100644 --- a/database/step/get_build_test.go +++ b/database/step/get_build_test.go @@ -7,8 +7,9 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - "github.com/go-vela/types/library" "github.com/google/go-cmp/cmp" + + "github.com/go-vela/types/library" ) func TestStep_Engine_GetStepForBuild(t *testing.T) { diff --git a/database/step/get_test.go b/database/step/get_test.go index 7e17a744c..a9e5106a1 100644 --- a/database/step/get_test.go +++ b/database/step/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/step/interface.go b/database/step/interface.go index 70bbc1c72..3c41017a9 100644 --- a/database/step/interface.go +++ b/database/step/interface.go @@ -4,6 +4,7 @@ package step import ( "context" + "github.com/go-vela/types/library" ) diff --git a/database/step/list.go b/database/step/list.go index b4dd0a329..afbb9f818 100644 --- a/database/step/list.go +++ b/database/step/list.go @@ -4,6 +4,7 @@ package step import ( "context" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/step/list_build.go b/database/step/list_build.go index 0a446af27..dbf8a717a 100644 --- a/database/step/list_build.go +++ b/database/step/list_build.go @@ -4,10 +4,12 @@ package step import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // ListStepsForBuild gets a list of all steps from the database. diff --git a/database/step/list_build_test.go b/database/step/list_build_test.go index dbee0b395..46fda88a4 100644 --- a/database/step/list_build_test.go +++ b/database/step/list_build_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/step/list_test.go b/database/step/list_test.go index 2f8323faf..bed53585c 100644 --- a/database/step/list_test.go +++ b/database/step/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/step/opts.go b/database/step/opts.go index 50fdc6eb6..520c60d8d 100644 --- a/database/step/opts.go +++ b/database/step/opts.go @@ -4,8 +4,8 @@ package step import ( "context" - "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus" "gorm.io/gorm" ) diff --git a/database/step/opts_test.go b/database/step/opts_test.go index 6338b2f51..f3fcc3797 100644 --- a/database/step/opts_test.go +++ b/database/step/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/step/step.go b/database/step/step.go index 96e3989ab..edb3cb26e 100644 --- a/database/step/step.go +++ b/database/step/step.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/step/step_test.go b/database/step/step_test.go index e3101147d..861937831 100644 --- a/database/step/step_test.go +++ b/database/step/step_test.go @@ -9,12 +9,12 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + "github.com/go-vela/types/library" ) func TestStep_New(t *testing.T) { diff --git a/database/step/update.go b/database/step/update.go index 2417c87a0..57fee9e74 100644 --- a/database/step/update.go +++ b/database/step/update.go @@ -4,10 +4,12 @@ package step import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateStep updates an existing step in the database. diff --git a/database/user/create.go b/database/user/create.go index 6010d1e8f..fdd289f34 100644 --- a/database/user/create.go +++ b/database/user/create.go @@ -7,10 +7,11 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // CreateUser creates a new user in the database. diff --git a/database/user/delete.go b/database/user/delete.go index 5747bf404..ed3d9491e 100644 --- a/database/user/delete.go +++ b/database/user/delete.go @@ -5,10 +5,11 @@ package user import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // DeleteUser deletes an existing user from the database. diff --git a/database/user/get_name.go b/database/user/get_name.go index d23ce1611..6caf2d745 100644 --- a/database/user/get_name.go +++ b/database/user/get_name.go @@ -5,10 +5,11 @@ package user import ( "context" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // GetUserForName gets a user by name from the database. diff --git a/database/user/get_name_test.go b/database/user/get_name_test.go index 621a75c87..3deed039e 100644 --- a/database/user/get_name_test.go +++ b/database/user/get_name_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/user/get_test.go b/database/user/get_test.go index f879b8bd9..c8f00fba5 100644 --- a/database/user/get_test.go +++ b/database/user/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/user/list_lite_test.go b/database/user/list_lite_test.go index 431b7705b..aeacb0676 100644 --- a/database/user/list_lite_test.go +++ b/database/user/list_lite_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/user/list_test.go b/database/user/list_test.go index da61b5b67..0472037ed 100644 --- a/database/user/list_test.go +++ b/database/user/list_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + "github.com/go-vela/types/library" ) diff --git a/database/user/opts.go b/database/user/opts.go index 4901e5be3..96bdf8b38 100644 --- a/database/user/opts.go +++ b/database/user/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/user/opts_test.go b/database/user/opts_test.go index 77c74506c..05df3e33e 100644 --- a/database/user/opts_test.go +++ b/database/user/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/user/update.go b/database/user/update.go index 043ed71de..e321aba17 100644 --- a/database/user/update.go +++ b/database/user/update.go @@ -7,10 +7,11 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // UpdateUser updates an existing user in the database. diff --git a/database/user/user.go b/database/user/user.go index 2cf13feb2..23948bfb3 100644 --- a/database/user/user.go +++ b/database/user/user.go @@ -6,10 +6,10 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" - "gorm.io/gorm" + + "github.com/go-vela/types/constants" ) type ( diff --git a/database/user/user_test.go b/database/user/user_test.go index a3ab4ff11..267a961e3 100644 --- a/database/user/user_test.go +++ b/database/user/user_test.go @@ -8,12 +8,12 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + "github.com/go-vela/types/library" ) func TestUser_New(t *testing.T) { diff --git a/database/validate.go b/database/validate.go index 4c519d081..8025b325e 100644 --- a/database/validate.go +++ b/database/validate.go @@ -6,8 +6,9 @@ import ( "fmt" "strings" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // Validate verifies the required fields from the provided configuration are populated correctly. diff --git a/database/worker/create.go b/database/worker/create.go index 131bb393f..43232a71d 100644 --- a/database/worker/create.go +++ b/database/worker/create.go @@ -5,9 +5,10 @@ package worker import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // CreateWorker creates a new worker in the database. diff --git a/database/worker/delete.go b/database/worker/delete.go index ee391567e..a20e46487 100644 --- a/database/worker/delete.go +++ b/database/worker/delete.go @@ -5,9 +5,10 @@ package worker import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // DeleteWorker deletes an existing worker from the database. diff --git a/database/worker/get_hostname.go b/database/worker/get_hostname.go index f596850af..6f046f8dd 100644 --- a/database/worker/get_hostname.go +++ b/database/worker/get_hostname.go @@ -5,9 +5,10 @@ package worker import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // GetWorkerForHostname gets a worker by hostname from the database. diff --git a/database/worker/get_hostname_test.go b/database/worker/get_hostname_test.go index 7d5043340..a65854eba 100644 --- a/database/worker/get_hostname_test.go +++ b/database/worker/get_hostname_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" ) diff --git a/database/worker/get_test.go b/database/worker/get_test.go index 566f8232b..33d9c37e7 100644 --- a/database/worker/get_test.go +++ b/database/worker/get_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" + api "github.com/go-vela/server/api/types" ) diff --git a/database/worker/list_test.go b/database/worker/list_test.go index 4de8883a6..948230b3b 100644 --- a/database/worker/list_test.go +++ b/database/worker/list_test.go @@ -8,8 +8,9 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" "github.com/google/go-cmp/cmp" + + api "github.com/go-vela/server/api/types" ) func TestWorker_Engine_ListWorkers(t *testing.T) { diff --git a/database/worker/opts.go b/database/worker/opts.go index 71048282b..b2f3a570a 100644 --- a/database/worker/opts.go +++ b/database/worker/opts.go @@ -6,7 +6,6 @@ import ( "context" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/worker/opts_test.go b/database/worker/opts_test.go index f627d25ed..2484f6455 100644 --- a/database/worker/opts_test.go +++ b/database/worker/opts_test.go @@ -8,7 +8,6 @@ import ( "testing" "github.com/sirupsen/logrus" - "gorm.io/gorm" ) diff --git a/database/worker/update.go b/database/worker/update.go index 0349ffe85..4626ce746 100644 --- a/database/worker/update.go +++ b/database/worker/update.go @@ -5,9 +5,10 @@ package worker import ( "context" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // UpdateWorker updates an existing worker in the database. diff --git a/database/worker/worker.go b/database/worker/worker.go index d12055ded..f05c7198c 100644 --- a/database/worker/worker.go +++ b/database/worker/worker.go @@ -9,14 +9,14 @@ import ( "fmt" "strconv" + "github.com/lib/pq" + "github.com/sirupsen/logrus" + "gorm.io/gorm" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/lib/pq" - "github.com/sirupsen/logrus" - - "gorm.io/gorm" ) var ( diff --git a/database/worker/worker_test.go b/database/worker/worker_test.go index 8c6896eb7..9a4201218 100644 --- a/database/worker/worker_test.go +++ b/database/worker/worker_test.go @@ -7,13 +7,13 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/types/library" "github.com/sirupsen/logrus" - "gorm.io/driver/postgres" "gorm.io/driver/sqlite" "gorm.io/gorm" + + api "github.com/go-vela/server/api/types" + "github.com/go-vela/types/library" ) func TestWorker_New(t *testing.T) { diff --git a/internal/token/compose.go b/internal/token/compose.go index df3d9c652..4dd63860a 100644 --- a/internal/token/compose.go +++ b/internal/token/compose.go @@ -7,6 +7,7 @@ import ( "net/url" "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" diff --git a/internal/token/compose_test.go b/internal/token/compose_test.go index 44e06f3b5..3026730a5 100644 --- a/internal/token/compose_test.go +++ b/internal/token/compose_test.go @@ -9,11 +9,11 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + "github.com/go-vela/server/internal" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - jwt "github.com/golang-jwt/jwt/v5" ) func TestToken_Compose(t *testing.T) { diff --git a/internal/token/mint.go b/internal/token/mint.go index 22c9599b9..dab99ae46 100644 --- a/internal/token/mint.go +++ b/internal/token/mint.go @@ -7,9 +7,10 @@ import ( "fmt" "time" + "github.com/golang-jwt/jwt/v5" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/golang-jwt/jwt/v5" ) // Claims struct is an extension of the JWT standard claims. It diff --git a/internal/token/parse_test.go b/internal/token/parse_test.go index c1e5d3ac0..777a5fa01 100644 --- a/internal/token/parse_test.go +++ b/internal/token/parse_test.go @@ -8,10 +8,10 @@ import ( "time" "github.com/gin-gonic/gin" + jwt "github.com/golang-jwt/jwt/v5" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - jwt "github.com/golang-jwt/jwt/v5" ) func TestTokenManager_ParseToken(t *testing.T) { diff --git a/internal/token/refresh.go b/internal/token/refresh.go index 678c5ccb0..257391230 100644 --- a/internal/token/refresh.go +++ b/internal/token/refresh.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" "github.com/go-vela/types/constants" ) diff --git a/internal/token/refresh_test.go b/internal/token/refresh_test.go index 6618b88c9..bfc132c15 100644 --- a/internal/token/refresh_test.go +++ b/internal/token/refresh_test.go @@ -10,10 +10,11 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + "github.com/go-vela/server/database" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/golang-jwt/jwt/v5" ) func TestTokenManager_Refresh(t *testing.T) { diff --git a/mock/server/authentication.go b/mock/server/authentication.go index 5c99ee8c9..094915768 100644 --- a/mock/server/authentication.go +++ b/mock/server/authentication.go @@ -7,6 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" diff --git a/mock/server/build.go b/mock/server/build.go index 4b5d8c1d4..1d15a5c10 100644 --- a/mock/server/build.go +++ b/mock/server/build.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/deployment.go b/mock/server/deployment.go index 758d6d208..e68e24d07 100644 --- a/mock/server/deployment.go +++ b/mock/server/deployment.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/hook.go b/mock/server/hook.go index b31967211..58078da99 100644 --- a/mock/server/hook.go +++ b/mock/server/hook.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/log.go b/mock/server/log.go index fffefaedf..98b359b57 100644 --- a/mock/server/log.go +++ b/mock/server/log.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/pipeline.go b/mock/server/pipeline.go index 73ee1b42f..0d90cf45d 100644 --- a/mock/server/pipeline.go +++ b/mock/server/pipeline.go @@ -8,13 +8,12 @@ import ( "net/http" "strings" - "github.com/go-vela/types/library" - + yml "github.com/buildkite/yaml" "github.com/gin-gonic/gin" + "github.com/go-vela/types" + "github.com/go-vela/types/library" "github.com/go-vela/types/yaml" - - yml "github.com/buildkite/yaml" ) const ( diff --git a/mock/server/repo.go b/mock/server/repo.go index 79b82b7df..aba7cbaf9 100644 --- a/mock/server/repo.go +++ b/mock/server/repo.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types" ) diff --git a/mock/server/schedule.go b/mock/server/schedule.go index 0bc2fd017..417890cd7 100644 --- a/mock/server/schedule.go +++ b/mock/server/schedule.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/scm.go b/mock/server/scm.go index 0dea97c37..e191da268 100644 --- a/mock/server/scm.go +++ b/mock/server/scm.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" ) diff --git a/mock/server/secret.go b/mock/server/secret.go index 5030ce3cd..6cd45047f 100644 --- a/mock/server/secret.go +++ b/mock/server/secret.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/service.go b/mock/server/service.go index a4111611a..c42e97dd6 100644 --- a/mock/server/service.go +++ b/mock/server/service.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/step.go b/mock/server/step.go index 75fcdacf4..ff4c32ce8 100644 --- a/mock/server/step.go +++ b/mock/server/step.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/user.go b/mock/server/user.go index 1ec672b47..ea2a5fc78 100644 --- a/mock/server/user.go +++ b/mock/server/user.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/go-vela/types" "github.com/go-vela/types/library" ) diff --git a/mock/server/worker.go b/mock/server/worker.go index edc758460..6e5e6ac5e 100644 --- a/mock/server/worker.go +++ b/mock/server/worker.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types" "github.com/go-vela/types/library" diff --git a/queue/flags.go b/queue/flags.go index 6fc3a6f19..35e5745f5 100644 --- a/queue/flags.go +++ b/queue/flags.go @@ -5,8 +5,9 @@ package queue import ( "time" - "github.com/go-vela/types/constants" "github.com/urfave/cli/v2" + + "github.com/go-vela/types/constants" ) // Flags represents all supported command line diff --git a/queue/queue.go b/queue/queue.go index 8288375e1..fe2946f1b 100644 --- a/queue/queue.go +++ b/queue/queue.go @@ -5,8 +5,9 @@ package queue import ( "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // New creates and returns a Vela service capable of diff --git a/queue/redis/driver_test.go b/queue/redis/driver_test.go index e9736d326..8ed67a3a5 100644 --- a/queue/redis/driver_test.go +++ b/queue/redis/driver_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/alicebob/miniredis/v2" + "github.com/go-vela/types/constants" ) diff --git a/queue/redis/length_test.go b/queue/redis/length_test.go index 3f27ce60f..cf02377aa 100644 --- a/queue/redis/length_test.go +++ b/queue/redis/length_test.go @@ -7,8 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/server/queue/models" "gopkg.in/square/go-jose.v2/json" + + "github.com/go-vela/server/queue/models" ) func TestRedis_Length(t *testing.T) { diff --git a/queue/redis/ping_test.go b/queue/redis/ping_test.go index 29f84ee26..d069370f2 100644 --- a/queue/redis/ping_test.go +++ b/queue/redis/ping_test.go @@ -5,9 +5,10 @@ package redis import ( "context" "fmt" - "github.com/alicebob/miniredis/v2" "testing" "time" + + "github.com/alicebob/miniredis/v2" ) func TestRedis_Ping_Good(t *testing.T) { diff --git a/queue/redis/pop.go b/queue/redis/pop.go index bd5872c9a..4d1af3921 100644 --- a/queue/redis/pop.go +++ b/queue/redis/pop.go @@ -7,9 +7,10 @@ import ( "encoding/json" "errors" - "github.com/go-vela/server/queue/models" "github.com/redis/go-redis/v9" "golang.org/x/crypto/nacl/sign" + + "github.com/go-vela/server/queue/models" ) // Pop grabs an item from the specified channel off the queue. diff --git a/queue/redis/pop_test.go b/queue/redis/pop_test.go index e95f828ab..a5ae4fd0b 100644 --- a/queue/redis/pop_test.go +++ b/queue/redis/pop_test.go @@ -7,10 +7,11 @@ import ( "testing" "time" - "github.com/go-vela/server/queue/models" "github.com/google/go-cmp/cmp" "golang.org/x/crypto/nacl/sign" "gopkg.in/square/go-jose.v2/json" + + "github.com/go-vela/server/queue/models" ) func TestRedis_Pop(t *testing.T) { diff --git a/queue/redis/redis.go b/queue/redis/redis.go index 643cb51e2..5a789ed58 100644 --- a/queue/redis/redis.go +++ b/queue/redis/redis.go @@ -6,7 +6,6 @@ import ( "context" "fmt" "strings" - "time" "github.com/alicebob/miniredis/v2" diff --git a/queue/redis/redis_test.go b/queue/redis/redis_test.go index ee4a35a9b..cecfe08cf 100644 --- a/queue/redis/redis_test.go +++ b/queue/redis/redis_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/alicebob/miniredis/v2" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" ) diff --git a/queue/setup.go b/queue/setup.go index f240c9fe6..cdac822ea 100644 --- a/queue/setup.go +++ b/queue/setup.go @@ -7,9 +7,10 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/queue/redis" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // Setup represents the configuration necessary for diff --git a/router/admin.go b/router/admin.go index cc321346e..c279445eb 100644 --- a/router/admin.go +++ b/router/admin.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/admin" "github.com/go-vela/server/router/middleware/perm" ) diff --git a/router/build.go b/router/build.go index 2464dba84..44091b1f0 100644 --- a/router/build.go +++ b/router/build.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/build" "github.com/go-vela/server/api/log" "github.com/go-vela/server/router/middleware" diff --git a/router/deployment.go b/router/deployment.go index 4269da663..0f7640561 100644 --- a/router/deployment.go +++ b/router/deployment.go @@ -4,9 +4,9 @@ package router import ( "github.com/gin-gonic/gin" - "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/api/deployment" + "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/perm" "github.com/go-vela/server/router/middleware/repo" ) diff --git a/router/hook.go b/router/hook.go index 503ad77c1..69816fa4c 100644 --- a/router/hook.go +++ b/router/hook.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/hook" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/perm" diff --git a/router/log.go b/router/log.go index 6fbea4888..9806aca82 100644 --- a/router/log.go +++ b/router/log.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/log" "github.com/go-vela/server/router/middleware/perm" ) diff --git a/router/middleware/auth/auth.go b/router/middleware/auth/auth.go index 09e9319c2..53ed6a8eb 100644 --- a/router/middleware/auth/auth.go +++ b/router/middleware/auth/auth.go @@ -6,9 +6,9 @@ import ( "fmt" "net/http" - "github.com/go-vela/types/constants" - "github.com/golang-jwt/jwt/v5/request" + + "github.com/go-vela/types/constants" ) // RetrieveAccessToken gets the passed in access token from the header in the request. diff --git a/router/middleware/build/build.go b/router/middleware/build/build.go index 70eba1b9a..3c574e3e0 100644 --- a/router/middleware/build/build.go +++ b/router/middleware/build/build.go @@ -8,13 +8,14 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Retrieve gets the build in the given context. diff --git a/router/middleware/build/build_test.go b/router/middleware/build/build_test.go index b3be6b0c3..624e01497 100644 --- a/router/middleware/build/build_test.go +++ b/router/middleware/build/build_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" diff --git a/router/middleware/build/context_test.go b/router/middleware/build/context_test.go index 43dd8fe5f..66fd2d88b 100644 --- a/router/middleware/build/context_test.go +++ b/router/middleware/build/context_test.go @@ -5,9 +5,9 @@ package build import ( "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestBuild_FromContext(t *testing.T) { diff --git a/router/middleware/claims/claims.go b/router/middleware/claims/claims.go index a81a456fe..75a30caa0 100644 --- a/router/middleware/claims/claims.go +++ b/router/middleware/claims/claims.go @@ -6,12 +6,12 @@ import ( "net/http" "strings" + "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/auth" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - - "github.com/gin-gonic/gin" ) // Retrieve gets the claims in the given context. diff --git a/router/middleware/claims/claims_test.go b/router/middleware/claims/claims_test.go index 2eb89b3bd..ac1cd4554 100644 --- a/router/middleware/claims/claims_test.go +++ b/router/middleware/claims/claims_test.go @@ -13,11 +13,12 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/golang-jwt/jwt/v5" ) func TestClaims_Retrieve(t *testing.T) { diff --git a/router/middleware/claims/context_test.go b/router/middleware/claims/context_test.go index 55bbf9241..b4f91baac 100644 --- a/router/middleware/claims/context_test.go +++ b/router/middleware/claims/context_test.go @@ -6,11 +6,11 @@ import ( "testing" "time" - "github.com/go-vela/server/internal/token" - "github.com/go-vela/types/constants" + "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt/v5" - "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal/token" + "github.com/go-vela/types/constants" ) func TestClaims_FromContext(t *testing.T) { diff --git a/router/middleware/compiler.go b/router/middleware/compiler.go index 503040192..be25a9992 100644 --- a/router/middleware/compiler.go +++ b/router/middleware/compiler.go @@ -4,6 +4,7 @@ package middleware import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/compiler" ) diff --git a/router/middleware/compiler_test.go b/router/middleware/compiler_test.go index 8a64f5176..517de8881 100644 --- a/router/middleware/compiler_test.go +++ b/router/middleware/compiler_test.go @@ -9,12 +9,11 @@ import ( "reflect" "testing" - "github.com/go-vela/server/compiler" - "github.com/go-vela/server/compiler/native" - "github.com/gin-gonic/gin" - "github.com/urfave/cli/v2" + + "github.com/go-vela/server/compiler" + "github.com/go-vela/server/compiler/native" ) func TestMiddleware_CompilerNative(t *testing.T) { diff --git a/router/middleware/database.go b/router/middleware/database.go index 38755fa89..e5ce7ec98 100644 --- a/router/middleware/database.go +++ b/router/middleware/database.go @@ -4,6 +4,7 @@ package middleware import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" ) diff --git a/router/middleware/database_test.go b/router/middleware/database_test.go index 8b7cca49c..96a52c449 100644 --- a/router/middleware/database_test.go +++ b/router/middleware/database_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" ) diff --git a/router/middleware/default_repo_settings_test.go b/router/middleware/default_repo_settings_test.go index 1e5a1b744..75cc7a02a 100644 --- a/router/middleware/default_repo_settings_test.go +++ b/router/middleware/default_repo_settings_test.go @@ -8,9 +8,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/constants" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/constants" ) func TestMiddleware_DefaultRepoEvents(t *testing.T) { diff --git a/router/middleware/executors/context_test.go b/router/middleware/executors/context_test.go index f7e080d61..b84b2598b 100644 --- a/router/middleware/executors/context_test.go +++ b/router/middleware/executors/context_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" ) diff --git a/router/middleware/executors/executor_test.go b/router/middleware/executors/executor_test.go index 423336a10..8ce9dc58a 100644 --- a/router/middleware/executors/executor_test.go +++ b/router/middleware/executors/executor_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" ) diff --git a/router/middleware/executors/executors.go b/router/middleware/executors/executors.go index 8ea9de2c1..21616d64a 100644 --- a/router/middleware/executors/executors.go +++ b/router/middleware/executors/executors.go @@ -12,6 +12,7 @@ import ( "time" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" diff --git a/router/middleware/header.go b/router/middleware/header.go index 980243f16..c65a003af 100644 --- a/router/middleware/header.go +++ b/router/middleware/header.go @@ -7,6 +7,7 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal" "github.com/go-vela/server/version" ) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index dfa18e063..bd6d41fc5 100644 --- a/router/middleware/header_test.go +++ b/router/middleware/header_test.go @@ -11,6 +11,7 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal" ) diff --git a/router/middleware/logger.go b/router/middleware/logger.go index 4f85a397e..f7205ebe2 100644 --- a/router/middleware/logger.go +++ b/router/middleware/logger.go @@ -6,6 +6,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/worker" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // This file, in part, reproduces portions of diff --git a/router/middleware/logger_test.go b/router/middleware/logger_test.go index 18677ae7c..46993f221 100644 --- a/router/middleware/logger_test.go +++ b/router/middleware/logger_test.go @@ -14,6 +14,9 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/sirupsen/logrus/hooks/test" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/repo" @@ -22,8 +25,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/router/middleware/worker" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" - "github.com/sirupsen/logrus/hooks/test" ) func TestMiddleware_Logger(t *testing.T) { diff --git a/router/middleware/metadata.go b/router/middleware/metadata.go index 672491d1d..d1d6122a2 100644 --- a/router/middleware/metadata.go +++ b/router/middleware/metadata.go @@ -4,6 +4,7 @@ package middleware import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal" ) diff --git a/router/middleware/metadata_test.go b/router/middleware/metadata_test.go index 8e955805b..6e3161c96 100644 --- a/router/middleware/metadata_test.go +++ b/router/middleware/metadata_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/server/internal" ) diff --git a/router/middleware/org/org.go b/router/middleware/org/org.go index b53c223d8..70efcdfc9 100644 --- a/router/middleware/org/org.go +++ b/router/middleware/org/org.go @@ -7,6 +7,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/go-vela/server/util" ) diff --git a/router/middleware/org/org_test.go b/router/middleware/org/org_test.go index a54d9ad33..f540a8623 100644 --- a/router/middleware/org/org_test.go +++ b/router/middleware/org/org_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" ) diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index 3cac40571..f32d34dea 100644 --- a/router/middleware/perm/perm.go +++ b/router/middleware/perm/perm.go @@ -8,6 +8,8 @@ import ( "strings" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/claims" "github.com/go-vela/server/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // MustPlatformAdmin ensures the user has admin access to the platform. diff --git a/router/middleware/perm/perm_test.go b/router/middleware/perm/perm_test.go index 0628457e1..adf53ffe2 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -11,6 +11,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" @@ -23,7 +25,6 @@ import ( "github.com/go-vela/server/scm/github" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/golang-jwt/jwt/v5" ) func TestPerm_MustPlatformAdmin(t *testing.T) { diff --git a/router/middleware/pipeline/context_test.go b/router/middleware/pipeline/context_test.go index d9379d943..4ec7c6607 100644 --- a/router/middleware/pipeline/context_test.go +++ b/router/middleware/pipeline/context_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/types/library" ) diff --git a/router/middleware/pipeline/pipeline.go b/router/middleware/pipeline/pipeline.go index b8f3b819a..c8d8fc4dc 100644 --- a/router/middleware/pipeline/pipeline.go +++ b/router/middleware/pipeline/pipeline.go @@ -7,6 +7,8 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/database" "github.com/go-vela/server/internal" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Retrieve gets the pipeline in the given context. diff --git a/router/middleware/pipeline/pipeline_test.go b/router/middleware/pipeline/pipeline_test.go index 552a40989..c4356f6dc 100644 --- a/router/middleware/pipeline/pipeline_test.go +++ b/router/middleware/pipeline/pipeline_test.go @@ -13,6 +13,9 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + "github.com/urfave/cli/v2" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/compiler" "github.com/go-vela/server/compiler/native" @@ -27,8 +30,6 @@ import ( "github.com/go-vela/server/scm/github" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/golang-jwt/jwt/v5" - "github.com/urfave/cli/v2" ) func TestPipeline_Retrieve(t *testing.T) { diff --git a/router/middleware/queue.go b/router/middleware/queue.go index 0ebbe72ca..7f157ccb3 100644 --- a/router/middleware/queue.go +++ b/router/middleware/queue.go @@ -4,6 +4,7 @@ package middleware import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/queue" ) diff --git a/router/middleware/queue_test.go b/router/middleware/queue_test.go index 2f6a05fa6..af42c5422 100644 --- a/router/middleware/queue_test.go +++ b/router/middleware/queue_test.go @@ -8,10 +8,10 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin" + "github.com/go-vela/server/queue" "github.com/go-vela/server/queue/redis" - - "github.com/gin-gonic/gin" ) func TestMiddleware_Queue(t *testing.T) { diff --git a/router/middleware/repo/context_test.go b/router/middleware/repo/context_test.go index c02923ab8..2dd3c8ab8 100644 --- a/router/middleware/repo/context_test.go +++ b/router/middleware/repo/context_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" ) diff --git a/router/middleware/repo/repo.go b/router/middleware/repo/repo.go index f6f51cad7..448bc13ed 100644 --- a/router/middleware/repo/repo.go +++ b/router/middleware/repo/repo.go @@ -7,12 +7,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // Retrieve gets the repo in the given context. diff --git a/router/middleware/repo/repo_test.go b/router/middleware/repo/repo_test.go index 64321b409..41595e60f 100644 --- a/router/middleware/repo/repo_test.go +++ b/router/middleware/repo/repo_test.go @@ -9,12 +9,12 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/go-vela/server/database" ) func TestRepo_Retrieve(t *testing.T) { diff --git a/router/middleware/schedule/context_test.go b/router/middleware/schedule/context_test.go index c75974fa0..066a3a6cc 100644 --- a/router/middleware/schedule/context_test.go +++ b/router/middleware/schedule/context_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/types/library" ) diff --git a/router/middleware/schedule/schedule.go b/router/middleware/schedule/schedule.go index 59de83e41..78c5f14e5 100644 --- a/router/middleware/schedule/schedule.go +++ b/router/middleware/schedule/schedule.go @@ -7,12 +7,13 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Retrieve gets the schedule in the given context. diff --git a/router/middleware/scm.go b/router/middleware/scm.go index 3f6ddee87..d6b945d2f 100644 --- a/router/middleware/scm.go +++ b/router/middleware/scm.go @@ -4,6 +4,7 @@ package middleware import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/scm" ) diff --git a/router/middleware/scm_test.go b/router/middleware/scm_test.go index 2c37a3de9..2000b0d5d 100644 --- a/router/middleware/scm_test.go +++ b/router/middleware/scm_test.go @@ -8,10 +8,10 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin" + "github.com/go-vela/server/scm" "github.com/go-vela/server/scm/github" - - "github.com/gin-gonic/gin" ) func TestMiddleware_Scm(t *testing.T) { diff --git a/router/middleware/secret_test.go b/router/middleware/secret_test.go index 544cd28cf..c5f54bb6d 100644 --- a/router/middleware/secret_test.go +++ b/router/middleware/secret_test.go @@ -8,11 +8,11 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" "github.com/go-vela/server/secret" "github.com/go-vela/server/secret/native" - - "github.com/gin-gonic/gin" ) func TestMiddleware_Secret(t *testing.T) { diff --git a/router/middleware/secure_cookie_test.go b/router/middleware/secure_cookie_test.go index c7ceb83b9..560086bc5 100644 --- a/router/middleware/secure_cookie_test.go +++ b/router/middleware/secure_cookie_test.go @@ -7,9 +7,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-playground/assert/v2" - "github.com/gin-gonic/gin" + "github.com/go-playground/assert/v2" ) func TestCookie_SecureCookie(t *testing.T) { diff --git a/router/middleware/service/context_test.go b/router/middleware/service/context_test.go index 6751bc92f..8c1cc74f4 100644 --- a/router/middleware/service/context_test.go +++ b/router/middleware/service/context_test.go @@ -5,9 +5,9 @@ package service import ( "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestService_FromContext(t *testing.T) { diff --git a/router/middleware/service/service.go b/router/middleware/service/service.go index 1d974f4e6..32142e16b 100644 --- a/router/middleware/service/service.go +++ b/router/middleware/service/service.go @@ -8,6 +8,8 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Retrieve gets the service in the given context. diff --git a/router/middleware/service/service_test.go b/router/middleware/service/service_test.go index 612f1e55f..1d0b8fda7 100644 --- a/router/middleware/service/service_test.go +++ b/router/middleware/service/service_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" diff --git a/router/middleware/step/context_test.go b/router/middleware/step/context_test.go index 1b7932db2..c42feb41c 100644 --- a/router/middleware/step/context_test.go +++ b/router/middleware/step/context_test.go @@ -5,9 +5,9 @@ package step import ( "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestStep_FromContext(t *testing.T) { diff --git a/router/middleware/step/step.go b/router/middleware/step/step.go index 89ba1aa1f..77a710585 100644 --- a/router/middleware/step/step.go +++ b/router/middleware/step/step.go @@ -8,6 +8,8 @@ import ( "strconv" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Retrieve gets the step in the given context. diff --git a/router/middleware/step/step_test.go b/router/middleware/step/step_test.go index ee02d4a8a..265ce5306 100644 --- a/router/middleware/step/step_test.go +++ b/router/middleware/step/step_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" diff --git a/router/middleware/token_manager_test.go b/router/middleware/token_manager_test.go index 9a26f9b43..8f8bb4fa2 100644 --- a/router/middleware/token_manager_test.go +++ b/router/middleware/token_manager_test.go @@ -8,9 +8,9 @@ import ( "reflect" "testing" - "github.com/go-vela/server/internal/token" - "github.com/gin-gonic/gin" + + "github.com/go-vela/server/internal/token" ) func TestMiddleware_TokenManager(t *testing.T) { diff --git a/router/middleware/user/context_test.go b/router/middleware/user/context_test.go index ced7cd896..50d502ac2 100644 --- a/router/middleware/user/context_test.go +++ b/router/middleware/user/context_test.go @@ -5,9 +5,9 @@ package user import ( "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestUser_FromContext(t *testing.T) { diff --git a/router/middleware/user/user.go b/router/middleware/user/user.go index 71fdc1a2d..ad8676b21 100644 --- a/router/middleware/user/user.go +++ b/router/middleware/user/user.go @@ -6,15 +6,14 @@ import ( "net/http" "strings" + "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/claims" "github.com/go-vela/server/util" - "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - - "github.com/gin-gonic/gin" - "github.com/sirupsen/logrus" ) // Retrieve gets the user in the given context. diff --git a/router/middleware/user/user_test.go b/router/middleware/user/user_test.go index d84a18847..d8d97121c 100644 --- a/router/middleware/user/user_test.go +++ b/router/middleware/user/user_test.go @@ -12,6 +12,8 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/claims" @@ -19,7 +21,6 @@ import ( "github.com/go-vela/server/scm/github" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/golang-jwt/jwt/v5" ) func TestUser_Retrieve(t *testing.T) { diff --git a/router/middleware/webhook_validation_test.go b/router/middleware/webhook_validation_test.go index cb8a65639..f70d1fbdc 100644 --- a/router/middleware/webhook_validation_test.go +++ b/router/middleware/webhook_validation_test.go @@ -7,9 +7,8 @@ import ( "net/http/httptest" "testing" - "github.com/go-playground/assert/v2" - "github.com/gin-gonic/gin" + "github.com/go-playground/assert/v2" ) func TestWebhook_WebhookValidation(t *testing.T) { diff --git a/router/middleware/worker/context_test.go b/router/middleware/worker/context_test.go index 6fd731e90..3eb58d513 100644 --- a/router/middleware/worker/context_test.go +++ b/router/middleware/worker/context_test.go @@ -5,9 +5,9 @@ package worker import ( "testing" - api "github.com/go-vela/server/api/types" - "github.com/gin-gonic/gin" + + api "github.com/go-vela/server/api/types" ) func TestWorker_FromContext(t *testing.T) { diff --git a/router/middleware/worker/worker.go b/router/middleware/worker/worker.go index 5a78d14a4..d46ad1a1a 100644 --- a/router/middleware/worker/worker.go +++ b/router/middleware/worker/worker.go @@ -7,10 +7,11 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/server/util" - "github.com/sirupsen/logrus" ) // Retrieve gets the worker in the given context. diff --git a/router/middleware/worker/worker_test.go b/router/middleware/worker/worker_test.go index 277ed8c09..a59f11190 100644 --- a/router/middleware/worker/worker_test.go +++ b/router/middleware/worker/worker_test.go @@ -10,6 +10,7 @@ import ( "testing" "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/server/database" "github.com/go-vela/types/library" diff --git a/router/pipeline.go b/router/pipeline.go index 7d11a4e2e..fd982d8f7 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/pipeline" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/perm" diff --git a/router/queue.go b/router/queue.go index ca408ffe3..90452c2a8 100644 --- a/router/queue.go +++ b/router/queue.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/queue" "github.com/go-vela/server/router/middleware/perm" ) diff --git a/router/repo.go b/router/repo.go index 0ed7d1be1..3cd7ecc9f 100644 --- a/router/repo.go +++ b/router/repo.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/build" "github.com/go-vela/server/api/repo" "github.com/go-vela/server/router/middleware" diff --git a/router/router.go b/router/router.go index 57f8e3d09..8f0559ba7 100644 --- a/router/router.go +++ b/router/router.go @@ -31,6 +31,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api" "github.com/go-vela/server/api/auth" "github.com/go-vela/server/api/webhook" diff --git a/router/schedule.go b/router/schedule.go index 4a94f7737..49abaca33 100644 --- a/router/schedule.go +++ b/router/schedule.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/schedule" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/org" diff --git a/router/scm.go b/router/scm.go index 10c1cea81..1b0a7c96d 100644 --- a/router/scm.go +++ b/router/scm.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/scm" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" diff --git a/router/search.go b/router/search.go index f5679048d..d62db11b4 100644 --- a/router/search.go +++ b/router/search.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/build" ) diff --git a/router/secret.go b/router/secret.go index 419a0cab6..bb103ca5c 100644 --- a/router/secret.go +++ b/router/secret.go @@ -3,10 +3,10 @@ package router import ( + "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/secret" "github.com/go-vela/server/router/middleware/perm" - - "github.com/gin-gonic/gin" ) // SecretHandlers is a function that extends the provided base router group diff --git a/router/service.go b/router/service.go index 683a38b6f..48787d19d 100644 --- a/router/service.go +++ b/router/service.go @@ -5,6 +5,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/service" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/perm" diff --git a/router/step.go b/router/step.go index d26f70385..934e61d81 100644 --- a/router/step.go +++ b/router/step.go @@ -5,6 +5,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/step" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/perm" diff --git a/router/user.go b/router/user.go index 8f8e68fcc..64f41b6a5 100644 --- a/router/user.go +++ b/router/user.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/user" "github.com/go-vela/server/router/middleware/perm" ) diff --git a/router/worker.go b/router/worker.go index 9ab61ead0..648d1efdf 100644 --- a/router/worker.go +++ b/router/worker.go @@ -4,6 +4,7 @@ package router import ( "github.com/gin-gonic/gin" + "github.com/go-vela/server/api/worker" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/perm" diff --git a/scm/context_test.go b/scm/context_test.go index e98afa30c..6a54a456f 100644 --- a/scm/context_test.go +++ b/scm/context_test.go @@ -7,9 +7,9 @@ import ( "net/http/httptest" "testing" - "github.com/go-vela/server/scm/github" - "github.com/gin-gonic/gin" + + "github.com/go-vela/server/scm/github" ) func TestSCM_FromContext(t *testing.T) { diff --git a/scm/flags.go b/scm/flags.go index 84a9e879c..2a64f7e14 100644 --- a/scm/flags.go +++ b/scm/flags.go @@ -3,8 +3,9 @@ package scm import ( - "github.com/go-vela/types/constants" "github.com/urfave/cli/v2" + + "github.com/go-vela/types/constants" ) // Flags represents all supported command line diff --git a/scm/github/access.go b/scm/github/access.go index f6b185356..40b9b9de1 100644 --- a/scm/github/access.go +++ b/scm/github/access.go @@ -6,10 +6,10 @@ import ( "context" "strings" + "github.com/google/go-github/v61/github" "github.com/sirupsen/logrus" "github.com/go-vela/types/library" - "github.com/google/go-github/v61/github" ) // OrgAccess captures the user's access level for an org. diff --git a/scm/github/authentication.go b/scm/github/authentication.go index d41cd5a8c..1e76770fb 100644 --- a/scm/github/authentication.go +++ b/scm/github/authentication.go @@ -10,9 +10,10 @@ import ( "net/url" "strings" + "github.com/google/go-github/v61/github" + "github.com/go-vela/server/random" "github.com/go-vela/types/library" - "github.com/google/go-github/v61/github" ) // Authorize uses the given access token to authorize the user. diff --git a/scm/github/authentication_test.go b/scm/github/authentication_test.go index 47c524e4d..8c076b0c5 100644 --- a/scm/github/authentication_test.go +++ b/scm/github/authentication_test.go @@ -3,14 +3,14 @@ package github import ( + _context "context" "net/http" "net/http/httptest" "reflect" "testing" - _context "context" - "github.com/gin-gonic/gin" + "github.com/go-vela/types/library" ) diff --git a/scm/github/changeset.go b/scm/github/changeset.go index b99a00371..c36fe3c8f 100644 --- a/scm/github/changeset.go +++ b/scm/github/changeset.go @@ -6,10 +6,10 @@ import ( "context" "fmt" + "github.com/google/go-github/v61/github" "github.com/sirupsen/logrus" api "github.com/go-vela/server/api/types" - "github.com/google/go-github/v61/github" ) // Changeset captures the list of files changed for a commit. diff --git a/scm/github/deployment.go b/scm/github/deployment.go index ce0db052d..331164411 100644 --- a/scm/github/deployment.go +++ b/scm/github/deployment.go @@ -6,12 +6,12 @@ import ( "context" "encoding/json" + "github.com/google/go-github/v61/github" "github.com/sirupsen/logrus" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/library" "github.com/go-vela/types/raw" - "github.com/google/go-github/v61/github" ) // GetDeployment gets a deployment from the GitHub repo. diff --git a/scm/github/github.go b/scm/github/github.go index 4c9910653..86129c2ab 100644 --- a/scm/github/github.go +++ b/scm/github/github.go @@ -9,7 +9,6 @@ import ( "github.com/google/go-github/v61/github" "github.com/sirupsen/logrus" - "golang.org/x/oauth2" ) diff --git a/scm/github/repo.go b/scm/github/repo.go index 7a2d973f8..ced606756 100644 --- a/scm/github/repo.go +++ b/scm/github/repo.go @@ -10,12 +10,12 @@ import ( "strings" "time" + "github.com/google/go-github/v61/github" "github.com/sirupsen/logrus" api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/google/go-github/v61/github" ) // ConfigBackoff is a wrapper for Config that will retry five times if the function diff --git a/scm/github/webhook.go b/scm/github/webhook.go index 47aefee38..cd9ba0479 100644 --- a/scm/github/webhook.go +++ b/scm/github/webhook.go @@ -13,13 +13,13 @@ import ( "strings" "time" + "github.com/google/go-github/v61/github" "github.com/sirupsen/logrus" api "github.com/go-vela/server/api/types" "github.com/go-vela/server/internal" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/google/go-github/v61/github" ) // ProcessWebhook parses the webhook from a repo. diff --git a/scm/github/webhook_test.go b/scm/github/webhook_test.go index 50aea20b4..ec3f0466c 100644 --- a/scm/github/webhook_test.go +++ b/scm/github/webhook_test.go @@ -13,13 +13,13 @@ import ( "time" "github.com/gin-gonic/gin" - api "github.com/go-vela/server/api/types" - "github.com/go-vela/server/internal" - "github.com/go-vela/types/raw" "github.com/google/go-cmp/cmp" + api "github.com/go-vela/server/api/types" + "github.com/go-vela/server/internal" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" + "github.com/go-vela/types/raw" ) func TestGithub_ProcessWebhook_Push(t *testing.T) { diff --git a/scm/scm.go b/scm/scm.go index 1614d80ea..e45b33576 100644 --- a/scm/scm.go +++ b/scm/scm.go @@ -5,9 +5,9 @@ package scm import ( "fmt" - "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // New creates and returns a Vela service capable of diff --git a/scm/setup.go b/scm/setup.go index b779e8ab2..3b4082f7f 100644 --- a/scm/setup.go +++ b/scm/setup.go @@ -6,10 +6,10 @@ import ( "fmt" "strings" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/scm/github" "github.com/go-vela/types/constants" - - "github.com/sirupsen/logrus" ) // Setup represents the configuration necessary for diff --git a/secret/context_test.go b/secret/context_test.go index 4e92573e7..becf8cea1 100644 --- a/secret/context_test.go +++ b/secret/context_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" "github.com/go-vela/server/secret/native" ) diff --git a/secret/native/count.go b/secret/native/count.go index 379391d1b..460ee077b 100644 --- a/secret/native/count.go +++ b/secret/native/count.go @@ -6,9 +6,10 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // Count counts a list of secrets. diff --git a/secret/native/create.go b/secret/native/create.go index 7d0f026c8..698b25740 100644 --- a/secret/native/create.go +++ b/secret/native/create.go @@ -6,9 +6,10 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Create creates a new secret. diff --git a/secret/native/delete.go b/secret/native/delete.go index 54662a9f6..d0fbdc458 100644 --- a/secret/native/delete.go +++ b/secret/native/delete.go @@ -6,8 +6,9 @@ import ( "context" "fmt" - "github.com/go-vela/types/constants" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // Delete deletes a secret. diff --git a/secret/native/get.go b/secret/native/get.go index 059ee917e..da22376e6 100644 --- a/secret/native/get.go +++ b/secret/native/get.go @@ -6,10 +6,11 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Get captures a secret. diff --git a/secret/native/list.go b/secret/native/list.go index ab6f7d57b..f1acfc069 100644 --- a/secret/native/list.go +++ b/secret/native/list.go @@ -6,10 +6,11 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // List captures a list of secrets. diff --git a/secret/native/native.go b/secret/native/native.go index fb4319673..10b62659a 100644 --- a/secret/native/native.go +++ b/secret/native/native.go @@ -3,8 +3,9 @@ package native import ( - "github.com/go-vela/server/database" "github.com/sirupsen/logrus" + + "github.com/go-vela/server/database" ) // client represents a struct to hold native secret setup. diff --git a/secret/native/update.go b/secret/native/update.go index bce00e936..43bfcc011 100644 --- a/secret/native/update.go +++ b/secret/native/update.go @@ -6,9 +6,10 @@ import ( "context" "fmt" + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // Update updates an existing secret. diff --git a/secret/secret.go b/secret/secret.go index 75496e449..7dadc4b05 100644 --- a/secret/secret.go +++ b/secret/secret.go @@ -5,9 +5,9 @@ package secret import ( "fmt" - "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" ) // New creates and returns a Vela service capable of diff --git a/secret/setup.go b/secret/setup.go index 2e6e4b6b7..8a9917c0a 100644 --- a/secret/setup.go +++ b/secret/setup.go @@ -7,11 +7,12 @@ import ( "strings" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/secret/native" "github.com/go-vela/server/secret/vault" "github.com/go-vela/types/constants" - "github.com/sirupsen/logrus" ) // Setup represents the configuration necessary for diff --git a/secret/vault/count.go b/secret/vault/count.go index a6995d2ee..907165cea 100644 --- a/secret/vault/count.go +++ b/secret/vault/count.go @@ -7,10 +7,10 @@ import ( "fmt" "strings" + "github.com/hashicorp/vault/api" "github.com/sirupsen/logrus" "github.com/go-vela/types/constants" - "github.com/hashicorp/vault/api" ) // Count counts a list of secrets. @@ -34,7 +34,6 @@ func (c *client) Count(ctx context.Context, sType, org, name string, _ []string) c.Logger.WithFields(fields).Tracef("counting vault %s secrets for %s/%s", sType, org, name) - //nolint:staticcheck // ignore false positive vault := new(api.Secret) count := 0 diff --git a/secret/vault/create_test.go b/secret/vault/create_test.go index dc0d5226f..1de42e2bf 100644 --- a/secret/vault/create_test.go +++ b/secret/vault/create_test.go @@ -9,9 +9,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestVault_Create_Org(t *testing.T) { diff --git a/secret/vault/get.go b/secret/vault/get.go index eeba1e996..fcd083006 100644 --- a/secret/vault/get.go +++ b/secret/vault/get.go @@ -7,11 +7,11 @@ import ( "fmt" "strings" + "github.com/hashicorp/vault/api" "github.com/sirupsen/logrus" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/hashicorp/vault/api" ) // Get captures a secret. diff --git a/secret/vault/get_test.go b/secret/vault/get_test.go index 5af08f22a..4b64b8ed7 100644 --- a/secret/vault/get_test.go +++ b/secret/vault/get_test.go @@ -9,9 +9,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestVault_Get_Org(t *testing.T) { diff --git a/secret/vault/list.go b/secret/vault/list.go index be5638e41..b42d00d66 100644 --- a/secret/vault/list.go +++ b/secret/vault/list.go @@ -7,11 +7,11 @@ import ( "fmt" "strings" + "github.com/hashicorp/vault/api" "github.com/sirupsen/logrus" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/hashicorp/vault/api" ) // List captures a list of secrets. @@ -42,7 +42,7 @@ func (c *client) List(ctx context.Context, sType, org, name string, _, _ int, _ var err error s := []*library.Secret{} - //nolint:staticcheck // ignore false positive + vault := new(api.Secret) // capture the list of secrets from the Vault service diff --git a/secret/vault/list_test.go b/secret/vault/list_test.go index 9a6eb352e..990c4f020 100644 --- a/secret/vault/list_test.go +++ b/secret/vault/list_test.go @@ -9,9 +9,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestVault_List_Org(t *testing.T) { diff --git a/secret/vault/update_test.go b/secret/vault/update_test.go index 4a525c1ab..39fea7d41 100644 --- a/secret/vault/update_test.go +++ b/secret/vault/update_test.go @@ -9,9 +9,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestVault_Update_Org(t *testing.T) { diff --git a/secret/vault/vault.go b/secret/vault/vault.go index 2cbf34b34..63745833f 100644 --- a/secret/vault/vault.go +++ b/secret/vault/vault.go @@ -8,11 +8,12 @@ import ( "time" "github.com/aws/aws-sdk-go/service/sts/stsiface" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" "github.com/hashicorp/vault/api" "github.com/pkg/errors" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" ) const ( diff --git a/secret/vault/vault_test.go b/secret/vault/vault_test.go index 2bbb666bb..a60d7bd75 100644 --- a/secret/vault/vault_test.go +++ b/secret/vault/vault_test.go @@ -10,9 +10,10 @@ import ( "strings" "testing" - "github.com/go-vela/types/library" "github.com/google/go-cmp/cmp" "github.com/hashicorp/vault/api" + + "github.com/go-vela/types/library" ) func TestVault_New(t *testing.T) { diff --git a/util/util.go b/util/util.go index 60d709765..b4a1a29ae 100644 --- a/util/util.go +++ b/util/util.go @@ -8,10 +8,10 @@ import ( "net/url" "strings" - api "github.com/go-vela/server/api/types" + "github.com/gin-gonic/gin" "github.com/microcosm-cc/bluemonday" - "github.com/gin-gonic/gin" + api "github.com/go-vela/server/api/types" "github.com/go-vela/types" ) diff --git a/version/version.go b/version/version.go index f6dfde329..f363d79b4 100644 --- a/version/version.go +++ b/version/version.go @@ -7,8 +7,9 @@ import ( "runtime" "github.com/Masterminds/semver/v3" - "github.com/go-vela/types/version" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/version" ) var (