diff --git a/Dockerfile.builder b/Dockerfile.builder index e2642cf4..8805b7ec 100644 --- a/Dockerfile.builder +++ b/Dockerfile.builder @@ -2,7 +2,7 @@ FROM centos:7 LABEL maintainer "Devtools " LABEL author "Konrad Kleine " ENV LANG=en_US.utf8 -ARG USE_GO_VERSION_FROM_WEBSITE=1 +ARG USE_GO_VERSION_FROM_WEBSITE=0 # Some packages might seem weird but they are required by the RVM installer. RUN yum --enablerepo=centosplus install -y --quiet \ diff --git a/Gopkg.lock b/Gopkg.lock index 1848959b..212b2c71 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -142,13 +142,12 @@ revision = "487ec858da35ab9b34dea233bb8d91c048645add" [[projects]] - branch = "master" name = "github.com/gojuno/minimock" packages = [ ".", "cmd/minimock" ] - revision = "79a6ca66b6ac53161df2dfca6cb70e51fd4be8fc" + revision = "a5502dd2746ee6fc3fd58ad83d701d25e14d68d1" [[projects]] branch = "travis-1.9" @@ -493,6 +492,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "ad058bd5b8a4aa55885ca1be687a29e02a6cde5492d8c62308d4c3b976aded0c" + inputs-digest = "a445ea99112a636e11bab7e3c551d1ec3646c7a29ba8136e0c56af24e6363740" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index 33258cf4..6ebae9f2 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -127,7 +127,7 @@ revision= "9d71b8a6df86e00127f96bc8dabc09856ab8afdb" [[constraint]] name = "github.com/gojuno/minimock" - branch = "master" + revision = "a5502dd2746ee6fc3fd58ad83d701d25e14d68d1" [prune] go-tests = true diff --git a/account/repository/verification_code.go b/account/repository/verification_code.go index 424087de..602962f7 100644 --- a/account/repository/verification_code.go +++ b/account/repository/verification_code.go @@ -95,7 +95,7 @@ func (m *GormVerificationCodeRepository) Create(ctx context.Context, model *Veri if err != nil { log.Error(ctx, map[string]interface{}{ "verification_code_id": model.ID, - "err": err, + "err": err, }, "unable to create the verification_code") return errs.WithStack(err) } @@ -113,7 +113,7 @@ func (m *GormVerificationCodeRepository) Save(ctx context.Context, model *Verifi if err != nil { log.Error(ctx, map[string]interface{}{ "verification_code_id": model.ID, - "err": err, + "err": err, }, "unable to update the verification_code") return errs.WithStack(err) } @@ -136,7 +136,7 @@ func (m *GormVerificationCodeRepository) Delete(ctx context.Context, id uuid.UUI if result.Error != nil { log.Error(ctx, map[string]interface{}{ "verification_code_id": id, - "err": result.Error, + "err": result.Error, }, "unable to delete the verification_code") return errs.WithStack(result.Error) } diff --git a/authorization/resourcetype/repository/resource_type_scope.go b/authorization/resourcetype/repository/resource_type_scope.go index 2e463127..46c599d3 100644 --- a/authorization/resourcetype/repository/resource_type_scope.go +++ b/authorization/resourcetype/repository/resource_type_scope.go @@ -126,7 +126,7 @@ func (m *GormResourceTypeScopeRepository) Create(ctx context.Context, u *Resourc if err != nil { log.Error(ctx, map[string]interface{}{ "resource_type_scope_id": u.ResourceTypeScopeID, - "err": err, + "err": err, }, "unable to create the resource type scope") return errs.WithStack(err) } @@ -144,7 +144,7 @@ func (m *GormResourceTypeScopeRepository) Save(ctx context.Context, model *Resou if err != nil { log.Error(ctx, map[string]interface{}{ "resource_type_scope_id": model.ResourceTypeScopeID, - "err": err, + "err": err, }, "unable to update resource type scope") return errs.WithStack(err) } @@ -170,7 +170,7 @@ func (m *GormResourceTypeScopeRepository) Delete(ctx context.Context, id uuid.UU if result.Error != nil { log.Error(ctx, map[string]interface{}{ "resource_type_scope_id": id, - "err": result.Error, + "err": result.Error, }, "unable to delete the resource type scope") return errs.WithStack(result.Error) } diff --git a/authorization/role/repository/default_role_mapping.go b/authorization/role/repository/default_role_mapping.go index 5db2b58f..eb969f6d 100644 --- a/authorization/role/repository/default_role_mapping.go +++ b/authorization/role/repository/default_role_mapping.go @@ -112,7 +112,7 @@ func (m *GormDefaultRoleMappingRepository) Create(ctx context.Context, u *Defaul if err != nil { log.Error(ctx, map[string]interface{}{ "default_role_mapping_id": u.DefaultRoleMappingID, - "err": err, + "err": err, }, "unable to create the default role mapping") return errs.WithStack(err) } @@ -159,7 +159,7 @@ func (m *GormDefaultRoleMappingRepository) Delete(ctx context.Context, id uuid.U if result.Error != nil { log.Error(ctx, map[string]interface{}{ "default_role_mapping_id": id, - "err": result.Error, + "err": result.Error, }, "unable to delete the default role mapping") return errs.WithStack(result.Error) } diff --git a/cico_build_deploy.sh b/cico_build_deploy.sh index 1a533322..288e6188 100644 --- a/cico_build_deploy.sh +++ b/cico_build_deploy.sh @@ -2,8 +2,6 @@ . cico_setup.sh -export USE_GO_VERSION_FROM_WEBSITE=1 - load_jenkins_vars if [ ! -f .cico-prepare ]; then diff --git a/cico_run_coverage.sh b/cico_run_coverage.sh index 4af4a33b..4922363a 100644 --- a/cico_run_coverage.sh +++ b/cico_run_coverage.sh @@ -4,6 +4,6 @@ export USE_GO_VERSION_FROM_WEBSITE=1 -cico_setup; +cico_setup_coverage; run_tests_with_coverage; diff --git a/cico_run_tests.sh b/cico_run_tests.sh index 8ba98068..dd61064b 100644 --- a/cico_run_tests.sh +++ b/cico_run_tests.sh @@ -2,8 +2,6 @@ . cico_setup.sh -export USE_GO_VERSION_FROM_WEBSITE=1 - cico_setup; run_tests_without_coverage; diff --git a/cico_setup.sh b/cico_setup.sh index 01eb8255..0e90cccd 100644 --- a/cico_setup.sh +++ b/cico_setup.sh @@ -142,3 +142,16 @@ function cico_setup() { install_deps; prepare; } + +function cico_setup_coverage() { + load_jenkins_vars; + install_deps; + + # prepare() without check-go-format + make docker-start + # make docker-check-go-format + make docker-deps + make docker-generate + make docker-build + echo 'CICO: Preparation complete' +} diff --git a/controller/token.go b/controller/token.go index 5e9f379d..66b9bb25 100644 --- a/controller/token.go +++ b/controller/token.go @@ -56,7 +56,7 @@ func NewTokenController(service *goa.Service, app application.Application, auth TokenManager: tokenManager, Configuration: configuration, providerConfigFactory: providerConfigFactory, - app: app, + app: app, } } @@ -304,7 +304,7 @@ func (c *TokenController) retrieveClusterToken(ctx context.Context, forResource } if osConfig.OSOCluster().ServiceAccountUsername != userProfile.Username { log.Warn(ctx, map[string]interface{}{ - "for": forResource, + "for": forResource, "configuration_username": osConfig.OSOCluster().ServiceAccountUsername, "user_profile_username": userProfile.Username, }, "username from user profile for cluster token does not match username stored in configuration") diff --git a/controller/users.go b/controller/users.go index 9b8bc1fa..bae97fef 100644 --- a/controller/users.go +++ b/controller/users.go @@ -523,8 +523,8 @@ func (c *UsersController) updateWITUser(ctx *app.UpdateUsersContext, identityID FullName: ctx.Payload.Data.Attributes.FullName, ImageURL: ctx.Payload.Data.Attributes.ImageURL, RegistrationCompleted: ctx.Payload.Data.Attributes.RegistrationCompleted, - URL: ctx.Payload.Data.Attributes.URL, - Username: ctx.Payload.Data.Attributes.Username, + URL: ctx.Payload.Data.Attributes.URL, + Username: ctx.Payload.Data.Attributes.Username, }, Type: ctx.Payload.Data.Type, }, diff --git a/login/link/keycloak_idp.go b/login/link/keycloak_idp.go index d8fbd976..69af6d5b 100644 --- a/login/link/keycloak_idp.go +++ b/login/link/keycloak_idp.go @@ -59,7 +59,7 @@ func (c *KeycloakIDPServiceClient) Create(ctx context.Context, keycloakLinkIDPRe if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_idp_link_url": keycloakIDPLinkURL, - "err": err, + "err": err, }, "Unable to create idp link for RHD") return errors.NewInternalError(ctx, err) } else if resp != nil { diff --git a/login/profile.go b/login/profile.go index ae3f1320..87350f8f 100644 --- a/login/profile.go +++ b/login/profile.go @@ -139,7 +139,7 @@ func (userProfileClient *KeycloakUserProfileClient) CreateOrUpdate(ctx context.C if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_user_profile_url": keycloakAdminUserAPIURL, - "err": err, + "err": err, }, "Unable to create Keycloak user") return nil, false, errors.NewInternalError(ctx, err) } else if resp != nil { @@ -345,7 +345,7 @@ func (userProfileClient *KeycloakUserProfileClient) Update(ctx context.Context, if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_user_profile_url": keycloakProfileURL, - "err": err, + "err": err, }, "Unable to update Keycloak user profile") return errors.NewInternalError(ctx, err) } else if resp != nil { @@ -398,7 +398,7 @@ func (userProfileClient *KeycloakUserProfileClient) Get(ctx context.Context, acc if err != nil { log.Error(ctx, map[string]interface{}{ "keycloak_user_profile_url": keycloakProfileURL, - "err": err, + "err": err, }, "Unable to fetch Keycloak user profile") return nil, errors.NewInternalError(ctx, err) } else if resp != nil { diff --git a/login/service.go b/login/service.go index 5d15fc1a..dc601a05 100644 --- a/login/service.go +++ b/login/service.go @@ -53,10 +53,10 @@ type Configuration interface { // NewKeycloakOAuthProvider creates a new login.Service capable of using keycloak for authorization func NewKeycloakOAuthProvider(identities account.IdentityRepository, users account.UserRepository, tokenManager token.Manager, app application.Application, keycloakProfileService UserProfileService, osoSubscriptionManager OSOSubscriptionManager) *KeycloakOAuthProvider { return &KeycloakOAuthProvider{ - Identities: identities, - Users: users, - TokenManager: tokenManager, - App: app, + Identities: identities, + Users: users, + TokenManager: tokenManager, + App: app, keycloakProfileService: keycloakProfileService, osoSubscriptionManager: osoSubscriptionManager, } diff --git a/main.go b/main.go index 87c240eb..b953eb4c 100644 --- a/main.go +++ b/main.go @@ -60,7 +60,7 @@ func main() { log.Panic(nil, map[string]interface{}{ "config_file": configFile, "service_account_config_file": serviceAccountConfigFile, - "err": err, + "err": err, }, "failed to setup the configuration") } diff --git a/wit/service/wit_service.go b/wit/service/wit_service.go index 7d3e3afe..6902e8bb 100644 --- a/wit/service/wit_service.go +++ b/wit/service/wit_service.go @@ -46,8 +46,8 @@ func (s *witServiceImpl) UpdateUser(ctx context.Context, updatePayload *app.Upda FullName: updatePayload.Data.Attributes.FullName, ImageURL: updatePayload.Data.Attributes.ImageURL, RegistrationCompleted: updatePayload.Data.Attributes.RegistrationCompleted, - URL: updatePayload.Data.Attributes.URL, - Username: updatePayload.Data.Attributes.Username, + URL: updatePayload.Data.Attributes.URL, + Username: updatePayload.Data.Attributes.Username, }, Type: updatePayload.Data.Type, },