Commit abc64da9 authored by Shinya Maeda's avatar Shinya Maeda

Rename CreateArtifactsTraceService to CreateTraceArtifactService

parent 62e257f5
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
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
...@@ -7,7 +7,7 @@ class BuildFinishedWorker ...@@ -7,7 +7,7 @@ class BuildFinishedWorker
def perform(build_id) def perform(build_id)
Ci::Build.find_by(id: build_id).try do |build| Ci::Build.find_by(id: build_id).try do |build|
BuildTraceSectionsWorker.perform_async(build.id) BuildTraceSectionsWorker.perform_async(build.id)
CreateArtifactsTraceWorker.perform_async(build.id) CreateTraceArtifactWorker.perform_async(build.id)
BuildCoverageWorker.new.perform(build.id) BuildCoverageWorker.new.perform(build.id)
BuildHooksWorker.new.perform(build.id) BuildHooksWorker.new.perform(build.id)
end end
......
class CreateArtifactsTraceWorker class CreateTraceArtifactWorker
include ApplicationWorker include ApplicationWorker
include PipelineQueue include PipelineQueue
def perform(job_id) def perform(job_id)
Ci::CreateArtifactsTraceService.new.execute(job_id) Ci::Build.find_by(id: job_id).try do |job|
Ci::CreateTraceArtifactService.new.execute(job)
end
end end
end end
##
# 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 Gitlab
module Ci module Ci
class Trace class Trace
......
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