diff --git a/obs-staging-bot/go.mod b/obs-staging-bot/go.mod index 1c310a2..5082adb 100644 --- a/obs-staging-bot/go.mod +++ b/obs-staging-bot/go.mod @@ -26,6 +26,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect + github.com/rabbitmq/amqp091-go v1.10.0 // indirect go.mongodb.org/mongo-driver v1.14.0 // indirect go.opentelemetry.io/otel v1.24.0 // indirect go.opentelemetry.io/otel/metric v1.24.0 // indirect diff --git a/obs-staging-bot/go.sum b/obs-staging-bot/go.sum index b1db529..63801ba 100644 --- a/obs-staging-bot/go.sum +++ b/obs-staging-bot/go.sum @@ -48,6 +48,8 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+ github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw= +github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/obs-staging-bot/main.go b/obs-staging-bot/main.go index 950323c..01ceb27 100644 --- a/obs-staging-bot/main.go +++ b/obs-staging-bot/main.go @@ -1,7 +1,10 @@ package main import ( + "time" + "src.opensuse.org/autogits/common" + "github.com/rabbitmq/amqp091-go" ) const ( @@ -10,19 +13,29 @@ const ( ) var GiteaToken string + var runId uint +func allocateRequestHandler() *common.RequestHandler { + runId++ + + + return &common.RequestHandler { + Logger: &common.StdoutLogging{ + Id: runId, + Date: time.Now(), + }, + } +} + func main() { var defs common.ListenDefinitions defs.Url = ObsBuildBot defs.GitAuthor = GitAuthor - defs.Handlers = make(map[string]common.RequestProcessor) - defs.Handlers[common.RequestType_PR] = processPullRequest - defs.Handlers[common.RequestType_PR_sync] = processPullRequest - common.RequireGiteaSecretToken() common.RequireObsSecretToken() - common.StartServerWithAddress(defs, ListenAddr) + + }