New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add external service #3055
Conversation
engine/main.go
Outdated
@@ -141,6 +141,7 @@ Comming soon...`, | |||
conf.API.Auth.SharedInfraToken = sdk.RandomString(128) | |||
conf.API.Secrets.Key = sdk.RandomString(32) | |||
conf.API.Providers = append(conf.API.Providers, api.ProviderConfiguration{"sample-provider", sdk.RandomString(32)}) | |||
conf.API.Services = append(conf.API.Services, api.ServiceConfiguration{"sample-service", "https://ovh.github.io", 443, "/cds", 443, "doc"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github.com/ovh/cds/engine/api.ServiceConfiguration composite literal uses unkeyed fields
engine/api/api.go
Outdated
if err := services.InitExternal(a.mustDB, a.Cache, externalServices); err != nil { | ||
return fmt.Errorf("unable to init external service: %v", err) | ||
} | ||
go services.Pings(ctx, a.mustDB, externalServices) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdk.GoRoutine
engine/api/ascode_test.go
Outdated
mockService := &sdk.Service{Name: "Test_postImportAsCodeHandler", Type: services.TypeRepositories} | ||
repositoryService.Delete(mockService) | ||
test.NoError(t, repositoryService.Insert(mockService)) | ||
services.Delete(api.mustDB(), mockService) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of services.Delete
is not checked
engine/api/ascode_test.go
Outdated
mockService := &sdk.Service{Name: "Test_getImportAsCodeHandler", Type: services.TypeRepositories} | ||
repositoryService.Delete(mockService) | ||
test.NoError(t, repositoryService.Insert(mockService)) | ||
services.Delete(db, mockService) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of services.Delete
is not checked
engine/api/ascode_test.go
Outdated
mockService := &sdk.Service{Name: "Test_postPerformImportAsCodeHandler_Repo", Type: services.TypeRepositories} | ||
repositoryService.Delete(mockService) | ||
test.NoError(t, repositoryService.Insert(mockService)) | ||
services.Delete(db, mockService) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of services.Delete
is not checked
engine/api/services.go
Outdated
return sdk.WrapError(err, "postServiceRegisterHandler") | ||
} | ||
defer tx.Rollback() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of tx.Rollback
is not checked
engine/api/services.go
Outdated
log.Error("serviceAPIHeartbeat> error on repo.Begin:%v", err) | ||
return | ||
} | ||
defer tx.Rollback() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of tx.Rollback
is not checked
|
||
mockService = &sdk.Service{Name: "Test_postPerformImportAsCodeHandler_VCS", Type: services.TypeHooks} | ||
repositoryService.Delete(mockService) | ||
test.NoError(t, repositoryService.Insert(mockService)) | ||
services.Delete(db, mockService) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of services.Delete
is not checked
mockService := &sdk.Service{Name: "service_test", Type: "hooks"} | ||
repositoryService.Delete(mockService) | ||
test.NoError(t, repositoryService.Insert(mockService)) | ||
services.Delete(db, mockService) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error return value of services.Delete
is not checked
@ovh/cds