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
1d138649
Commit
1d138649
authored
Feb 03, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve conflicts from ce/upstream
parent
178b0717
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
0 additions
and
168 deletions
+0
-168
app/models/upload.rb
app/models/upload.rb
+0
-4
app/uploaders/attachment_uploader.rb
app/uploaders/attachment_uploader.rb
+0
-10
app/uploaders/avatar_uploader.rb
app/uploaders/avatar_uploader.rb
+0
-9
app/uploaders/file_uploader.rb
app/uploaders/file_uploader.rb
+0
-28
app/uploaders/gitlab_uploader.rb
app/uploaders/gitlab_uploader.rb
+0
-10
app/uploaders/job_artifact_uploader.rb
app/uploaders/job_artifact_uploader.rb
+0
-3
app/uploaders/legacy_artifact_uploader.rb
app/uploaders/legacy_artifact_uploader.rb
+0
-3
app/uploaders/lfs_object_uploader.rb
app/uploaders/lfs_object_uploader.rb
+0
-3
app/uploaders/namespace_file_uploader.rb
app/uploaders/namespace_file_uploader.rb
+0
-7
app/uploaders/personal_file_uploader.rb
app/uploaders/personal_file_uploader.rb
+0
-6
config/gitlab.yml.example
config/gitlab.yml.example
+0
-5
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+0
-4
spec/controllers/projects/artifacts_controller_spec.rb
spec/controllers/projects/artifacts_controller_spec.rb
+0
-3
spec/controllers/projects/raw_controller_spec.rb
spec/controllers/projects/raw_controller_spec.rb
+0
-7
spec/factories/groups.rb
spec/factories/groups.rb
+0
-3
spec/uploaders/attachment_uploader_spec.rb
spec/uploaders/attachment_uploader_spec.rb
+0
-3
spec/uploaders/avatar_uploader_spec.rb
spec/uploaders/avatar_uploader_spec.rb
+0
-4
spec/uploaders/file_uploader_spec.rb
spec/uploaders/file_uploader_spec.rb
+0
-27
spec/uploaders/legacy_artifact_uploader_spec.rb
spec/uploaders/legacy_artifact_uploader_spec.rb
+0
-8
spec/uploaders/lfs_object_uploader_spec.rb
spec/uploaders/lfs_object_uploader_spec.rb
+0
-8
spec/uploaders/namespace_file_uploader_spec.rb
spec/uploaders/namespace_file_uploader_spec.rb
+0
-10
spec/uploaders/personal_file_uploader_spec.rb
spec/uploaders/personal_file_uploader_spec.rb
+0
-3
No files found.
app/models/upload.rb
View file @
1d138649
...
...
@@ -48,13 +48,9 @@ class Upload < ActiveRecord::Base
end
def
local?
<<<<<<<
HEAD
return
true
if
store
.
nil?
store
==
ObjectStorage
::
Store
::
LOCAL
=======
true
>>>>>>>
upstream
/
master
end
def
foreground_checksummable?
...
...
app/uploaders/attachment_uploader.rb
View file @
1d138649
class
AttachmentUploader
<
GitlabUploader
<<<<<<<
HEAD
include
RecordsUploads
::
Concern
include
ObjectStorage
::
Concern
prepend
ObjectStorage
::
Extension
::
RecordsUploads
=======
>>>>>>>
upstream
/
master
include
UploaderHelper
include
RecordsUploads
::
Concern
private
<<<<<<<
HEAD
=======
private
>>>>>>>
upstream
/
master
def
dynamic_segment
File
.
join
(
model
.
class
.
to_s
.
underscore
,
mounted_as
.
to_s
,
model
.
id
.
to_s
)
end
...
...
app/uploaders/avatar_uploader.rb
View file @
1d138649
class
AvatarUploader
<
GitlabUploader
include
UploaderHelper
include
RecordsUploads
::
Concern
<<<<<<<
HEAD
include
ObjectStorage
::
Concern
prepend
ObjectStorage
::
Extension
::
RecordsUploads
=======
storage
:file
>>>>>>>
upstream
/
master
def
exists?
model
.
avatar
.
file
&&
model
.
avatar
.
file
.
present?
end
<<<<<<<
HEAD
def
move_to_store
=======
def
move_to_cache
>>>>>>>
upstream
/
master
false
end
...
...
app/uploaders/file_uploader.rb
View file @
1d138649
...
...
@@ -9,28 +9,16 @@
class
FileUploader
<
GitlabUploader
include
UploaderHelper
include
RecordsUploads
::
Concern
<<<<<<<
HEAD
include
ObjectStorage
::
Concern
prepend
ObjectStorage
::
Extension
::
RecordsUploads
=======
>>>>>>>
upstream
/
master
MARKDOWN_PATTERN
=
%r{
\!
?
\[
.*?
\]\(
/uploads/(?<secret>[0-9a-f]{32})/(?<file>.*?)
\)
}
DYNAMIC_PATH_PATTERN
=
%r{(?<secret>
\h
{32})/(?<identifier>.*)}
attr_accessor
:model
def
self
.
root
File
.
join
(
options
.
storage_path
,
'uploads'
)
end
<<<<<<<
HEAD
=======
def
self
.
root
File
.
join
(
options
.
storage_path
,
'uploads'
)
end
>>>>>>>
upstream
/
master
def
self
.
absolute_path
(
upload
)
File
.
join
(
absolute_base_dir
(
upload
.
model
),
...
...
@@ -66,13 +54,6 @@ class FileUploader < GitlabUploader
def
self
.
upload_path
(
secret
,
identifier
)
File
.
join
(
secret
,
identifier
)
<<<<<<<
HEAD
end
def
self
.
generate_secret
SecureRandom
.
hex
end
=======
end
def
self
.
generate_secret
...
...
@@ -80,7 +61,6 @@ class FileUploader < GitlabUploader
end
attr_accessor
:model
>>>>>>>
upstream
/
master
def
initialize
(
model
,
secret
=
nil
)
@model
=
model
...
...
@@ -104,19 +84,11 @@ class FileUploader < GitlabUploader
def
model_path_segment
self
.
class
.
model_path_segment
(
@model
)
end
<<<<<<<
HEAD
def
store_dir
File
.
join
(
base_dir
,
dynamic_segment
)
end
=======
def
store_dir
File
.
join
(
base_dir
,
dynamic_segment
)
end
>>>>>>>
upstream
/
master
def
markdown_link
markdown
=
"[
#{
markdown_name
}
](
#{
secure_url
}
)"
markdown
.
prepend
(
"!"
)
if
image_or_video?
||
dangerous?
...
...
app/uploaders/gitlab_uploader.rb
View file @
1d138649
...
...
@@ -45,13 +45,10 @@ class GitlabUploader < CarrierWave::Uploader::Base
file
.
present?
end
<<<<<<<
HEAD
=======
def
store_dir
File
.
join
(
base_dir
,
dynamic_segment
)
end
>>>>>>>
upstream
/
master
def
cache_dir
File
.
join
(
root
,
base_dir
,
'tmp/cache'
)
end
...
...
@@ -69,13 +66,6 @@ class GitlabUploader < CarrierWave::Uploader::Base
# Designed to be overridden by child uploaders that have a dynamic path
# segment -- that is, a path that changes based on mutable attributes of its
# associated model
<<<<<<<
HEAD
#
# For example, `FileUploader` builds the storage path based on the associated
# project model's `path_with_namespace` value, which can change when the
# project or its containing namespace is moved or renamed.
=======
>>>>>>>
upstream
/
master
def
dynamic_segment
raise
(
NotImplementedError
)
end
...
...
app/uploaders/job_artifact_uploader.rb
View file @
1d138649
class
JobArtifactUploader
<
GitlabUploader
extend
Workhorse
::
UploadPath
<<<<<<<
HEAD
include
ObjectStorage
::
Concern
=======
>>>>>>>
upstream
/
master
storage_options
Gitlab
.
config
.
artifacts
...
...
app/uploaders/legacy_artifact_uploader.rb
View file @
1d138649
class
LegacyArtifactUploader
<
GitlabUploader
extend
Workhorse
::
UploadPath
<<<<<<<
HEAD
include
ObjectStorage
::
Concern
=======
>>>>>>>
upstream
/
master
storage_options
Gitlab
.
config
.
artifacts
...
...
app/uploaders/lfs_object_uploader.rb
View file @
1d138649
class
LfsObjectUploader
<
GitlabUploader
extend
Workhorse
::
UploadPath
<<<<<<<
HEAD
include
ObjectStorage
::
Concern
=======
>>>>>>>
upstream
/
master
# LfsObject are in `tmp/upload` instead of `tmp/uploads`
def
self
.
workhorse_upload_path
...
...
app/uploaders/namespace_file_uploader.rb
View file @
1d138649
...
...
@@ -11,7 +11,6 @@ class NamespaceFileUploader < FileUploader
def
self
.
model_path_segment
(
model
)
File
.
join
(
model
.
id
.
to_s
)
end
<<<<<<<
HEAD
# Re-Override
def
store_dir
...
...
@@ -23,11 +22,5 @@ class NamespaceFileUploader < FileUploader
Store
::
LOCAL
=>
File
.
join
(
base_dir
,
dynamic_segment
),
Store
::
REMOTE
=>
File
.
join
(
'namespace'
,
model_path_segment
,
dynamic_segment
)
}
=======
# Re-Override
def
store_dir
File
.
join
(
base_dir
,
dynamic_segment
)
>>>>>>>
upstream
/
master
end
end
app/uploaders/personal_file_uploader.rb
View file @
1d138649
...
...
@@ -14,7 +14,6 @@ class PersonalFileUploader < FileUploader
File
.
join
(
model
.
class
.
to_s
.
underscore
,
model
.
id
.
to_s
)
end
<<<<<<<
HEAD
def
object_store
return
Store
::
LOCAL
unless
model
...
...
@@ -31,11 +30,6 @@ class PersonalFileUploader < FileUploader
Store
::
LOCAL
=>
File
.
join
(
base_dir
,
dynamic_segment
),
Store
::
REMOTE
=>
File
.
join
(
model_path_segment
,
dynamic_segment
)
}
=======
# Revert-Override
def
store_dir
File
.
join
(
base_dir
,
dynamic_segment
)
>>>>>>>
upstream
/
master
end
private
...
...
config/gitlab.yml.example
View file @
1d138649
...
...
@@ -793,7 +793,6 @@ test:
region: eu-central-1
artifacts:
path: tmp/tests/artifacts
<<<<<<< HEAD
enabled: true
# The location where build artifacts are stored (default: shared/artifacts).
# path: shared/artifacts
...
...
@@ -816,10 +815,6 @@ test:
aws_access_key_id: AWS_ACCESS_KEY_ID
aws_secret_access_key: AWS_SECRET_ACCESS_KEY
region: eu-central-1
=======
uploads:
storage_path: tmp/tests/public
>>>>>>> upstream/master
gitlab:
host: localhost
port: 80
...
...
config/initializers/1_settings.rb
View file @
1d138649
...
...
@@ -346,16 +346,12 @@ Settings.artifacts['storage_path'] = Settings.absolute(Settings.artifacts.values
# Settings.artifact['path'] is deprecated, use `storage_path` instead
Settings
.
artifacts
[
'path'
]
=
Settings
.
artifacts
[
'storage_path'
]
Settings
.
artifacts
[
'max_size'
]
||=
100
# in megabytes
<<<<<<<
HEAD
Settings
.
artifacts
[
'object_store'
]
||=
Settingslogic
.
new
({})
Settings
.
artifacts
[
'object_store'
][
'enabled'
]
||=
false
Settings
.
artifacts
[
'object_store'
][
'remote_directory'
]
||=
nil
Settings
.
artifacts
[
'object_store'
][
'background_upload'
]
||=
true
# Convert upload connection settings to use string keys, to make Fog happy
Settings
.
artifacts
[
'object_store'
][
'connection'
]
&
.
deep_stringify_keys!
=======
>>>>>>>
upstream
/
master
#
# Registry
...
...
spec/controllers/projects/artifacts_controller_spec.rb
View file @
1d138649
...
...
@@ -145,10 +145,7 @@ describe Projects::ArtifactsController do
context
'when using local file storage'
do
it_behaves_like
'a valid file'
do
let
(
:job
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
<<<<<<<
HEAD
let
(
:store
)
{
ObjectStorage
::
Store
::
LOCAL
}
=======
>>>>>>>
upstream
/
master
let
(
:archive_path
)
{
JobArtifactUploader
.
root
}
end
end
...
...
spec/controllers/projects/raw_controller_spec.rb
View file @
1d138649
...
...
@@ -48,14 +48,7 @@ describe Projects::RawController do
it
'serves the file'
do
expect
(
controller
).
to
receive
(
:send_file
).
with
(
"
#{
LfsObjectUploader
.
root
}
/91/ef/f75a492a3ed0dfcb544d7f31326bc4014c8551849c192fd1e48d4dd2c897"
,
filename:
'lfs_object.iso'
,
disposition:
'attachment'
)
<<<<<<<
HEAD
get_show
(
public_project
,
id
)
=======
get
(
:show
,
namespace_id:
public_project
.
namespace
.
to_param
,
project_id:
public_project
,
id:
id
)
>>>>>>>
upstream
/
master
expect
(
response
).
to
have_gitlab_http_status
(
200
)
end
...
...
spec/factories/groups.rb
View file @
1d138649
...
...
@@ -20,7 +20,6 @@ FactoryBot.define do
trait
:with_avatar
do
avatar
{
fixture_file_upload
(
'spec/fixtures/dk.png'
)
}
<<<<<<<
HEAD
end
factory
:group_with_members
do
...
...
@@ -58,8 +57,6 @@ FactoryBot.define do
)
end
end
=======
>>>>>>>
upstream
/
master
end
trait
:access_requestable
do
...
...
spec/uploaders/attachment_uploader_spec.rb
View file @
1d138649
...
...
@@ -11,7 +11,6 @@ describe AttachmentUploader do
store_dir:
%r[uploads/-/system/note/attachment/]
,
upload_path:
%r[uploads/-/system/note/attachment/]
,
absolute_path:
%r[
#{
CarrierWave
.
root
}
/uploads/-/system/note/attachment/]
<<<<<<<
HEAD
# EE-specific
context
"object_store is REMOTE"
do
...
...
@@ -35,6 +34,4 @@ describe AttachmentUploader do
it_behaves_like
"migrates"
,
to_store:
described_class
::
Store
::
REMOTE
it_behaves_like
"migrates"
,
from_store:
described_class
::
Store
::
REMOTE
,
to_store:
described_class
::
Store
::
LOCAL
end
=======
>>>>>>>
upstream
/
master
end
spec/uploaders/avatar_uploader_spec.rb
View file @
1d138649
require
'spec_helper'
describe
AvatarUploader
do
<<<<<<<
HEAD
let
(
:model
)
{
build_stubbed
(
:user
)
}
=======
let
(
:model
)
{
create
(
:user
,
:with_avatar
)
}
>>>>>>>
upstream
/
master
let
(
:uploader
)
{
described_class
.
new
(
model
,
:avatar
)
}
let
(
:upload
)
{
create
(
:upload
,
model:
model
)
}
...
...
spec/uploaders/file_uploader_spec.rb
View file @
1d138649
...
...
@@ -29,7 +29,6 @@ describe FileUploader do
context
'when only repositories are rolled out'
do
let
(
:project
)
{
build_stubbed
(
:project
,
namespace:
group
,
name:
'project'
,
storage_version:
Project
::
HASHED_STORAGE_FEATURES
[
:repository
])
}
<<<<<<<
HEAD
it_behaves_like
'builds correct legacy storage paths'
end
...
...
@@ -75,31 +74,5 @@ describe FileUploader do
it_behaves_like
"migrates"
,
to_store:
described_class
::
Store
::
REMOTE
it_behaves_like
"migrates"
,
from_store:
described_class
::
Store
::
REMOTE
,
to_store:
described_class
::
Store
::
LOCAL
=======
it_behaves_like
'builds correct legacy storage paths'
end
end
context
'legacy storage'
do
it_behaves_like
'builds correct legacy storage paths'
include_examples
'uses hashed storage'
end
describe
'initialize'
do
let
(
:uploader
)
{
described_class
.
new
(
double
,
'secret'
)
}
it
'accepts a secret parameter'
do
expect
(
described_class
).
not_to
receive
(
:generate_secret
)
expect
(
uploader
.
secret
).
to
eq
(
'secret'
)
end
end
describe
'#secret'
do
it
'generates a secret if none is provided'
do
expect
(
described_class
).
to
receive
(
:generate_secret
).
and_return
(
'secret'
)
expect
(
uploader
.
secret
).
to
eq
(
'secret'
)
end
>>>>>>>
upstream
/
master
end
end
spec/uploaders/legacy_artifact_uploader_spec.rb
View file @
1d138649
...
...
@@ -15,7 +15,6 @@ describe LegacyArtifactUploader do
it
{
is_expected
.
to
start_with
(
local_path
)
}
it
{
is_expected
.
to
end_with
(
'tmp/uploads'
)
}
end
<<<<<<<
HEAD
it_behaves_like
"builds correct paths"
,
store_dir:
%r[
\d
{4}_
\d
{1,2}/
\d
+/
\d
+
\z
]
,
...
...
@@ -32,13 +31,6 @@ describe LegacyArtifactUploader do
it_behaves_like
"builds correct paths"
,
store_dir:
%r[
\d
{4}_
\d
{1,2}/
\d
+/
\d
+
\z
]
end
=======
it_behaves_like
"builds correct paths"
,
store_dir:
%r[
\d
{4}_
\d
{1,2}/
\d
+/
\d
+
\z
]
,
cache_dir:
%r[artifacts/tmp/cache]
,
work_dir:
%r[artifacts/tmp/work]
>>>>>>>
upstream
/
master
describe
'#filename'
do
# we need to use uploader, as this makes to use mounter
...
...
spec/uploaders/lfs_object_uploader_spec.rb
View file @
1d138649
...
...
@@ -6,7 +6,6 @@ describe LfsObjectUploader do
let
(
:path
)
{
Gitlab
.
config
.
lfs
.
storage_path
}
subject
{
uploader
}
<<<<<<<
HEAD
it_behaves_like
"builds correct paths"
,
store_dir:
%r[
\h
{2}/
\h
{2}]
,
...
...
@@ -92,11 +91,4 @@ describe LfsObjectUploader do
lfs_object
.
file
=
fixture_file_upload
(
Rails
.
root
.
join
(
"spec/fixtures/dk.png"
),
"`/png"
)
lfs_object
.
save!
end
=======
it_behaves_like
"builds correct paths"
,
store_dir:
%r[
\h
{2}/
\h
{2}]
,
cache_dir:
%r[/lfs-objects/tmp/cache]
,
work_dir:
%r[/lfs-objects/tmp/work]
>>>>>>>
upstream
/
master
end
spec/uploaders/namespace_file_uploader_spec.rb
View file @
1d138649
...
...
@@ -6,7 +6,6 @@ describe NamespaceFileUploader do
let
(
:group
)
{
build_stubbed
(
:group
)
}
let
(
:uploader
)
{
described_class
.
new
(
group
)
}
let
(
:upload
)
{
create
(
:upload
,
:namespace_upload
,
model:
group
)
}
<<<<<<<
HEAD
subject
{
uploader
}
...
...
@@ -37,13 +36,4 @@ describe NamespaceFileUploader do
it_behaves_like
"migrates"
,
to_store:
described_class
::
Store
::
REMOTE
it_behaves_like
"migrates"
,
from_store:
described_class
::
Store
::
REMOTE
,
to_store:
described_class
::
Store
::
LOCAL
end
=======
subject
{
uploader
}
it_behaves_like
'builds correct paths'
,
store_dir:
%r[uploads/-/system/namespace/
\d
+]
,
upload_path:
IDENTIFIER
,
absolute_path:
%r[
#{
CarrierWave
.
root
}
/uploads/-/system/namespace/
\d
+/
#{
IDENTIFIER
}
]
>>>>>>>
upstream
/
master
end
spec/uploaders/personal_file_uploader_spec.rb
View file @
1d138649
...
...
@@ -13,7 +13,6 @@ describe PersonalFileUploader do
store_dir:
%r[uploads/-/system/personal_snippet/
\d
+]
,
upload_path:
IDENTIFIER
,
absolute_path:
%r[
#{
CarrierWave
.
root
}
/uploads/-/system/personal_snippet/
\d
+/
#{
IDENTIFIER
}
]
<<<<<<<
HEAD
# EE-specific
context
"object_store is REMOTE"
do
...
...
@@ -27,8 +26,6 @@ describe PersonalFileUploader do
store_dir:
%r[
\d
+/
\h
+]
,
upload_path:
IDENTIFIER
end
=======
>>>>>>>
upstream
/
master
describe
'#to_h'
do
before
do
...
...
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