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 11814a8a0..baa258f65 100644 --- a/api/admin/repo.go +++ b/api/admin/repo.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/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 041d844f3..aec090014 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/util" "github.com/go-vela/types" - "github.com/sirupsen/logrus" ) // swagger:operation GET /login authenticate GetLogin diff --git a/api/auth/logout.go b/api/auth/logout.go index 454d2b9ed..6c02fa860 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/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 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 473c7a612..9b3d5f862 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/util" "github.com/go-vela/types" - "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 037160282..287f21ffd 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/router/middleware/build" @@ -17,7 +19,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 0f200498c..750ba880d 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/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/types/constants" 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/create.go b/api/build/create.go index 991946c88..07592d7e0 100644 --- a/api/build/create.go +++ b/api/build/create.go @@ -10,6 +10,8 @@ import ( "time" "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/queue" @@ -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" ) // 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/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 44cfbdbea..3104a5d74 100644 --- a/api/build/get_id.go +++ b/api/build/get_id.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/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 dde6e5343..4c0a64cb8 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/router/middleware/build" @@ -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/publish.go b/api/build/publish.go index f843b1461..f72a39226 100644 --- a/api/build/publish.go +++ b/api/build/publish.go @@ -7,11 +7,12 @@ import ( "encoding/json" "time" + "github.com/sirupsen/logrus" + "github.com/go-vela/server/database" "github.com/go-vela/server/queue" "github.com/go-vela/types" "github.com/go-vela/types/library" - "github.com/sirupsen/logrus" ) // PublishToQueue is a helper function that publishes a queue item (build, repo, user) to the queue. diff --git a/api/build/restart.go b/api/build/restart.go index 1296d654a..02599881b 100644 --- a/api/build/restart.go +++ b/api/build/restart.go @@ -9,6 +9,8 @@ import ( "time" "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/queue" @@ -23,7 +25,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "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 c9fb30aa8..b97240836 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 d829ab755..cd0a48665 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/router/middleware/org" "github.com/go-vela/server/router/middleware/pipeline" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types" - "github.com/sirupsen/logrus" ) // swagger:operation POST /api/v1/pipelines/{org}/{repo}/{pipeline}/compile pipelines CompilePipeline 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 8fb19303f..9ea2285da 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/router/middleware/org" "github.com/go-vela/server/router/middleware/pipeline" @@ -15,7 +17,6 @@ import ( "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/util" "github.com/go-vela/types" - "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 9716b6328..6ddeb8400 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/database" @@ -20,7 +22,6 @@ import ( "github.com/go-vela/types" "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 333e7f0d6..c9625f738 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/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" - "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 8061b2de6..087f84a60 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 9fe69dfad..69e071e4d 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/database" "github.com/go-vela/server/router/middleware/user" "github.com/go-vela/server/scm" @@ -16,8 +19,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/library/actions" - "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 4a792283d..a20513d4b 100644 --- a/api/repo/repair.go +++ b/api/repo/repair.go @@ -4,8 +4,13 @@ package repo import ( "fmt" + "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/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" @@ -13,8 +18,6 @@ import ( "github.com/go-vela/server/scm" "github.com/go-vela/server/util" "github.com/go-vela/types" - "github.com/sirupsen/logrus" - "net/http" ) // swagger:operation PATCH /api/v1/repos/{org}/{repo}/repair repos RepairRepo diff --git a/api/repo/update.go b/api/repo/update.go index ba21996d3..3dacaebc3 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/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" @@ -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 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 fb0c425f3..6e42d24bc 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/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/go-vela/types/library" - "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 8423bc8cb..14d170dc8 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 86870d03d..6393aa2fb 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/update.go b/api/step/update.go index e049e0ad1..5e581ac2f 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" @@ -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" ) // swagger:operation PUT /api/v1/repos/{org}/{repo}/builds/{build}/steps/{step} steps UpdateStep 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 6390c00e7..64d7decd2 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/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/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 038d53fe7..b575d1138 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/compiler" "github.com/go-vela/server/database" @@ -24,8 +27,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "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 07edf3acc..3a59e2163 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/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 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 a8a4d6931..420bb0c62 100644 --- a/api/worker/get.go +++ b/api/worker/get.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 GET /api/v1/workers/{worker} workers GetWorker diff --git a/api/worker/list.go b/api/worker/list.go index f402144da..8b4dd657c 100644 --- a/api/worker/list.go +++ b/api/worker/list.go @@ -9,10 +9,11 @@ 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/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 d95ddf7af..7fc2e7ae7 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/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 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 88a29b23a..ce506bab7 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/types" - "github.com/sirupsen/logrus" - "github.com/urfave/cli/v2" + + "github.com/go-vela/types" ) // 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 2036306c4..7a9e51801 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" @@ -19,9 +22,6 @@ import ( "github.com/go-vela/types/constants" "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" - "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 9768d90bb..eeb8252cb 100644 --- a/compiler/native/compile.go +++ b/compiler/native/compile.go @@ -12,16 +12,16 @@ import ( "strings" "time" - "github.com/go-vela/types/constants" + "github.com/hashicorp/go-cleanhttp" + "github.com/hashicorp/go-retryablehttp" yml "github.com/buildkite/yaml" + "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. diff --git a/compiler/native/compile_test.go b/compiler/native/compile_test.go index e71956306..5f38370a1 100644 --- a/compiler/native/compile_test.go +++ b/compiler/native/compile_test.go @@ -9,27 +9,22 @@ import ( "net/http/httptest" "os" "path/filepath" - - "github.com/go-vela/types/constants" - "github.com/go-vela/types/raw" - - "github.com/google/go-github/v59/github" - "testing" "time" + "github.com/gin-gonic/gin" "github.com/google/go-cmp/cmp" + "github.com/google/go-github/v59/github" + "github.com/urfave/cli/v2" - "github.com/go-vela/types/library" - "github.com/go-vela/types/yaml" + yml "github.com/buildkite/yaml" "github.com/go-vela/types" + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" "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 a6a598acc..2e230ddd8 100644 --- a/compiler/native/environment_test.go +++ b/compiler/native/environment_test.go @@ -8,14 +8,13 @@ import ( "strings" "testing" - "github.com/go-vela/types/raw" "github.com/google/go-cmp/cmp" + "github.com/urfave/cli/v2" "github.com/go-vela/types" "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 734c597e8..a1b1df457 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 749bdccb2..226c8d464 100644 --- a/compiler/native/expand_test.go +++ b/compiler/native/expand_test.go @@ -9,14 +9,14 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin" + "github.com/google/go-cmp/cmp" + "github.com/urfave/cli/v2" + "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 a93c6fd50..1459403ed 100644 --- a/compiler/native/native.go +++ b/compiler/native/native.go @@ -5,16 +5,14 @@ package native import ( "time" - "github.com/go-vela/server/compiler" + "github.com/sirupsen/logrus" + "github.com/urfave/cli/v2" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/compiler/registry" "github.com/go-vela/server/compiler/registry/github" - "github.com/go-vela/types" "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 36be98195..56eb64986 100644 --- a/compiler/native/native_test.go +++ b/compiler/native/native_test.go @@ -7,12 +7,11 @@ import ( "reflect" "testing" - "github.com/go-vela/server/compiler/registry/github" + "github.com/urfave/cli/v2" + "github.com/go-vela/server/compiler/registry/github" "github.com/go-vela/types" "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..a858c2bbb 100644 --- a/compiler/native/parse.go +++ b/compiler/native/parse.go @@ -7,12 +7,13 @@ import ( "io" "os" + "github.com/buildkite/yaml" + + types "github.com/go-vela/types/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 7176438e1..3cd9730b9 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "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 743f9a46c..804620bef 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/types" "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 550bbd3ae..4a7ca0ded 100644 --- a/compiler/native/validate_test.go +++ b/compiler/native/validate_test.go @@ -6,10 +6,10 @@ import ( "flag" "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 03d503b82..7b2bc9e58 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/v59/github" + "github.com/go-vela/server/compiler/registry" "github.com/go-vela/types/library" - - "github.com/google/go-github/v59/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..968c64b6a 100644 --- a/compiler/template/native/render.go +++ b/compiler/template/native/render.go @@ -7,13 +7,12 @@ import ( "fmt" "text/template" - "github.com/go-vela/types/raw" + "github.com/Masterminds/sprig/v3" + "github.com/buildkite/yaml" types "github.com/go-vela/types/yaml" - "github.com/Masterminds/sprig/v3" - - "github.com/buildkite/yaml" + "github.com/go-vela/types/raw" ) // Render combines the template with the step in the yaml pipeline. diff --git a/compiler/template/native/render_test.go b/compiler/template/native/render_test.go index f4c92160d..ffc70fc16 100644 --- a/compiler/template/native/render_test.go +++ b/compiler/template/native/render_test.go @@ -6,9 +6,10 @@ import ( "os" "testing" - goyaml "github.com/buildkite/yaml" "github.com/google/go-cmp/cmp" + goyaml "github.com/buildkite/yaml" + "github.com/go-vela/types/raw" "github.com/go-vela/types/yaml" ) 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..a2b6b9660 100644 --- a/compiler/template/starlark/render.go +++ b/compiler/template/starlark/render.go @@ -7,12 +7,13 @@ import ( "errors" "fmt" - "github.com/go-vela/types/raw" + "go.starlark.net/starlark" "go.starlark.net/starlarkstruct" yaml "github.com/buildkite/yaml" types "github.com/go-vela/types/yaml" - "go.starlark.net/starlark" + + "github.com/go-vela/types/raw" ) var ( diff --git a/compiler/template/starlark/render_test.go b/compiler/template/starlark/render_test.go index d07a74a6f..f5e1ebf6e 100644 --- a/compiler/template/starlark/render_test.go +++ b/compiler/template/starlark/render_test.go @@ -6,10 +6,12 @@ import ( "os" "testing" + "github.com/google/go-cmp/cmp" + goyaml "github.com/buildkite/yaml" + "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 2478b2ded..d079799b4 100644 --- a/database/build/build_test.go +++ b/database/build/build_test.go @@ -10,13 +10,13 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - "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" + + "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 6b6283dbb..80b4e62ea 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/types/constants" "github.com/go-vela/types/database" ) diff --git a/database/build/count_repo.go b/database/build/count_repo.go index 152d867a2..8d8f47e8c 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "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 3728b6232..468f0b3a9 100644 --- a/database/build/get_repo.go +++ b/database/build/get_repo.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" ) // 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 c34fa8a2e..ad304d58e 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 36b923379..997189f78 100644 --- a/database/build/last_repo.go +++ b/database/build/last_repo.go @@ -6,12 +6,12 @@ import ( "context" "errors" + "github.com/sirupsen/logrus" + "gorm.io/gorm" + "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 7baebe01d..39d8d42f3 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 718517d3d..01df3897b 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/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/build/list_pending_running_repo_test.go b/database/build/list_pending_running_repo_test.go index 34993713b..d207d3238 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/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/build/list_pending_running_test.go b/database/build/list_pending_running_test.go index 9115745f3..1b481205a 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/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" diff --git a/database/build/list_repo.go b/database/build/list_repo.go index 8b4386457..7ca12a50d 100644 --- a/database/build/list_repo.go +++ b/database/build/list_repo.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" ) // 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 4cb4622a5..f6d9a320c 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 93a7c1ac8..ef266c93c 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "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 6d3afece4..b4476a89e 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 4421f4f9d..10956c1b3 100644 --- a/database/deployment/deployment_test.go +++ b/database/deployment/deployment_test.go @@ -7,13 +7,13 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - "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" + + "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 b240adc20..5302e479e 100644 --- a/database/deployment/get_repo.go +++ b/database/deployment/get_repo.go @@ -6,10 +6,11 @@ import ( "context" "strconv" + "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" ) // 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 5ddbb61d5..a8c3ab8f8 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 471da6cf0..3c9715151 100644 --- a/database/deployment/list_repo.go +++ b/database/deployment/list_repo.go @@ -6,10 +6,11 @@ import ( "context" "strconv" + "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" ) // 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 7b536804f..d07c5689a 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "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 6182d86c9..34ff035c8 100644 --- a/database/hook/get_repo.go +++ b/database/hook/get_repo.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" ) // 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 e7c33c2d8..40fc38791 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 4aaeb6a93..2ff2a248e 100644 --- a/database/hook/hook_test.go +++ b/database/hook/hook_test.go @@ -7,12 +7,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 TestHook_New(t *testing.T) { diff --git a/database/hook/last_repo.go b/database/hook/last_repo.go index bf85be4dc..006f1401b 100644 --- a/database/hook/last_repo.go +++ b/database/hook/last_repo.go @@ -6,12 +6,12 @@ import ( "context" "errors" + "github.com/sirupsen/logrus" + "gorm.io/gorm" + "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 b7911f91d..186f2f0b1 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 28220b1dd..7313bddb9 100644 --- a/database/hook/list_repo.go +++ b/database/hook/list_repo.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" ) // 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 38e72a93f..26fbe16f2 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 16ca38062..50f79f241 100644 --- a/database/integration_test.go +++ b/database/integration_test.go @@ -10,6 +10,8 @@ import ( "testing" "time" + "github.com/google/go-cmp/cmp" + "github.com/go-vela/server/database/build" "github.com/go-vela/server/database/deployment" "github.com/go-vela/server/database/executable" @@ -26,7 +28,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 549a9ecc9..c428370ae 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "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 e40888f3c..86046649b 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" + "github.com/go-vela/types/library" ) 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 934c0dcd2..9c237fbb4 100644 --- a/database/pipeline/get_repo.go +++ b/database/pipeline/get_repo.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" ) // 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 82b9669da..aa13064bb 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" + "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 f4ed90fde..613bd9826 100644 --- a/database/pipeline/list_repo.go +++ b/database/pipeline/list_repo.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" ) // 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 aec274702..a4e04193e 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" + "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 a2b580a52..dedadeba5 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 578b54fb6..f3b7c97f2 100644 --- a/database/repo/create.go +++ b/database/repo/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" ) // CreateRepo creates a new repo in the database. diff --git a/database/repo/delete.go b/database/repo/delete.go index 6432e4ce1..f4e92fb6d 100644 --- a/database/repo/delete.go +++ b/database/repo/delete.go @@ -5,10 +5,11 @@ package repo 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" ) // DeleteRepo deletes an existing repo from the database. diff --git a/database/repo/get_org.go b/database/repo/get_org.go index 2a1d053ea..6d07ee643 100644 --- a/database/repo/get_org.go +++ b/database/repo/get_org.go @@ -5,10 +5,11 @@ package repo 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" ) // 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 95e6d6a32..b01b5651d 100644 --- a/database/repo/get_org_test.go +++ b/database/repo/get_org_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/get_test.go b/database/repo/get_test.go index 7a4fcdba8..79550045c 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" + "github.com/go-vela/types/library" ) diff --git a/database/repo/list_org.go b/database/repo/list_org.go index 95783bd95..658159c59 100644 --- a/database/repo/list_org.go +++ b/database/repo/list_org.go @@ -5,10 +5,11 @@ package repo 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" ) // 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 5d6bfb99f..1e81cfede 100644 --- a/database/repo/list_org_test.go +++ b/database/repo/list_org_test.go @@ -9,6 +9,7 @@ import ( "time" "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/repo/list_test.go b/database/repo/list_test.go index 793123257..184a70ffe 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" + "github.com/go-vela/types/library" ) diff --git a/database/repo/list_user.go b/database/repo/list_user.go index bc11fb1b2..d92e1f56e 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "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 a387c4e5a..53e3d6a6f 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/database" "github.com/go-vela/types/library" 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 5e4300e19..6f9edeb19 100644 --- a/database/repo/repo.go +++ b/database/repo/repo.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/repo/repo_test.go b/database/repo/repo_test.go index 597ef1623..887758784 100644 --- a/database/repo/repo_test.go +++ b/database/repo/repo_test.go @@ -8,13 +8,13 @@ import ( "testing" "github.com/DATA-DOG/go-sqlmock" - "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" + + "github.com/go-vela/types/library" + "github.com/go-vela/types/library/actions" ) func TestRepo_New(t *testing.T) { diff --git a/database/repo/update.go b/database/repo/update.go index 0c3273ce2..92c16584d 100644 --- a/database/repo/update.go +++ b/database/repo/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" ) // UpdateRepo updates an existing repo in the database. diff --git a/database/repo/update_test.go b/database/repo/update_test.go index bf791a30d..303d1c755 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" ) 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 471537d8f..b1fa04e93 100644 --- a/database/schedule/count_repo.go +++ b/database/schedule/count_repo.go @@ -4,9 +4,11 @@ package schedule import ( "context" + + "github.com/sirupsen/logrus" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "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 6ee2e6bb7..9e1f76863 100644 --- a/database/schedule/get_repo.go +++ b/database/schedule/get_repo.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" ) // 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 c5d7866ca..2bbc58c47 100644 --- a/database/schedule/list_repo.go +++ b/database/schedule/list_repo.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" ) // 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 d676223a1..732fb80eb 100644 --- a/database/schedule/schedule_test.go +++ b/database/schedule/schedule_test.go @@ -10,12 +10,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 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 8fd9b0090..236f7bb2c 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" + "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "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 3e688b0c2..6988c5b59 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 9800b34fd..9c8556313 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 b5d0c3ba5..ef45928d0 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 dec38ba8a..a16fcac8e 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 b33b0d58d..bbcfd3406 100644 --- a/database/secret/get_repo.go +++ b/database/secret/get_repo.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" ) // 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 3f0282a6b..36e1d5999 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 e36674a35..1043e9907 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 979f626e0..8110f9a89 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 9fe2da2e1..e1bcf8efc 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 213ee9353..f0ca09df1 100644 --- a/database/secret/list_repo.go +++ b/database/secret/list_repo.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" ) // 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 838dd96f9..019c0f54c 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 bed709312..e0f838828 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 8077637ee..3d679c64e 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 31156ebca..ec568c3ff 100644 --- a/database/secret/secret_test.go +++ b/database/secret/secret_test.go @@ -9,13 +9,13 @@ import ( "time" "github.com/DATA-DOG/go-sqlmock" - "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" + + "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 f26ddaa24..1b9ff1473 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 55669735c..c9eb17d8d 100644 --- a/database/step/get_build_test.go +++ b/database/step/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/step/get_test.go b/database/step/get_test.go index 762e69988..c65f9192c 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 db53531c2..194f1096b 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 284ae802f..22e8c54a2 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 bbd2a09da..f447ce76b 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/table.go b/database/step/table.go index 8cdde1b6e..b776c97e7 100644 --- a/database/step/table.go +++ b/database/step/table.go @@ -4,6 +4,7 @@ package step import ( "context" + "github.com/go-vela/types/constants" ) 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 12b386319..8536dadf4 100644 --- a/database/worker/create.go +++ b/database/worker/create.go @@ -5,10 +5,11 @@ package worker 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" ) // CreateWorker creates a new worker in the database. diff --git a/database/worker/delete.go b/database/worker/delete.go index ba846db91..97b9bbf46 100644 --- a/database/worker/delete.go +++ b/database/worker/delete.go @@ -5,10 +5,11 @@ package worker 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" ) // DeleteWorker deletes an existing worker from the database. diff --git a/database/worker/get_hostname.go b/database/worker/get_hostname.go index 3370620a0..9acb25e5c 100644 --- a/database/worker/get_hostname.go +++ b/database/worker/get_hostname.go @@ -5,10 +5,11 @@ package worker 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" ) // 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 cf264ab0c..73434258c 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" + "github.com/go-vela/types/library" ) diff --git a/database/worker/get_test.go b/database/worker/get_test.go index bfd9bf2a3..7f84876d6 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" + "github.com/go-vela/types/library" ) diff --git a/database/worker/list_test.go b/database/worker/list_test.go index 4a5988228..cc4563ddd 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" - "github.com/go-vela/types/library" "github.com/google/go-cmp/cmp" + + "github.com/go-vela/types/library" ) 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 3cae0d164..5e21ad57f 100644 --- a/database/worker/update.go +++ b/database/worker/update.go @@ -5,10 +5,11 @@ package worker 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" ) // UpdateWorker updates an existing worker in the database. diff --git a/database/worker/worker.go b/database/worker/worker.go index 09b69176a..d937ac6ae 100644 --- a/database/worker/worker.go +++ b/database/worker/worker.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/worker/worker_test.go b/database/worker/worker_test.go index a219d1ffc..3eaab57cb 100644 --- a/database/worker/worker_test.go +++ b/database/worker/worker_test.go @@ -7,12 +7,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 TestWorker_New(t *testing.T) { diff --git a/internal/token/compose.go b/internal/token/compose.go index 6e48647e2..250446fe9 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/types" "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 a73bf912b..a42c3488e 100644 --- a/internal/token/compose_test.go +++ b/internal/token/compose_test.go @@ -9,11 +9,12 @@ import ( "time" "github.com/gin-gonic/gin" + + jwt "github.com/golang-jwt/jwt/v5" + "github.com/go-vela/types" "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..aa57a59d7 100644 --- a/internal/token/parse_test.go +++ b/internal/token/parse_test.go @@ -8,10 +8,11 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/go-vela/types/constants" - "github.com/go-vela/types/library" jwt "github.com/golang-jwt/jwt/v5" + + "github.com/go-vela/types/constants" + "github.com/go-vela/types/library" ) 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..5374e592e 100644 --- a/mock/server/pipeline.go +++ b/mock/server/pipeline.go @@ -8,13 +8,13 @@ import ( "net/http" "strings" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" - "github.com/go-vela/types" - "github.com/go-vela/types/yaml" yml "github.com/buildkite/yaml" + + "github.com/go-vela/types" + "github.com/go-vela/types/library" + "github.com/go-vela/types/yaml" ) const ( diff --git a/mock/server/repo.go b/mock/server/repo.go index cc480b289..48c0086be 100644 --- a/mock/server/repo.go +++ b/mock/server/repo.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/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 1747fbcf4..e2b438e4d 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 e5694ab85..4623099c4 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 6abf38451..d5971ed33 100644 --- a/mock/server/worker.go +++ b/mock/server/worker.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/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 0049b3809..502cdd226 100644 --- a/queue/redis/length_test.go +++ b/queue/redis/length_test.go @@ -7,8 +7,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types" "gopkg.in/square/go-jose.v2/json" + + "github.com/go-vela/types" ) 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 250d0c915..4dd9a7be3 100644 --- a/queue/redis/pop.go +++ b/queue/redis/pop.go @@ -7,9 +7,10 @@ import ( "encoding/json" "errors" - "github.com/go-vela/types" "github.com/redis/go-redis/v9" "golang.org/x/crypto/nacl/sign" + + "github.com/go-vela/types" ) // 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 eb05030bd..7dba8f60b 100644 --- a/queue/redis/pop_test.go +++ b/queue/redis/pop_test.go @@ -8,9 +8,10 @@ import ( "testing" "time" - "github.com/go-vela/types" "golang.org/x/crypto/nacl/sign" "gopkg.in/square/go-jose.v2/json" + + "github.com/go-vela/types" ) 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 919892976..216417f29 100644 --- a/queue/redis/redis_test.go +++ b/queue/redis/redis_test.go @@ -8,6 +8,7 @@ import ( "time" "github.com/alicebob/miniredis/v2" + "github.com/go-vela/types/library" "github.com/go-vela/types/pipeline" ) 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..776694c46 100644 --- a/router/build.go +++ b/router/build.go @@ -4,10 +4,12 @@ package router import ( "github.com/gin-gonic/gin" + + bmiddleware "github.com/go-vela/server/router/middleware/build" + "github.com/go-vela/server/api/build" "github.com/go-vela/server/api/log" "github.com/go-vela/server/router/middleware" - bmiddleware "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/executors" "github.com/go-vela/server/router/middleware/perm" ) 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 f86353d3a..0bb3ddfbb 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" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/repo" 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..56847cb8f 100644 --- a/router/middleware/claims/claims_test.go +++ b/router/middleware/claims/claims_test.go @@ -3,7 +3,6 @@ package claims import ( - _context "context" "fmt" "net/http" "net/http/httptest" @@ -13,11 +12,14 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + + _context "context" + "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 3cabdb687..0542f31e3 100644 --- a/router/middleware/executors/context_test.go +++ b/router/middleware/executors/context_test.go @@ -6,9 +6,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestExecutors_FromContext(t *testing.T) { diff --git a/router/middleware/executors/executor_test.go b/router/middleware/executors/executor_test.go index 66006b6e2..ceb9237da 100644 --- a/router/middleware/executors/executor_test.go +++ b/router/middleware/executors/executor_test.go @@ -6,9 +6,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestExecutors_Retrieve(t *testing.T) { diff --git a/router/middleware/executors/executors.go b/router/middleware/executors/executors.go index 688434f07..2435587c4 100644 --- a/router/middleware/executors/executors.go +++ b/router/middleware/executors/executors.go @@ -12,6 +12,7 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/build" diff --git a/router/middleware/header.go b/router/middleware/header.go index f04180bfd..885c433b7 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/version" "github.com/go-vela/types" ) diff --git a/router/middleware/header_test.go b/router/middleware/header_test.go index ab13f992a..10b0aa4b7 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/types" ) 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 9264ade1a..ab02f0719 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" + "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/repo" "github.com/go-vela/server/router/middleware/service" @@ -21,8 +24,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_test.go b/router/middleware/metadata_test.go index 0baaee36a..28632830d 100644 --- a/router/middleware/metadata_test.go +++ b/router/middleware/metadata_test.go @@ -8,9 +8,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types" ) func TestMiddleware_Metadata(t *testing.T) { 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 27021222f..88d7e56de 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" + "github.com/go-vela/server/database" "github.com/go-vela/types/library" ) diff --git a/router/middleware/perm/perm.go b/router/middleware/perm/perm.go index a8656a261..ba3afb5b5 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/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/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 c2c9642e4..e56ed5172 100644 --- a/router/middleware/perm/perm_test.go +++ b/router/middleware/perm/perm_test.go @@ -3,7 +3,6 @@ package perm import ( - _context "context" "fmt" "net/http" "net/http/httptest" @@ -11,6 +10,10 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + + _context "context" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/build" @@ -22,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 61f308854..c46299193 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/router/middleware/org" @@ -16,7 +18,6 @@ import ( "github.com/go-vela/server/util" "github.com/go-vela/types" "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 545edb338..298ac5d72 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" + "github.com/go-vela/server/compiler" "github.com/go-vela/server/compiler/native" "github.com/go-vela/server/database" @@ -26,8 +29,6 @@ import ( "github.com/go-vela/types" "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 ebcadf01e..3b092bcc0 100644 --- a/router/middleware/repo/context_test.go +++ b/router/middleware/repo/context_test.go @@ -5,9 +5,9 @@ package repo import ( "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestRepo_FromContext(t *testing.T) { diff --git a/router/middleware/repo/repo.go b/router/middleware/repo/repo.go index 748a17bb7..e996dee93 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" + "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/go-vela/types/library" - "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 9ae835eae..f15d27d56 100644 --- a/router/middleware/repo/repo_test.go +++ b/router/middleware/repo/repo_test.go @@ -9,10 +9,10 @@ import ( "reflect" "testing" - "github.com/go-vela/server/router/middleware/org" - "github.com/gin-gonic/gin" + "github.com/go-vela/server/database" + "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/types/library" ) 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 fba880671..baa630d5d 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" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" 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 8d9e19271..0702f5e48 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" + "github.com/go-vela/server/database" "github.com/go-vela/server/router/middleware/build" "github.com/go-vela/server/router/middleware/org" 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..0684ef132 100644 --- a/router/middleware/user/user_test.go +++ b/router/middleware/user/user_test.go @@ -3,7 +3,6 @@ package user import ( - _context "context" "fmt" "net/http" "net/http/httptest" @@ -12,6 +11,10 @@ import ( "time" "github.com/gin-gonic/gin" + "github.com/golang-jwt/jwt/v5" + + _context "context" + "github.com/go-vela/server/database" "github.com/go-vela/server/internal/token" "github.com/go-vela/server/router/middleware/claims" @@ -19,7 +22,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 76efd687b..df3c29cd5 100644 --- a/router/middleware/worker/context_test.go +++ b/router/middleware/worker/context_test.go @@ -5,9 +5,9 @@ package worker import ( "testing" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + + "github.com/go-vela/types/library" ) func TestWorker_FromContext(t *testing.T) { diff --git a/router/middleware/worker/worker.go b/router/middleware/worker/worker.go index 11586af9c..9f00b4873 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" + "github.com/go-vela/server/database" "github.com/go-vela/server/util" "github.com/go-vela/types/library" - "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 2d3578cd0..659feef97 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" + "github.com/go-vela/server/database" "github.com/go-vela/types/library" ) diff --git a/router/pipeline.go b/router/pipeline.go index 7d11a4e2e..04e9c05ea 100644 --- a/router/pipeline.go +++ b/router/pipeline.go @@ -4,10 +4,12 @@ package router import ( "github.com/gin-gonic/gin" + + pmiddleware "github.com/go-vela/server/router/middleware/pipeline" + "github.com/go-vela/server/api/pipeline" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/perm" - pmiddleware "github.com/go-vela/server/router/middleware/pipeline" "github.com/go-vela/server/router/middleware/repo" ) 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..1859285ee 100644 --- a/router/repo.go +++ b/router/repo.go @@ -4,12 +4,14 @@ package router import ( "github.com/gin-gonic/gin" + + rmiddleware "github.com/go-vela/server/router/middleware/repo" + "github.com/go-vela/server/api/build" "github.com/go-vela/server/api/repo" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/perm" - rmiddleware "github.com/go-vela/server/router/middleware/repo" ) // RepoHandlers is a function that extends the provided base router group 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..a0a6290e3 100644 --- a/router/schedule.go +++ b/router/schedule.go @@ -4,12 +4,14 @@ package router import ( "github.com/gin-gonic/gin" + + sMiddleware "github.com/go-vela/server/router/middleware/schedule" + "github.com/go-vela/server/api/schedule" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/org" "github.com/go-vela/server/router/middleware/perm" "github.com/go-vela/server/router/middleware/repo" - sMiddleware "github.com/go-vela/server/router/middleware/schedule" ) // ScheduleHandler is a function that extends the provided base router group 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..2c3619a1b 100644 --- a/router/service.go +++ b/router/service.go @@ -5,10 +5,12 @@ package router import ( "github.com/gin-gonic/gin" + + smiddleware "github.com/go-vela/server/router/middleware/service" + "github.com/go-vela/server/api/service" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/perm" - smiddleware "github.com/go-vela/server/router/middleware/service" ) // ServiceHandlers is a function that extends the provided base router group diff --git a/router/step.go b/router/step.go index d26f70385..27e8c561f 100644 --- a/router/step.go +++ b/router/step.go @@ -5,10 +5,12 @@ package router import ( "github.com/gin-gonic/gin" + + smiddleware "github.com/go-vela/server/router/middleware/step" + "github.com/go-vela/server/api/step" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/perm" - smiddleware "github.com/go-vela/server/router/middleware/step" ) // StepHandlers is a function that extends the provided base router group 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..09db6a2b6 100644 --- a/router/worker.go +++ b/router/worker.go @@ -4,10 +4,12 @@ package router import ( "github.com/gin-gonic/gin" + + wmiddleware "github.com/go-vela/server/router/middleware/worker" + "github.com/go-vela/server/api/worker" "github.com/go-vela/server/router/middleware" "github.com/go-vela/server/router/middleware/perm" - wmiddleware "github.com/go-vela/server/router/middleware/worker" ) // WorkerHandlers is a function that extends the provided base router group 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 ea2445a3b..bb4e68266 100644 --- a/scm/github/access.go +++ b/scm/github/access.go @@ -6,10 +6,10 @@ import ( "context" "strings" + "github.com/google/go-github/v59/github" "github.com/sirupsen/logrus" "github.com/go-vela/types/library" - "github.com/google/go-github/v59/github" ) // OrgAccess captures the user's access level for an org. diff --git a/scm/github/authentication.go b/scm/github/authentication.go index 609790c77..0ae73eb62 100644 --- a/scm/github/authentication.go +++ b/scm/github/authentication.go @@ -10,9 +10,10 @@ import ( "net/url" "strings" + "github.com/google/go-github/v59/github" + "github.com/go-vela/server/random" "github.com/go-vela/types/library" - "github.com/google/go-github/v59/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..19c76cb64 100644 --- a/scm/github/authentication_test.go +++ b/scm/github/authentication_test.go @@ -8,9 +8,10 @@ import ( "reflect" "testing" + "github.com/gin-gonic/gin" + _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 a3ba3113b..1a9db3076 100644 --- a/scm/github/changeset.go +++ b/scm/github/changeset.go @@ -6,10 +6,10 @@ import ( "context" "fmt" + "github.com/google/go-github/v59/github" "github.com/sirupsen/logrus" "github.com/go-vela/types/library" - "github.com/google/go-github/v59/github" ) // Changeset captures the list of files changed for a commit. diff --git a/scm/github/deployment.go b/scm/github/deployment.go index 675503800..b775c1c52 100644 --- a/scm/github/deployment.go +++ b/scm/github/deployment.go @@ -6,11 +6,11 @@ import ( "context" "encoding/json" + "github.com/google/go-github/v59/github" "github.com/sirupsen/logrus" "github.com/go-vela/types/library" "github.com/go-vela/types/raw" - "github.com/google/go-github/v59/github" ) // GetDeployment gets a deployment from the GitHub repo. diff --git a/scm/github/github.go b/scm/github/github.go index d588f1795..7dd3b80fd 100644 --- a/scm/github/github.go +++ b/scm/github/github.go @@ -9,7 +9,6 @@ import ( "github.com/google/go-github/v59/github" "github.com/sirupsen/logrus" - "golang.org/x/oauth2" ) diff --git a/scm/github/repo.go b/scm/github/repo.go index d53bc8a87..6002906ab 100644 --- a/scm/github/repo.go +++ b/scm/github/repo.go @@ -10,11 +10,11 @@ import ( "strings" "time" + "github.com/google/go-github/v59/github" "github.com/sirupsen/logrus" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/google/go-github/v59/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 07b3fc163..abe825caa 100644 --- a/scm/github/webhook.go +++ b/scm/github/webhook.go @@ -13,12 +13,12 @@ import ( "strings" "time" + "github.com/google/go-github/v59/github" "github.com/sirupsen/logrus" "github.com/go-vela/types" "github.com/go-vela/types/constants" "github.com/go-vela/types/library" - "github.com/google/go-github/v59/github" ) // ProcessWebhook parses the webhook from a repo. diff --git a/scm/github/webhook_test.go b/scm/github/webhook_test.go index 35f6581de..2eae5b51c 100644 --- a/scm/github/webhook_test.go +++ b/scm/github/webhook_test.go @@ -13,12 +13,12 @@ import ( "time" "github.com/gin-gonic/gin" - "github.com/go-vela/types/raw" "github.com/google/go-cmp/cmp" "github.com/go-vela/types" "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 d76da83cc..6611897d3 100644 --- a/secret/native/count.go +++ b/secret/native/count.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" ) // 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 ae80f1d09..198cbaee4 100644 --- a/secret/native/get.go +++ b/secret/native/get.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" ) // Get captures a secret. diff --git a/secret/native/list.go b/secret/native/list.go index 6e153c422..0e3749f74 100644 --- a/secret/native/list.go +++ b/secret/native/list.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" ) // 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 ece04c5b9..7a3ffe032 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..131b7cbb8 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. diff --git a/secret/vault/create_test.go b/secret/vault/create_test.go index bcb41b60a..0f8877d35 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 66f582727..ed71fbd80 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..c253587de 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. diff --git a/secret/vault/list_test.go b/secret/vault/list_test.go index 127a127a2..a69d86e1d 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 c17c2c936..3906a2102 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 977ea60f9..dccf9a7a9 100644 --- a/secret/vault/vault.go +++ b/secret/vault/vault.go @@ -7,10 +7,11 @@ import ( "time" "github.com/aws/aws-sdk-go/service/sts/stsiface" - "github.com/go-vela/types/library" "github.com/hashicorp/vault/api" "github.com/pkg/errors" "github.com/sirupsen/logrus" + + "github.com/go-vela/types/library" ) const ( diff --git a/secret/vault/vault_test.go b/secret/vault/vault_test.go index 9cee893d9..0d200b97d 100644 --- a/secret/vault/vault_test.go +++ b/secret/vault/vault_test.go @@ -8,8 +8,9 @@ import ( "reflect" "testing" - "github.com/go-vela/types/library" "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 840dbc04f..b1c63b427 100644 --- a/util/util.go +++ b/util/util.go @@ -6,10 +6,10 @@ import ( "html" "strings" - "github.com/go-vela/types/library" - "github.com/gin-gonic/gin" + "github.com/go-vela/types" + "github.com/go-vela/types/library" ) // HandleError appends the error to the handler chain for logging and outputs it. 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 (