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:
authorPavlo Strokov <pstrokov@gitlab.com>2022-10-06 09:22:13 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2022-10-07 08:47:13 +0300
commitce2451fa0fc17966739a3faa5e633ca9a946843c (patch)
treec0a5101dc3bfe38e2f160f3afb966256a9622e55
parenta5ecd581fc8c124332e5823a132bb2a039ebdc72 (diff)
config: Simplify error messageps-locator
If relative path is not provided the error message used to include the full Repository entity. It has no much of usage as we don't rely on this data. With it the error message was hard to read and to create an expected results in the tests. It is simplified to have only an error message without the full Repository entity.
-rw-r--r--internal/gitaly/config/locator.go2
-rw-r--r--internal/gitaly/config/locator_test.go4
-rw-r--r--internal/gitaly/service/ssh/receive_pack_test.go2
-rw-r--r--internal/gitaly/service/ssh/upload_pack_test.go2
4 files changed, 5 insertions, 5 deletions
diff --git a/internal/gitaly/config/locator.go b/internal/gitaly/config/locator.go
index 3812c6190..786eb2d45 100644
--- a/internal/gitaly/config/locator.go
+++ b/internal/gitaly/config/locator.go
@@ -69,7 +69,7 @@ func (l *configLocator) GetPath(repo repository.GitRepo) (string, error) {
relativePath := repo.GetRelativePath()
if len(relativePath) == 0 {
- err := helper.ErrInvalidArgumentf("GetPath: relative path missing from %+v", repo)
+ err := helper.ErrInvalidArgumentf("GetPath: relative path missing")
return "", err
}
diff --git a/internal/gitaly/config/locator_test.go b/internal/gitaly/config/locator_test.go
index 9f34e463d..4b77a5c0f 100644
--- a/internal/gitaly/config/locator_test.go
+++ b/internal/gitaly/config/locator_test.go
@@ -63,7 +63,7 @@ func TestConfigLocator_GetRepoPath(t *testing.T) {
{
desc: "relative path is empty",
repo: &gitalypb.Repository{StorageName: storageName, RelativePath: ""},
- expErr: helper.ErrInvalidArgumentf(`GetPath: relative path missing from storage_name:"exists"`),
+ expErr: helper.ErrInvalidArgumentf("GetPath: relative path missing"),
},
{
desc: "unknown relative path",
@@ -161,7 +161,7 @@ func TestConfigLocator_GetPath(t *testing.T) {
{
desc: "relative path is empty",
repo: &gitalypb.Repository{StorageName: storageName, RelativePath: ""},
- expErr: helper.ErrInvalidArgumentf(`GetPath: relative path missing from storage_name:"exists"`),
+ expErr: helper.ErrInvalidArgumentf("GetPath: relative path missing"),
},
{
desc: "relative path escapes parent folder",
diff --git a/internal/gitaly/service/ssh/receive_pack_test.go b/internal/gitaly/service/ssh/receive_pack_test.go
index 0f9317696..7267022b6 100644
--- a/internal/gitaly/service/ssh/receive_pack_test.go
+++ b/internal/gitaly/service/ssh/receive_pack_test.go
@@ -67,7 +67,7 @@ func TestReceivePack_validation(t *testing.T) {
return helper.ErrInvalidArgumentf("repo scoped: invalid Repository")
}
- return helper.ErrInvalidArgumentf("GetPath: relative path missing from storage_name:\"default\"")
+ return helper.ErrInvalidArgumentf("GetPath: relative path missing")
}(),
},
{
diff --git a/internal/gitaly/service/ssh/upload_pack_test.go b/internal/gitaly/service/ssh/upload_pack_test.go
index 4d6e9e46b..491783e97 100644
--- a/internal/gitaly/service/ssh/upload_pack_test.go
+++ b/internal/gitaly/service/ssh/upload_pack_test.go
@@ -445,7 +445,7 @@ func TestUploadPack_validation(t *testing.T) {
if testhelper.IsPraefectEnabled() {
return helper.ErrInvalidArgumentf("repo scoped: invalid Repository")
}
- return helper.ErrInvalidArgumentf("GetPath: relative path missing from storage_name:%q", "default")
+ return helper.ErrInvalidArgumentf("GetPath: relative path missing")
}(),
},
{