diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-02 00:30:31 +0300 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-02 00:30:31 +0300 |
commit | 0d458b96e8349a50877ebd55932bf806e93caa21 (patch) | |
tree | 8a95f619a28606c7653beb524ace295d3c254c20 /app | |
parent | 0e732fa466c4d1c48163472b268dded18cc39407 (diff) |
remove geo specific code
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/jobs_controller.rb | 32 | ||||
-rw-r--r-- | app/models/lfs_object.rb | 2 | ||||
-rw-r--r-- | app/uploaders/job_artifact_uploader.rb | 1 |
3 files changed, 25 insertions, 10 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb index 8041bdbb0bd..abf4be6250b 100644 --- a/app/controllers/projects/jobs_controller.rb +++ b/app/controllers/projects/jobs_controller.rb @@ -1,6 +1,4 @@ class Projects::JobsController < Projects::ApplicationController - prepend EE::Projects::JobsController - before_action :build, except: [:index, :cancel_all] before_action :authorize_read_build!, @@ -119,11 +117,17 @@ class Projects::JobsController < Projects::ApplicationController end def raw - build.trace.read do |stream| - if stream.file? - send_file stream.path, type: 'text/plain; charset=utf-8', disposition: 'inline' - else - render_404 + if trace_artifact_file + send_upload(trace_artifact_file, + send_params: raw_send_params, + redirect_params: raw_redirect_params) + else + build.trace.read do |stream| + if stream.file? + send_file stream.path, type: 'text/plain; charset=utf-8', disposition: 'inline' + else + render_404 + end end end end @@ -138,9 +142,21 @@ class Projects::JobsController < Projects::ApplicationController return access_denied! unless can?(current_user, :erase_build, build) end + def raw_send_params + { type: 'text/plain; charset=utf-8', disposition: 'inline' } + end + + def raw_redirect_params + { query: { 'response-content-type' => 'text/plain; charset=utf-8', 'response-content-disposition' => 'inline' } } + end + + def trace_artifact_file + @trace_artifact_file ||= build.job_artifacts_trace&.file + end + def build @build ||= project.builds.find(params[:id]) - .present(current_user: current_user) + .present(current_user: current_user) end def build_path(build) diff --git a/app/models/lfs_object.rb b/app/models/lfs_object.rb index 04c75d827e0..54840fb084d 100644 --- a/app/models/lfs_object.rb +++ b/app/models/lfs_object.rb @@ -15,7 +15,7 @@ class LfsObject < ActiveRecord::Base after_save if: :file_changed?, on: [:create, :update] do run_after_commit do - file.schedule_migration_to_object_storage + file.schedule_background_upload end end diff --git a/app/uploaders/job_artifact_uploader.rb b/app/uploaders/job_artifact_uploader.rb index d80221144b4..06842a58571 100644 --- a/app/uploaders/job_artifact_uploader.rb +++ b/app/uploaders/job_artifact_uploader.rb @@ -1,5 +1,4 @@ class JobArtifactUploader < GitlabUploader - prepend EE::JobArtifactUploader extend Workhorse::UploadPath include ObjectStorage::Concern |