Skip to content

Commit

Permalink
fix: remove warning (#4949)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguiheux authored Feb 13, 2020
1 parent 53cb881 commit fafd208
Show file tree
Hide file tree
Showing 72 changed files with 64 additions and 3,288 deletions.
9 changes: 0 additions & 9 deletions engine/api/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ func (api *API) postMaintenanceHandler() service.Handler {
}
}

func (api *API) adminTruncateWarningsHandler() service.Handler {
return func(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
if _, err := api.mustDB().Exec("delete from warning"); err != nil {
return sdk.WrapError(err, "Unable to truncate warning ")
}
return nil
}
}

func (api *API) getAdminServicesHandler() service.Handler {
return func(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
srvs := []sdk.Service{}
Expand Down
8 changes: 0 additions & 8 deletions engine/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import (
"github.com/ovh/cds/engine/api/secret"
"github.com/ovh/cds/engine/api/services"
"github.com/ovh/cds/engine/api/version"
"github.com/ovh/cds/engine/api/warning"
"github.com/ovh/cds/engine/api/worker"
"github.com/ovh/cds/engine/api/workermodel"
"github.com/ovh/cds/engine/api/workflow"
Expand Down Expand Up @@ -251,7 +250,6 @@ type API struct {
StartupTime time.Time
Maintenance bool
eventsBroker *eventsBroker
warnChan chan sdk.Event
Cache cache.Store
Metrics struct {
WorkflowRunFailed *stats.Int64Measure
Expand Down Expand Up @@ -623,9 +621,6 @@ func (a *API) Serve(ctx context.Context) error {
go event.DequeueEvent(ctx, a.mustDB())
}

a.warnChan = make(chan sdk.Event)
event.Subscribe(a.warnChan)

log.Info(ctx, "Initializing internal routines...")
sdk.GoRoutine(ctx, "maintenance.Subscribe", func(ctx context.Context) {
if err := a.listenMaintenance(ctx); err != nil {
Expand Down Expand Up @@ -657,9 +652,6 @@ func (a *API) Serve(ctx context.Context) error {
sdk.GoRoutine(ctx, "workflowtemplate.ComputeAudit", func(ctx context.Context) {
workflowtemplate.ComputeAudit(ctx, a.DBConnectionFactory.GetDBMap)
}, a.PanicDump())
sdk.GoRoutine(ctx, "warning.Start", func(ctx context.Context) {
warning.Start(ctx, a.DBConnectionFactory.GetDBMap, a.warnChan)
}, a.PanicDump())
sdk.GoRoutine(ctx, "auditCleanerRoutine(ctx", func(ctx context.Context) {
auditCleanerRoutine(ctx, a.DBConnectionFactory.GetDBMap)
})
Expand Down
4 changes: 0 additions & 4 deletions engine/api/api_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (api *API) InitRouter() {

// Admin
r.Handle("/admin/maintenance", Scope(sdk.AuthConsumerScopeAdmin), r.POST(api.postMaintenanceHandler, NeedAdmin(true)))
r.Handle("/admin/warning", Scope(sdk.AuthConsumerScopeAdmin), r.DELETE(api.adminTruncateWarningsHandler, NeedAdmin(true)))
r.Handle("/admin/cds/migration", Scope(sdk.AuthConsumerScopeAdmin), r.GET(api.getAdminMigrationsHandler, NeedAdmin(true)))
r.Handle("/admin/cds/migration/{id}/cancel", Scope(sdk.AuthConsumerScopeAdmin), r.POST(api.postAdminMigrationCancelHandler, NeedAdmin(true)))
r.Handle("/admin/cds/migration/{id}/todo", Scope(sdk.AuthConsumerScopeAdmin), r.POST(api.postAdminMigrationTodoHandler, NeedAdmin(true)))
Expand Down Expand Up @@ -178,9 +177,6 @@ func (api *API) InitRouter() {
// Export Application
r.Handle("/project/{permProjectKey}/export/application/{applicationName}", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getApplicationExportHandler))

r.Handle("/warning/{permProjectKey}", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getWarningsHandler))
r.Handle("/warning/{permProjectKey}/{hash}", Scope(sdk.AuthConsumerScopeProject), r.PUT(api.putWarningsHandler))

// Application
r.Handle("/project/{permProjectKey}/ascode/application", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getAsCodeApplicationHandler))
r.Handle("/project/{permProjectKey}/application/{applicationName}", Scope(sdk.AuthConsumerScopeProject), r.GET(api.getApplicationHandler), r.PUT(api.updateApplicationHandler), r.DELETE(api.deleteApplicationHandler))
Expand Down
61 changes: 0 additions & 61 deletions engine/api/warning.go

This file was deleted.

121 changes: 0 additions & 121 deletions engine/api/warning/dao.go

This file was deleted.

14 changes: 0 additions & 14 deletions engine/api/warning/gorp_model.go

This file was deleted.

77 changes: 0 additions & 77 deletions engine/api/warning/warning.go

This file was deleted.

Loading

0 comments on commit fafd208

Please sign in to comment.