Commit a5d69905 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Rename `Replication::*Uploader` to Retriever to remove ambiguity

We use the term Uploader in our code base to refer to Carrierwave
uploader, by switch the term here to a different one we remove this
ambiguity.
parent 80f745f5
...@@ -37,9 +37,9 @@ module Geo ...@@ -37,9 +37,9 @@ module Geo
end end
def uploader_klass def uploader_klass
return Gitlab::Geo::Replication::FileUploader if user_upload? return Gitlab::Geo::Replication::FileRetriever if user_upload?
return Gitlab::Geo::Replication::JobArtifactUploader if job_artifact? return Gitlab::Geo::Replication::JobArtifactRetriever if job_artifact?
return Gitlab::Geo::Replication::LfsUploader if lfs? return Gitlab::Geo::Replication::LfsRetriever if lfs?
error_message = "Cannot find a Gitlab::Geo Uploader for object_type = '#{object_type}'" error_message = "Cannot find a Gitlab::Geo Uploader for object_type = '#{object_type}'"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module Geo module Geo
module Replication module Replication
class BaseUploader class BaseRetriever
include LogHelpers include LogHelpers
attr_reader :object_db_id, :message attr_reader :object_db_id, :message
......
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
# * Finding an Upload record # * Finding an Upload record
# * Returning the necessary response data to send the file back # * Returning the necessary response data to send the file back
# #
class FileUploader < BaseUploader class FileRetriever < BaseRetriever
def execute def execute
recorded_file = fetch_resource recorded_file = fetch_resource
......
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
# * Finding an ::Ci::JobArtifact record # * Finding an ::Ci::JobArtifact record
# * Returning the necessary response data to send the file back # * Returning the necessary response data to send the file back
# #
class JobArtifactUploader < BaseUploader class JobArtifactRetriever < BaseRetriever
def execute def execute
job_artifact = fetch_resource job_artifact = fetch_resource
......
...@@ -7,7 +7,7 @@ module Gitlab ...@@ -7,7 +7,7 @@ module Gitlab
# * Finding an LfsObject record # * Finding an LfsObject record
# * Returning the necessary response data to send the file back # * Returning the necessary response data to send the file back
# #
class LfsUploader < BaseUploader class LfsRetriever < BaseRetriever
def execute def execute
lfs_object = fetch_resource lfs_object = fetch_resource
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Geo::Replication::FileUploader, :geo do describe Gitlab::Geo::Replication::FileRetriever, :geo do
shared_examples_for 'returns necessary params for sending a file from an API endpoint' do shared_examples_for 'returns necessary params for sending a file from an API endpoint' do
subject { @subject ||= uploader.execute } subject { @subject ||= uploader.execute }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Geo::Replication::JobArtifactUploader, :geo do describe Gitlab::Geo::Replication::JobArtifactRetriever, :geo do
context '#execute' do context '#execute' do
let(:uploader) { described_class.new(job_artifact.id, {}) } let(:uploader) { described_class.new(job_artifact.id, {}) }
subject { uploader.execute } subject { uploader.execute }
......
require 'spec_helper' require 'spec_helper'
describe Gitlab::Geo::Replication::LfsUploader, :geo do describe Gitlab::Geo::Replication::LfsRetriever, :geo do
context '#execute' do context '#execute' do
subject { uploader.execute } subject { uploader.execute }
......
...@@ -17,20 +17,20 @@ describe Geo::FileUploadService do ...@@ -17,20 +17,20 @@ describe Geo::FileUploadService do
it "returns a FileUploader given type is #{file_type}" do it "returns a FileUploader given type is #{file_type}" do
subject = described_class.new({ type: file_type, id: 1 }, 'request-data') subject = described_class.new({ type: file_type, id: 1 }, 'request-data')
expect(subject.uploader).to be_a(Gitlab::Geo::Replication::FileUploader) expect(subject.uploader).to be_a(Gitlab::Geo::Replication::FileRetriever)
end end
end end
it "returns a LfsUploader given object_type is lfs" do it "returns a LfsUploader given object_type is lfs" do
subject = described_class.new({ type: 'lfs', id: 1 }, 'request-data') subject = described_class.new({ type: 'lfs', id: 1 }, 'request-data')
expect(subject.uploader).to be_a(Gitlab::Geo::Replication::LfsUploader) expect(subject.uploader).to be_a(Gitlab::Geo::Replication::LfsRetriever)
end end
it "returns a JobArtifactUploader given object_type is job_artifact" do it "returns a JobArtifactUploader given object_type is job_artifact" do
subject = described_class.new({ type: 'job_artifact', id: 1 }, 'request-data') subject = described_class.new({ type: 'job_artifact', id: 1 }, 'request-data')
expect(subject.uploader).to be_a(Gitlab::Geo::Replication::JobArtifactUploader) expect(subject.uploader).to be_a(Gitlab::Geo::Replication::JobArtifactRetriever)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment