Commit b0eebb17 authored by Shinya Maeda's avatar Shinya Maeda

Fix static analysys

parent 1f398679
......@@ -4,10 +4,12 @@ module Ci
return if job.job_artifacts_trace
job.trace.read do |stream|
if stream.file?
job.create_job_artifacts_trace!(
project: job.project,
file_type: :trace,
file: stream) if stream.file?
file: stream)
end
end
end
end
......
......@@ -18,7 +18,7 @@ class JobArtifactUploader < GitlabUploader
if file_storage?
File.open(path, "rb") if path
else
Gitlab::Ci::Trace::HTTP_IO.new(url, size)
Gitlab::Ci::Trace::HttpIO.new(url, size)
end
end
......
......@@ -4,7 +4,7 @@
module Gitlab
module Ci
class Trace
class HTTP_IO
class HttpIO
BUFFER_SIZE = 128.kilobytes
attr_reader :uri, :size
......@@ -30,7 +30,7 @@ module Gitlab
@uri.to_s
end
def seek(pos, where=IO::SEEK_SET)
def seek(pos, where = IO::SEEK_SET)
new_pos =
case where
when IO::SEEK_END
......@@ -53,7 +53,7 @@ module Gitlab
end
def each_line
while !eof? do
loop !eof? do
line = readline
yield(line)
end
......@@ -65,6 +65,7 @@ module Gitlab
while length.nil? || out.length < length
data = get_chunk
break if data.empty?
out += data
@tell += data.bytesize
end
......@@ -80,13 +81,13 @@ module Gitlab
def readline
out = ""
while !eof? do
loop !eof? do
data = get_chunk
new_line = data.index("\n")
if !new_line.nil?
out += data[0..new_line]
@tell += new_line+1
@tell += new_line + 1
break
else
out += data
......@@ -132,7 +133,7 @@ module Gitlab
@chunk_range = response.content_range
end
@chunk[chunk_offset .. BUFFER_SIZE]
@chunk[chunk_offset..BUFFER_SIZE]
end
def request
......
......@@ -17,7 +17,8 @@ describe Ci::RetryBuildService do
%i[id status user token coverage trace runner artifacts_expire_at
artifacts_file artifacts_metadata artifacts_size created_at
updated_at started_at finished_at queued_at erased_by
erased_at auto_canceled_by job_artifacts job_artifacts_archive job_artifacts_metadata].freeze
erased_at auto_canceled_by job_artifacts job_artifacts_archive
job_artifacts_metadata job_artifacts_trace].freeze
IGNORE_ACCESSORS =
%i[type lock_version target_url base_tags trace_sections
......
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