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
4804b612
Commit
4804b612
authored
Mar 07, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ObjectStore to RemoteObject
parent
1b494305
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
ee/app/uploaders/object_storage.rb
ee/app/uploaders/object_storage.rb
+2
-2
ee/spec/uploaders/object_storage_spec.rb
ee/spec/uploaders/object_storage_spec.rb
+15
-15
spec/requests/lfs_http_spec.rb
spec/requests/lfs_http_spec.rb
+5
-5
No files found.
ee/app/uploaders/object_storage.rb
View file @
4804b612
...
...
@@ -153,7 +153,7 @@ module ObjectStorage
def
workhorse_authorize
if
options
=
workhorse_remote_upload_options
{
Object
Store
:
options
}
{
Remote
Store
:
options
}
else
{
TempPath
:
workhorse_local_upload_path
}
end
...
...
@@ -174,7 +174,7 @@ module ObjectStorage
options
=
{
'Content-Type'
=>
'application/octet-stream'
}
{
Object
ID
:
id
,
ID
:
id
,
GetURL
:
connection
.
get_object_https_url
(
remote_store_path
,
upload_path
,
expire_at
),
DeleteURL
:
connection
.
delete_object_url
(
remote_store_path
,
upload_path
,
expire_at
),
StoreURL
:
connection
.
put_object_url
(
remote_store_path
,
upload_path
,
expire_at
,
options
)
...
...
ee/spec/uploaders/object_storage_spec.rb
View file @
4804b612
...
...
@@ -401,21 +401,21 @@ describe ObjectStorage do
end
it
"does not return remote store"
do
is_expected
.
not_to
have_key
(
'
Object
Store'
)
is_expected
.
not_to
have_key
(
'
Remote
Store'
)
end
end
shared_examples
'uses remote storage'
do
it
"returns remote store"
do
is_expected
.
to
have_key
(
:
Object
Store
)
is_expected
.
to
have_key
(
:
Remote
Store
)
expect
(
subject
[
:
ObjectStore
]).
to
have_key
(
:Object
ID
)
expect
(
subject
[
:
Object
Store
]).
to
have_key
(
:GetURL
)
expect
(
subject
[
:
Object
Store
]).
to
have_key
(
:DeleteURL
)
expect
(
subject
[
:
Object
Store
]).
to
have_key
(
:StoreURL
)
expect
(
subject
[
:
Object
Store
][
:GetURL
]).
to
include
(
described_class
::
TMP_UPLOAD_PATH
)
expect
(
subject
[
:
Object
Store
][
:DeleteURL
]).
to
include
(
described_class
::
TMP_UPLOAD_PATH
)
expect
(
subject
[
:
Object
Store
][
:StoreURL
]).
to
include
(
described_class
::
TMP_UPLOAD_PATH
)
expect
(
subject
[
:
RemoteStore
]).
to
have_key
(
:
ID
)
expect
(
subject
[
:
Remote
Store
]).
to
have_key
(
:GetURL
)
expect
(
subject
[
:
Remote
Store
]).
to
have_key
(
:DeleteURL
)
expect
(
subject
[
:
Remote
Store
]).
to
have_key
(
:StoreURL
)
expect
(
subject
[
:
Remote
Store
][
:GetURL
]).
to
include
(
described_class
::
TMP_UPLOAD_PATH
)
expect
(
subject
[
:
Remote
Store
][
:DeleteURL
]).
to
include
(
described_class
::
TMP_UPLOAD_PATH
)
expect
(
subject
[
:
Remote
Store
][
:StoreURL
]).
to
include
(
described_class
::
TMP_UPLOAD_PATH
)
end
it
"does not return local store"
do
...
...
@@ -455,9 +455,9 @@ describe ObjectStorage do
let
(
:storage_url
)
{
"https://uploads.s3-eu-central-1.amazonaws.com/"
}
it
'returns links for S3'
do
expect
(
subject
[
:
Object
Store
][
:GetURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Object
Store
][
:DeleteURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Object
Store
][
:StoreURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Remote
Store
][
:GetURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Remote
Store
][
:DeleteURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Remote
Store
][
:StoreURL
]).
to
start_with
(
storage_url
)
end
end
end
...
...
@@ -475,9 +475,9 @@ describe ObjectStorage do
let
(
:storage_url
)
{
"https://storage.googleapis.com/uploads/"
}
it
'returns links for Google Cloud'
do
expect
(
subject
[
:
Object
Store
][
:GetURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Object
Store
][
:DeleteURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Object
Store
][
:StoreURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Remote
Store
][
:GetURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Remote
Store
][
:DeleteURL
]).
to
start_with
(
storage_url
)
expect
(
subject
[
:
Remote
Store
][
:StoreURL
]).
to
start_with
(
storage_url
)
end
end
end
...
...
spec/requests/lfs_http_spec.rb
View file @
4804b612
...
...
@@ -1008,7 +1008,7 @@ describe 'Git LFS API and storage' do
it_behaves_like
'a valid response'
do
it
'responds with status 200, location of lfs store and object details'
do
expect
(
json_response
[
'TempPath'
]).
to
eq
(
LfsObjectUploader
.
workhorse_local_upload_path
)
expect
(
json_response
[
'
Object
Store'
]).
to
be_nil
expect
(
json_response
[
'
Remote
Store'
]).
to
be_nil
expect
(
json_response
[
'LfsOid'
]).
to
eq
(
sample_oid
)
expect
(
json_response
[
'LfsSize'
]).
to
eq
(
sample_size
)
end
...
...
@@ -1028,10 +1028,10 @@ describe 'Git LFS API and storage' do
it_behaves_like
'a valid response'
do
it
'responds with status 200, location of lfs remote store and object details'
do
expect
(
json_response
[
'TempPath'
]).
to
be_nil
expect
(
json_response
[
'
ObjectStore'
]).
to
have_key
(
'Object
ID'
)
expect
(
json_response
[
'
Object
Store'
]).
to
have_key
(
'GetURL'
)
expect
(
json_response
[
'
Object
Store'
]).
to
have_key
(
'StoreURL'
)
expect
(
json_response
[
'
Object
Store'
]).
to
have_key
(
'DeleteURL'
)
expect
(
json_response
[
'
RemoteStore'
]).
to
have_key
(
'
ID'
)
expect
(
json_response
[
'
Remote
Store'
]).
to
have_key
(
'GetURL'
)
expect
(
json_response
[
'
Remote
Store'
]).
to
have_key
(
'StoreURL'
)
expect
(
json_response
[
'
Remote
Store'
]).
to
have_key
(
'DeleteURL'
)
expect
(
json_response
[
'LfsOid'
]).
to
eq
(
sample_oid
)
expect
(
json_response
[
'LfsSize'
]).
to
eq
(
sample_size
)
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