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
a33d5916
Commit
a33d5916
authored
May 17, 2018
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't pass the repository path to Gitlab Shell
This isn't a requirement, and removes deprecated method calls
parent
ec7163ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
13 deletions
+7
-13
lib/api/helpers/internal_helpers.rb
lib/api/helpers/internal_helpers.rb
+0
-6
lib/api/internal.rb
lib/api/internal.rb
+1
-1
spec/requests/api/internal_spec.rb
spec/requests/api/internal_spec.rb
+6
-6
No files found.
lib/api/helpers/internal_helpers.rb
View file @
a33d5916
...
@@ -89,12 +89,6 @@ module API
...
@@ -89,12 +89,6 @@ module API
end
end
end
end
# Return the repository full path so that gitlab-shell has it when
# handling ssh commands
def
repository_path
repository
.
path_to_repo
end
# Return the Gitaly Address if it is enabled
# Return the Gitaly Address if it is enabled
def
gitaly_payload
(
action
)
def
gitaly_payload
(
action
)
return
unless
%w[git-receive-pack git-upload-pack git-upload-archive]
.
include?
(
action
)
return
unless
%w[git-receive-pack git-upload-pack git-upload-archive]
.
include?
(
action
)
...
...
lib/api/internal.rb
View file @
a33d5916
...
@@ -59,7 +59,7 @@ module API
...
@@ -59,7 +59,7 @@ module API
status:
true
,
status:
true
,
gl_repository:
gl_repository
,
gl_repository:
gl_repository
,
gl_username:
user
&
.
username
,
gl_username:
user
&
.
username
,
repository_path:
repository_path
,
repository_path:
nil
,
gitaly:
gitaly_payload
(
params
[
:action
])
gitaly:
gitaly_payload
(
params
[
:action
])
}
}
end
end
...
...
spec/requests/api/internal_spec.rb
View file @
a33d5916
require
'spec_helper'
require
'spec_helper'
describe
API
::
Internal
do
describe
API
::
Internal
do
l
et
(
:user
)
{
create
(
:user
)
}
s
et
(
:user
)
{
create
(
:user
)
}
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
let
(
:key
)
{
create
(
:key
,
user:
user
)
}
l
et
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
s
et
(
:project
)
{
create
(
:project
,
:repository
,
:wiki_repo
)
}
let
(
:secret_token
)
{
Gitlab
::
Shell
.
secret_token
}
let
(
:secret_token
)
{
Gitlab
::
Shell
.
secret_token
}
let
(
:gl_repository
)
{
"project-
#{
project
.
id
}
"
}
let
(
:gl_repository
)
{
"project-
#{
project
.
id
}
"
}
let
(
:reference_counter
)
{
double
(
'ReferenceCounter'
)
}
let
(
:reference_counter
)
{
double
(
'ReferenceCounter'
)
}
...
@@ -277,7 +277,7 @@ describe API::Internal do
...
@@ -277,7 +277,7 @@ describe API::Internal do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"repository_path"
]).
to
eq
(
project
.
wiki
.
repository
.
path_to_repo
)
expect
(
json_response
[
"repository_path"
]).
to
be_nil
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"wiki-
#{
project
.
id
}
"
)
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"wiki-
#{
project
.
id
}
"
)
expect
(
user
).
not_to
have_an_activity_record
expect
(
user
).
not_to
have_an_activity_record
end
end
...
@@ -289,7 +289,7 @@ describe API::Internal do
...
@@ -289,7 +289,7 @@ describe API::Internal do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"repository_path"
]).
to
eq
(
project
.
wiki
.
repository
.
path_to_repo
)
expect
(
json_response
[
"repository_path"
]).
to
be_nil
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"wiki-
#{
project
.
id
}
"
)
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"wiki-
#{
project
.
id
}
"
)
expect
(
user
).
to
have_an_activity_record
expect
(
user
).
to
have_an_activity_record
end
end
...
@@ -301,7 +301,7 @@ describe API::Internal do
...
@@ -301,7 +301,7 @@ describe API::Internal do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"repository_path"
]).
to
eq
(
project
.
repository
.
path_to_repo
)
expect
(
json_response
[
"repository_path"
]).
to
be_nil
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"project-
#{
project
.
id
}
"
)
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"project-
#{
project
.
id
}
"
)
expect
(
json_response
[
"gitaly"
]).
not_to
be_nil
expect
(
json_response
[
"gitaly"
]).
not_to
be_nil
expect
(
json_response
[
"gitaly"
][
"repository"
]).
not_to
be_nil
expect
(
json_response
[
"gitaly"
][
"repository"
]).
not_to
be_nil
...
@@ -320,7 +320,7 @@ describe API::Internal do
...
@@ -320,7 +320,7 @@ describe API::Internal do
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"status"
]).
to
be_truthy
expect
(
json_response
[
"repository_path"
]).
to
eq
(
project
.
repository
.
path_to_repo
)
expect
(
json_response
[
"repository_path"
]).
to
be_nil
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"project-
#{
project
.
id
}
"
)
expect
(
json_response
[
"gl_repository"
]).
to
eq
(
"project-
#{
project
.
id
}
"
)
expect
(
json_response
[
"gitaly"
]).
not_to
be_nil
expect
(
json_response
[
"gitaly"
]).
not_to
be_nil
expect
(
json_response
[
"gitaly"
][
"repository"
]).
not_to
be_nil
expect
(
json_response
[
"gitaly"
][
"repository"
]).
not_to
be_nil
...
...
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