From a0d008e071bbabd5acbeedcc04d921211f11a80e Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Thu, 23 Sep 2021 15:29:09 -0500 Subject: [PATCH] Move cncd/{logging,pubsub,queue}/ to server/{logging,pubsub,queue}/ (#346) * Move cncd/{logging,pubsub,queue}/ to server/{logging,pubsub,queue}/ * Update REAMDEs and include history Co-authored-by: Anbraten Co-authored-by: Anbraten --- cmd/server/server.go | 4 ++-- cmd/server/setup.go | 2 +- cncd/logging/README | 6 ------ cncd/pubsub/README | 6 ------ cncd/queue/README | 6 ------ model/queue.go | 2 +- server/api/build.go | 2 +- server/api/hook.go | 4 ++-- server/api/stream.go | 4 ++-- server/config.go | 6 +++--- server/grpc/rpc.go | 6 +++--- {cncd => server}/logging/LICENSE | 0 server/logging/README.md | 12 ++++++++++++ {cncd => server}/logging/log.go | 0 {cncd => server}/logging/log_test.go | 0 {cncd => server}/logging/logging.go | 0 {cncd => server}/pubsub/LICENSE | 0 server/pubsub/README.md | 12 ++++++++++++ {cncd => server}/pubsub/pub.go | 0 {cncd => server}/pubsub/pub_test.go | 0 {cncd => server}/pubsub/pubsub.go | 0 {cncd => server}/pubsub/topic.go | 0 {cncd => server}/pubsub/topic_test.go | 0 {cncd => server}/queue/LICENSE | 0 server/queue/README.md | 12 ++++++++++++ {cncd => server}/queue/fifo.go | 0 {cncd => server}/queue/fifo_test.go | 0 {cncd => server}/queue/queue.go | 0 {cncd => server}/queue/worker.go | 0 {cncd => server}/queue/worker_test.go | 0 30 files changed, 51 insertions(+), 33 deletions(-) delete mode 100644 cncd/logging/README delete mode 100644 cncd/pubsub/README delete mode 100644 cncd/queue/README rename {cncd => server}/logging/LICENSE (100%) create mode 100644 server/logging/README.md rename {cncd => server}/logging/log.go (100%) rename {cncd => server}/logging/log_test.go (100%) rename {cncd => server}/logging/logging.go (100%) rename {cncd => server}/pubsub/LICENSE (100%) create mode 100644 server/pubsub/README.md rename {cncd => server}/pubsub/pub.go (100%) rename {cncd => server}/pubsub/pub_test.go (100%) rename {cncd => server}/pubsub/pubsub.go (100%) rename {cncd => server}/pubsub/topic.go (100%) rename {cncd => server}/pubsub/topic_test.go (100%) rename {cncd => server}/queue/LICENSE (100%) create mode 100644 server/queue/README.md rename {cncd => server}/queue/fifo.go (100%) rename {cncd => server}/queue/fifo_test.go (100%) rename {cncd => server}/queue/queue.go (100%) rename {cncd => server}/queue/worker.go (100%) rename {cncd => server}/queue/worker_test.go (100%) diff --git a/cmd/server/server.go b/cmd/server/server.go index 80631de65..85342541c 100644 --- a/cmd/server/server.go +++ b/cmd/server/server.go @@ -33,12 +33,12 @@ import ( "golang.org/x/crypto/acme/autocert" "golang.org/x/sync/errgroup" - "github.com/woodpecker-ci/woodpecker/cncd/logging" "github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/rpc/proto" - "github.com/woodpecker-ci/woodpecker/cncd/pubsub" "github.com/woodpecker-ci/woodpecker/server" woodpeckerGrpcServer "github.com/woodpecker-ci/woodpecker/server/grpc" + "github.com/woodpecker-ci/woodpecker/server/logging" "github.com/woodpecker-ci/woodpecker/server/plugins/sender" + "github.com/woodpecker-ci/woodpecker/server/pubsub" "github.com/woodpecker-ci/woodpecker/server/remote" "github.com/woodpecker-ci/woodpecker/server/router" "github.com/woodpecker-ci/woodpecker/server/router/middleware" diff --git a/cmd/server/setup.go b/cmd/server/setup.go index b2e26fd3e..b478368aa 100644 --- a/cmd/server/setup.go +++ b/cmd/server/setup.go @@ -21,12 +21,12 @@ import ( "github.com/dimfeld/httptreemux" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" - "github.com/woodpecker-ci/woodpecker/cncd/queue" "github.com/woodpecker-ci/woodpecker/model" "github.com/woodpecker-ci/woodpecker/server" "github.com/woodpecker-ci/woodpecker/server/plugins/environments" "github.com/woodpecker-ci/woodpecker/server/plugins/registry" "github.com/woodpecker-ci/woodpecker/server/plugins/secrets" + "github.com/woodpecker-ci/woodpecker/server/queue" "github.com/woodpecker-ci/woodpecker/server/remote" "github.com/woodpecker-ci/woodpecker/server/remote/bitbucket" "github.com/woodpecker-ci/woodpecker/server/remote/bitbucketserver" diff --git a/cncd/logging/README b/cncd/logging/README deleted file mode 100644 index f4aa23094..000000000 --- a/cncd/logging/README +++ /dev/null @@ -1,6 +0,0 @@ -Go package provides a common interface for storing and streaming logs. - -Documentation: - - http://godoc.org/github.com/woodpecker-ci/woodpecker/cncd/logging - http://godoc.org/github.com/woodpecker-ci/woodpecker/cncd/logging/gcp diff --git a/cncd/pubsub/README b/cncd/pubsub/README deleted file mode 100644 index f67819968..000000000 --- a/cncd/pubsub/README +++ /dev/null @@ -1,6 +0,0 @@ -Go package provides a common interface for publish-subscriber messaging. - -Documentation: - - http://godoc.org/github.com/woodpecker-ci/woodpecker/cncd/pubsub - http://godoc.org/github.com/woodpecker-ci/woodpecker/cncd/pubsub/gcp diff --git a/cncd/queue/README b/cncd/queue/README deleted file mode 100644 index 9cbfe07ac..000000000 --- a/cncd/queue/README +++ /dev/null @@ -1,6 +0,0 @@ -Go package provides a common interface for working with task queues. - -Documentation: - - http://godoc.org/github.com/woodpecker-ci/woodpecker/cncd/queue - http://godoc.org/github.com/woodpecker-ci/woodpecker/cncd/queue/gcp diff --git a/model/queue.go b/model/queue.go index c1d043c72..3ea6a3bf7 100644 --- a/model/queue.go +++ b/model/queue.go @@ -18,7 +18,7 @@ import ( "context" "github.com/sirupsen/logrus" - "github.com/woodpecker-ci/woodpecker/cncd/queue" + "github.com/woodpecker-ci/woodpecker/server/queue" ) // Task defines scheduled pipeline Task. diff --git a/server/api/build.go b/server/api/build.go index 9254a28d3..2bfcb111a 100644 --- a/server/api/build.go +++ b/server/api/build.go @@ -29,9 +29,9 @@ import ( "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" - "github.com/woodpecker-ci/woodpecker/cncd/queue" "github.com/woodpecker-ci/woodpecker/model" "github.com/woodpecker-ci/woodpecker/server" + "github.com/woodpecker-ci/woodpecker/server/queue" "github.com/woodpecker-ci/woodpecker/server/remote" "github.com/woodpecker-ci/woodpecker/server/router/middleware/session" "github.com/woodpecker-ci/woodpecker/server/shared" diff --git a/server/api/hook.go b/server/api/hook.go index d8a9b52e1..959fc810b 100644 --- a/server/api/hook.go +++ b/server/api/hook.go @@ -36,9 +36,9 @@ import ( "github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/frontend/yaml" "github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/rpc" - "github.com/woodpecker-ci/woodpecker/cncd/pubsub" - "github.com/woodpecker-ci/woodpecker/cncd/queue" "github.com/woodpecker-ci/woodpecker/server" + "github.com/woodpecker-ci/woodpecker/server/pubsub" + "github.com/woodpecker-ci/woodpecker/server/queue" "github.com/woodpecker-ci/woodpecker/server/remote" "github.com/woodpecker-ci/woodpecker/server/shared" "github.com/woodpecker-ci/woodpecker/server/store" diff --git a/server/api/stream.go b/server/api/stream.go index b57aa60a3..1a5b5e9d7 100644 --- a/server/api/stream.go +++ b/server/api/stream.go @@ -22,10 +22,10 @@ import ( "strconv" "time" - "github.com/woodpecker-ci/woodpecker/cncd/logging" - "github.com/woodpecker-ci/woodpecker/cncd/pubsub" "github.com/woodpecker-ci/woodpecker/model" "github.com/woodpecker-ci/woodpecker/server" + "github.com/woodpecker-ci/woodpecker/server/logging" + "github.com/woodpecker-ci/woodpecker/server/pubsub" "github.com/woodpecker-ci/woodpecker/server/router/middleware/session" "github.com/woodpecker-ci/woodpecker/server/store" diff --git a/server/config.go b/server/config.go index 3737b0f05..d1b63344e 100644 --- a/server/config.go +++ b/server/config.go @@ -20,10 +20,10 @@ package server import ( "time" - "github.com/woodpecker-ci/woodpecker/cncd/logging" - "github.com/woodpecker-ci/woodpecker/cncd/pubsub" - "github.com/woodpecker-ci/woodpecker/cncd/queue" "github.com/woodpecker-ci/woodpecker/model" + "github.com/woodpecker-ci/woodpecker/server/logging" + "github.com/woodpecker-ci/woodpecker/server/pubsub" + "github.com/woodpecker-ci/woodpecker/server/queue" ) var Config = struct { diff --git a/server/grpc/rpc.go b/server/grpc/rpc.go index 26d4b6b7b..b2b2d752f 100644 --- a/server/grpc/rpc.go +++ b/server/grpc/rpc.go @@ -32,12 +32,12 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/sirupsen/logrus" - "github.com/woodpecker-ci/woodpecker/cncd/logging" "github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/rpc" "github.com/woodpecker-ci/woodpecker/cncd/pipeline/pipeline/rpc/proto" - "github.com/woodpecker-ci/woodpecker/cncd/pubsub" - "github.com/woodpecker-ci/woodpecker/cncd/queue" "github.com/woodpecker-ci/woodpecker/server" + "github.com/woodpecker-ci/woodpecker/server/logging" + "github.com/woodpecker-ci/woodpecker/server/pubsub" + "github.com/woodpecker-ci/woodpecker/server/queue" "github.com/woodpecker-ci/woodpecker/server/shared" "github.com/woodpecker-ci/woodpecker/model" diff --git a/cncd/logging/LICENSE b/server/logging/LICENSE similarity index 100% rename from cncd/logging/LICENSE rename to server/logging/LICENSE diff --git a/server/logging/README.md b/server/logging/README.md new file mode 100644 index 000000000..3af6ce5e6 --- /dev/null +++ b/server/logging/README.md @@ -0,0 +1,12 @@ +# logging package + +Go package provides a common interface for storing and streaming logs. + +## History + +This was originally published in: https://github.com/cncd/logging +Then it was included in: https://github.com/drone-ci/drone/cncd/logging + +## Documentation: + +https://godoc.org/github.com/woodpecker-ci/woodpecker/server/logging diff --git a/cncd/logging/log.go b/server/logging/log.go similarity index 100% rename from cncd/logging/log.go rename to server/logging/log.go diff --git a/cncd/logging/log_test.go b/server/logging/log_test.go similarity index 100% rename from cncd/logging/log_test.go rename to server/logging/log_test.go diff --git a/cncd/logging/logging.go b/server/logging/logging.go similarity index 100% rename from cncd/logging/logging.go rename to server/logging/logging.go diff --git a/cncd/pubsub/LICENSE b/server/pubsub/LICENSE similarity index 100% rename from cncd/pubsub/LICENSE rename to server/pubsub/LICENSE diff --git a/server/pubsub/README.md b/server/pubsub/README.md new file mode 100644 index 000000000..42c6c87a5 --- /dev/null +++ b/server/pubsub/README.md @@ -0,0 +1,12 @@ +# pubusb package + +Go package provides a common interface for publish-subscriber messaging. + +## History + +This was originally published in: https://github.com/cncd/pubsub +Then it was included in: https://github.com/drone-ci/drone/cncd/pubsub + +## Documentation: + +https://godoc.org/github.com/woodpecker-ci/woodpecker/server/pubsub diff --git a/cncd/pubsub/pub.go b/server/pubsub/pub.go similarity index 100% rename from cncd/pubsub/pub.go rename to server/pubsub/pub.go diff --git a/cncd/pubsub/pub_test.go b/server/pubsub/pub_test.go similarity index 100% rename from cncd/pubsub/pub_test.go rename to server/pubsub/pub_test.go diff --git a/cncd/pubsub/pubsub.go b/server/pubsub/pubsub.go similarity index 100% rename from cncd/pubsub/pubsub.go rename to server/pubsub/pubsub.go diff --git a/cncd/pubsub/topic.go b/server/pubsub/topic.go similarity index 100% rename from cncd/pubsub/topic.go rename to server/pubsub/topic.go diff --git a/cncd/pubsub/topic_test.go b/server/pubsub/topic_test.go similarity index 100% rename from cncd/pubsub/topic_test.go rename to server/pubsub/topic_test.go diff --git a/cncd/queue/LICENSE b/server/queue/LICENSE similarity index 100% rename from cncd/queue/LICENSE rename to server/queue/LICENSE diff --git a/server/queue/README.md b/server/queue/README.md new file mode 100644 index 000000000..5a3619a48 --- /dev/null +++ b/server/queue/README.md @@ -0,0 +1,12 @@ +# queue package + +Go package provides a common interface for working with task queues. + +## History + +This was originally published in: https://github.com/cncd/queue +Then it was included in: https://github.com/drone-ci/drone/cncd/queue + +## Documentation: + +https://godoc.org/github.com/woodpecker-ci/woodpecker/server/queue diff --git a/cncd/queue/fifo.go b/server/queue/fifo.go similarity index 100% rename from cncd/queue/fifo.go rename to server/queue/fifo.go diff --git a/cncd/queue/fifo_test.go b/server/queue/fifo_test.go similarity index 100% rename from cncd/queue/fifo_test.go rename to server/queue/fifo_test.go diff --git a/cncd/queue/queue.go b/server/queue/queue.go similarity index 100% rename from cncd/queue/queue.go rename to server/queue/queue.go diff --git a/cncd/queue/worker.go b/server/queue/worker.go similarity index 100% rename from cncd/queue/worker.go rename to server/queue/worker.go diff --git a/cncd/queue/worker_test.go b/server/queue/worker_test.go similarity index 100% rename from cncd/queue/worker_test.go rename to server/queue/worker_test.go