Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2020-09-07 10:29:19 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2020-09-07 11:16:11 +0300
commit86c5d708df567f605fe44f48389c504b9f170b3d (patch)
tree33274ea1d9cc584cce18df4763294c2582ab0960 /internal/testhelper
parent8a0d83b496eaff459d55bc6825428f648059e8d9 (diff)
gitaly: Move Gitaly-specific code into `internal/gitaly`
Since the introduction of Praefect, our code layout started to become confusing: while Praefect code lives in `internal/praefect`, Gitaly-specific code is all over the place and not neatly singled out. This makes it hard at times to tell apart Praefect- and Gitaly-specific from generic code. To improve the situation, this commit thus moves most of the server specific code into a new `internal/gitaly` package. Currently, this is the `internal/config`, `internal/server`, `internal/service` and `internal/rubyserver` packages, which are all main components of Gitaly. The move was realized with the following script: #!/bin/sh mkdir -p internal/gitaly git mv internal/{config,server,service,rubyserver} internal/gitaly/ find . -name '*.go' -exec sed -i \ -e 's|gitlab-org/gitaly/internal/rubyserver|gitlab-org/gitaly/internal/gitaly/rubyserver|' \ -e 's|gitlab-org/gitaly/internal/server|gitlab-org/gitaly/internal/gitaly/server|' \ -e 's|gitlab-org/gitaly/internal/service|gitlab-org/gitaly/internal/gitaly/service|' \ -e 's|gitlab-org/gitaly/internal/config|gitlab-org/gitaly/internal/gitaly/config|' {} \; In addition to that, some minor adjustments were needed for tests which used relative paths.
Diffstat (limited to 'internal/testhelper')
-rw-r--r--internal/testhelper/git_protocol.go2
-rw-r--r--internal/testhelper/githttp.go2
-rw-r--r--internal/testhelper/hook_env.go2
-rw-r--r--internal/testhelper/testhelper.go2
-rw-r--r--internal/testhelper/testserver.go6
5 files changed, 7 insertions, 7 deletions
diff --git a/internal/testhelper/git_protocol.go b/internal/testhelper/git_protocol.go
index a57b85906..7ba4ddb6f 100644
--- a/internal/testhelper/git_protocol.go
+++ b/internal/testhelper/git_protocol.go
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/command"
- "gitlab.com/gitlab-org/gitaly/internal/config"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
)
// EnableGitProtocolV2Support replaces the git binary in config with a
diff --git a/internal/testhelper/githttp.go b/internal/testhelper/githttp.go
index 0c1416978..106d60461 100644
--- a/internal/testhelper/githttp.go
+++ b/internal/testhelper/githttp.go
@@ -9,7 +9,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
- "gitlab.com/gitlab-org/gitaly/internal/config"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
)
func GitServer(t testing.TB, repoPath string, middleware func(http.ResponseWriter, *http.Request, http.Handler)) (int, func() error) {
diff --git a/internal/testhelper/hook_env.go b/internal/testhelper/hook_env.go
index fd06c2019..e46177843 100644
--- a/internal/testhelper/hook_env.go
+++ b/internal/testhelper/hook_env.go
@@ -9,8 +9,8 @@ import (
"testing"
"github.com/stretchr/testify/require"
- "gitlab.com/gitlab-org/gitaly/internal/config"
"gitlab.com/gitlab-org/gitaly/internal/git/hooks"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
)
// CaptureHookEnv creates a bogus 'update' Git hook to sniff out what
diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go
index f8d9fda06..fd0b23387 100644
--- a/internal/testhelper/testhelper.go
+++ b/internal/testhelper/testhelper.go
@@ -36,7 +36,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/internal/command"
- "gitlab.com/gitlab-org/gitaly/internal/config"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
"gitlab.com/gitlab-org/gitaly/internal/helper/fieldextractors"
"gitlab.com/gitlab-org/gitaly/internal/helper/text"
gitalylog "gitlab.com/gitlab-org/gitaly/internal/log"
diff --git a/internal/testhelper/testserver.go b/internal/testhelper/testserver.go
index 8ccbcb6eb..f641f7003 100644
--- a/internal/testhelper/testserver.go
+++ b/internal/testhelper/testserver.go
@@ -27,13 +27,13 @@ import (
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
gitalyauth "gitlab.com/gitlab-org/gitaly/auth"
- "gitlab.com/gitlab-org/gitaly/internal/config"
- "gitlab.com/gitlab-org/gitaly/internal/config/auth"
"gitlab.com/gitlab-org/gitaly/internal/git/hooks"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config"
+ "gitlab.com/gitlab-org/gitaly/internal/gitaly/config/auth"
+ serverauth "gitlab.com/gitlab-org/gitaly/internal/gitaly/server/auth"
"gitlab.com/gitlab-org/gitaly/internal/gitlabshell"
"gitlab.com/gitlab-org/gitaly/internal/helper/fieldextractors"
praefectconfig "gitlab.com/gitlab-org/gitaly/internal/praefect/config"
- serverauth "gitlab.com/gitlab-org/gitaly/internal/server/auth"
"gitlab.com/gitlab-org/gitaly/proto/go/gitalypb"
"google.golang.org/grpc"
"google.golang.org/grpc/health"