mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
ci: enable gocognit (#9359)
And, bring the server under 300: * Removed the undocumented "disable" STUN address in favor of the --disable-direct flag.
This commit is contained in:
@ -184,8 +184,6 @@ type Options struct {
|
||||
// @in header
|
||||
// @name Coder-Session-Token
|
||||
// New constructs a Coder API handler.
|
||||
//
|
||||
//nolint:gocyclo
|
||||
func New(options *Options) *API {
|
||||
if options == nil {
|
||||
options = &Options{}
|
||||
|
@ -329,7 +329,7 @@ func NewOptions(t testing.TB, options *Options) (func(http.Handler), context.Can
|
||||
t.Cleanup(stunCleanup)
|
||||
stunAddresses = []string{stunAddr.String()}
|
||||
options.DeploymentValues.DERP.Server.STUNAddresses = stunAddresses
|
||||
} else if dvStunAddresses[0] != "disable" {
|
||||
} else if dvStunAddresses[0] != tailnet.DisableSTUN {
|
||||
stunAddresses = options.DeploymentValues.DERP.Server.STUNAddresses.Value()
|
||||
}
|
||||
|
||||
|
@ -6053,7 +6053,6 @@ func (q *FakeQuerier) GetTemplateUserRoles(_ context.Context, id uuid.UUID) ([]d
|
||||
return users, nil
|
||||
}
|
||||
|
||||
//nolint:gocyclo
|
||||
func (q *FakeQuerier) GetAuthorizedWorkspaces(ctx context.Context, arg database.GetWorkspacesParams, prepared rbac.PreparedAuthorized) ([]database.GetWorkspacesRow, error) {
|
||||
if err := validateDatabaseType(arg); err != nil {
|
||||
return nil, err
|
||||
|
@ -744,8 +744,6 @@ func (server *Server) FailJob(ctx context.Context, failJob *proto.FailedJob) (*p
|
||||
}
|
||||
|
||||
// CompleteJob is triggered by a provision daemon to mark a provisioner job as completed.
|
||||
//
|
||||
//nolint:gocyclo
|
||||
func (server *Server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) (*proto.Empty, error) {
|
||||
ctx, span := server.startTrace(ctx, tracing.FuncName())
|
||||
defer span.End()
|
||||
|
@ -303,7 +303,6 @@ func (api *API) workspaceBuildByBuildNumber(rw http.ResponseWriter, r *http.Requ
|
||||
// @Param request body codersdk.CreateWorkspaceBuildRequest true "Create workspace build request"
|
||||
// @Success 200 {object} codersdk.WorkspaceBuild
|
||||
// @Router /workspaces/{workspace}/builds [post]
|
||||
// nolint:gocyclo
|
||||
func (api *API) postWorkspaceBuilds(rw http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
apiKey := httpmw.APIKey(r)
|
||||
|
Reference in New Issue
Block a user