diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-01-28 18:03:22 +0300 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-02-06 09:50:08 +0300 |
commit | abc64da90cc4341607b48c09b0920296b5fb9663 (patch) | |
tree | 5c781efd1d3e119bd3c702b7213527c0776d39b6 | |
parent | 62e257f53ac801b5f30c84f3cb8ed359d7350826 (diff) |
Rename CreateArtifactsTraceService to CreateTraceArtifactService
-rw-r--r-- | app/services/ci/create_artifacts_trace_service.rb | 16 | ||||
-rw-r--r-- | app/services/ci/create_trace_artifact_service.rb | 14 | ||||
-rw-r--r-- | app/workers/build_finished_worker.rb | 2 | ||||
-rw-r--r-- | app/workers/create_artifacts_trace_worker.rb | 8 | ||||
-rw-r--r-- | app/workers/create_trace_artifact_worker.rb | 10 | ||||
-rw-r--r-- | lib/gitlab/ci/trace.rb | 8 |
6 files changed, 25 insertions, 33 deletions
diff --git a/app/services/ci/create_artifacts_trace_service.rb b/app/services/ci/create_artifacts_trace_service.rb deleted file mode 100644 index eefc2ae13ea..00000000000 --- a/app/services/ci/create_artifacts_trace_service.rb +++ /dev/null @@ -1,16 +0,0 @@ -module Ci - class CreateArtifactsTraceService < BaseService - def execute(job_id) - Ci::Build.find_by(id: job_id).try do |job| - return if job.job_artifacts_trace - - job.trace.read do |stream| - job.create_job_artifacts_trace!( - project: job.project, - file_type: :trace, - file: stream.path) if stream.file? - end - end - end - end -end diff --git a/app/services/ci/create_trace_artifact_service.rb b/app/services/ci/create_trace_artifact_service.rb new file mode 100644 index 00000000000..80e41856719 --- /dev/null +++ b/app/services/ci/create_trace_artifact_service.rb @@ -0,0 +1,14 @@ +module Ci + class CreateTraceArtifactService < BaseService + def execute(job) + return if job.job_artifacts_trace + + job.trace.read do |stream| + job.create_job_artifacts_trace!( + project: job.project, + file_type: :trace, + file: stream.path) if stream.file? + end + end + end +end diff --git a/app/workers/build_finished_worker.rb b/app/workers/build_finished_worker.rb index 842ab7bbbe4..d5a4b6c1553 100644 --- a/app/workers/build_finished_worker.rb +++ b/app/workers/build_finished_worker.rb @@ -7,7 +7,7 @@ class BuildFinishedWorker def perform(build_id) Ci::Build.find_by(id: build_id).try do |build| BuildTraceSectionsWorker.perform_async(build.id) - CreateArtifactsTraceWorker.perform_async(build.id) + CreateTraceArtifactWorker.perform_async(build.id) BuildCoverageWorker.new.perform(build.id) BuildHooksWorker.new.perform(build.id) end diff --git a/app/workers/create_artifacts_trace_worker.rb b/app/workers/create_artifacts_trace_worker.rb deleted file mode 100644 index d73951b0905..00000000000 --- a/app/workers/create_artifacts_trace_worker.rb +++ /dev/null @@ -1,8 +0,0 @@ -class CreateArtifactsTraceWorker - include ApplicationWorker - include PipelineQueue - - def perform(job_id) - Ci::CreateArtifactsTraceService.new.execute(job_id) - end -end diff --git a/app/workers/create_trace_artifact_worker.rb b/app/workers/create_trace_artifact_worker.rb new file mode 100644 index 00000000000..40d8a086cfb --- /dev/null +++ b/app/workers/create_trace_artifact_worker.rb @@ -0,0 +1,10 @@ +class CreateTraceArtifactWorker + include ApplicationWorker + include PipelineQueue + + def perform(job_id) + Ci::Build.find_by(id: job_id).try do |job| + Ci::CreateTraceArtifactService.new.execute(job) + end + end +end diff --git a/lib/gitlab/ci/trace.rb b/lib/gitlab/ci/trace.rb index 3d093a7f135..f2e5124c8a8 100644 --- a/lib/gitlab/ci/trace.rb +++ b/lib/gitlab/ci/trace.rb @@ -1,11 +1,3 @@ -## -# Current status of paths -# Era 1: Live/Full traces in database (ci_builds.trace) -# Era 2: Live/Full traces in `setting_root/YYYY_MM/project_ci_id/job_id.log` -# Era 3: Live/Full traces in `setting_root/YYYY_MM/project_id/job_id.log` -# Era 4: Live traces in `setting_root/YYYY_MM/project_id/job_id.log`. Full traces in JobArtifactUploader#default_path(FileStorage/ObjectStorage). -# -# The legacy paths are to be migrated to the latest era. module Gitlab module Ci class Trace |