Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
526901e8
Commit
526901e8
authored
Apr 08, 2021
by
Ignacy Moryc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve error message for project not found
parent
8c2ab295
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
7 deletions
+12
-7
changelogs/unreleased/326839-improve-message.yml
changelogs/unreleased/326839-improve-message.yml
+5
-0
ee/spec/requests/git_http_geo_spec.rb
ee/spec/requests/git_http_geo_spec.rb
+1
-1
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+1
-1
spec/lib/gitlab/git_access_spec.rb
spec/lib/gitlab/git_access_spec.rb
+5
-5
No files found.
changelogs/unreleased/326839-improve-message.yml
0 → 100644
View file @
526901e8
---
title
:
Improve message for :project_not_found error to indicate possible cause
merge_request
:
58945
author
:
Ignacy Moryc @ignacy
type
:
changed
ee/spec/requests/git_http_geo_spec.rb
View file @
526901e8
...
...
@@ -534,7 +534,7 @@ RSpec.describe "Git HTTP requests (Geo)", :geo do
it
'returns a 404'
do
is_expected
.
to
have_gitlab_http_status
(
:not_found
)
expect
(
response
.
body
).
to
eql
(
'The project you were looking for could not be found.'
)
expect
(
response
.
body
).
to
eql
(
"The project you were looking for could not be found or you don't have permission to view it."
)
end
end
...
...
lib/gitlab/git_access.rb
View file @
526901e8
...
...
@@ -22,7 +22,7 @@ module Gitlab
auth_download:
'You are not allowed to download code.'
,
deploy_key_upload:
'This deploy key does not have write access to this project.'
,
no_repo:
'A repository for this project does not exist yet.'
,
project_not_found:
'The project you were looking for could not be found.'
,
project_not_found:
"The project you were looking for could not be found or you don't have permission to view it."
,
command_not_allowed:
"The command you're trying to execute is not allowed."
,
upload_pack_disabled_over_http:
'Pulling over HTTP is not allowed.'
,
receive_pack_disabled_over_http:
'Pushing over HTTP is not allowed.'
,
...
...
spec/lib/gitlab/git_access_spec.rb
View file @
526901e8
...
...
@@ -554,19 +554,19 @@ RSpec.describe Gitlab::GitAccess do
context
'when the repository is public'
do
let
(
:options
)
{
%i[repository_enabled]
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
'The project you were looking for could not be found.'
)
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
"The project you were looking for could not be found or you don't have permission to view it."
)
}
end
context
'when the repository is private'
do
let
(
:options
)
{
%i[repository_private]
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
'The project you were looking for could not be found.'
)
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
"The project you were looking for could not be found or you don't have permission to view it."
)
}
end
context
'when the repository is disabled'
do
let
(
:options
)
{
%i[repository_disabled]
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
'The project you were looking for could not be found.'
)
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
"The project you were looking for could not be found or you don't have permission to view it."
)
}
end
end
end
...
...
@@ -596,13 +596,13 @@ RSpec.describe Gitlab::GitAccess do
context
'when the repository is private'
do
let
(
:options
)
{
%i[repository_private]
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
'The project you were looking for could not be found.'
)
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
"The project you were looking for could not be found or you don't have permission to view it."
)
}
end
context
'when the repository is disabled'
do
let
(
:options
)
{
%i[repository_disabled]
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
'The project you were looking for could not be found.'
)
}
it
{
expect
{
pull_access_check
}.
to
raise_error
(
"The project you were looking for could not be found or you don't have permission to view it."
)
}
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment