Fix bunch of texts
This commit is contained in:
parent
3b97710c17
commit
7297a06cb6
|
@ -9,3 +9,4 @@ lib/gitlab/gitaly_client/operation_service.rb
|
||||||
lib/gitlab/background_migration/*
|
lib/gitlab/background_migration/*
|
||||||
app/models/project_services/kubernetes_service.rb
|
app/models/project_services/kubernetes_service.rb
|
||||||
lib/gitlab/workhorse.rb
|
lib/gitlab/workhorse.rb
|
||||||
|
lib/gitlab/ci/trace/chunked_io.rb
|
||||||
|
|
|
@ -128,7 +128,7 @@ class Projects::JobsController < Projects::ApplicationController
|
||||||
if stream.file?
|
if stream.file?
|
||||||
send_file stream.path, type: 'text/plain; charset=utf-8', disposition: 'inline'
|
send_file stream.path, type: 'text/plain; charset=utf-8', disposition: 'inline'
|
||||||
else
|
else
|
||||||
render_404
|
send_data stream.raw, type: 'text/plain; charset=utf-8', disposition: 'inline'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -113,8 +113,6 @@ module Gitlab
|
||||||
end
|
end
|
||||||
|
|
||||||
def write(data)
|
def write(data)
|
||||||
raise 'Could not write empty data' unless data.present?
|
|
||||||
|
|
||||||
start_pos = tell
|
start_pos = tell
|
||||||
data = data.force_encoding(Encoding::BINARY)
|
data = data.force_encoding(Encoding::BINARY)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ module Gitlab
|
||||||
|
|
||||||
attr_reader :stream
|
attr_reader :stream
|
||||||
|
|
||||||
delegate :close, :tell, :seek, :size, :path, :url, :truncate, to: :stream, allow_nil: true
|
delegate :close, :tell, :seek, :size, :url, :truncate, to: :stream, allow_nil: true
|
||||||
|
|
||||||
delegate :valid?, to: :stream, as: :present?, allow_nil: true
|
delegate :valid?, to: :stream, as: :present?, allow_nil: true
|
||||||
|
|
||||||
|
@ -25,6 +25,10 @@ module Gitlab
|
||||||
self.path.present?
|
self.path.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def file?
|
||||||
|
self.path if self.stream.respond_to?(:path)
|
||||||
|
end
|
||||||
|
|
||||||
def limit(last_bytes = LIMIT_SIZE)
|
def limit(last_bytes = LIMIT_SIZE)
|
||||||
if last_bytes < size
|
if last_bytes < size
|
||||||
stream.seek(-last_bytes, IO::SEEK_END)
|
stream.seek(-last_bytes, IO::SEEK_END)
|
||||||
|
|
|
@ -15,8 +15,6 @@ feature 'Jobs', :clean_gitlab_redis_shared_state do
|
||||||
end
|
end
|
||||||
|
|
||||||
before do
|
before do
|
||||||
stub_feature_flags(ci_enable_live_trace: true)
|
|
||||||
|
|
||||||
project.add_role(user, user_access_level)
|
project.add_role(user, user_access_level)
|
||||||
sign_in(user)
|
sign_in(user)
|
||||||
end
|
end
|
||||||
|
@ -537,44 +535,6 @@ feature 'Jobs', :clean_gitlab_redis_shared_state do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'storage form' do
|
|
||||||
let(:existing_file) { Tempfile.new('existing-trace-file').path }
|
|
||||||
|
|
||||||
before do
|
|
||||||
job.run!
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when job has trace in file', :js do
|
|
||||||
before do
|
|
||||||
allow_any_instance_of(Gitlab::Ci::Trace)
|
|
||||||
.to receive(:paths)
|
|
||||||
.and_return([existing_file])
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'sends the right headers' do
|
|
||||||
requests = inspect_requests(inject_headers: { 'X-Sendfile-Type' => 'X-Sendfile' }) do
|
|
||||||
visit raw_project_job_path(project, job)
|
|
||||||
end
|
|
||||||
expect(requests.first.response_headers['Content-Type']).to eq('text/plain; charset=utf-8')
|
|
||||||
expect(requests.first.response_headers['X-Sendfile']).to eq(existing_file)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when job has trace in the database', :js do
|
|
||||||
before do
|
|
||||||
allow_any_instance_of(Gitlab::Ci::Trace)
|
|
||||||
.to receive(:paths)
|
|
||||||
.and_return([])
|
|
||||||
|
|
||||||
visit project_job_path(project, job)
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'sends the right headers' do
|
|
||||||
expect(page).not_to have_selector('.js-raw-link-controller')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context "when visiting old URL" do
|
context "when visiting old URL" do
|
||||||
let(:raw_job_url) do
|
let(:raw_job_url) do
|
||||||
raw_project_job_path(project, job)
|
raw_project_job_path(project, job)
|
||||||
|
|
|
@ -298,14 +298,6 @@ describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
|
||||||
|
|
||||||
it_behaves_like 'writes a trace'
|
it_behaves_like 'writes a trace'
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when data is nil' do
|
|
||||||
let(:data) { nil }
|
|
||||||
|
|
||||||
it 'writes a trace' do
|
|
||||||
expect { subject } .to raise_error('Could not write empty data')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when data already exists' do
|
context 'when data already exists' do
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe API::Runner do
|
describe API::Runner, :clean_gitlab_redis_shared_state do
|
||||||
include StubGitlabCalls
|
include StubGitlabCalls
|
||||||
|
|
||||||
let(:registration_token) { 'abcdefg123456' }
|
let(:registration_token) { 'abcdefg123456' }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
stub_feature_flags(ci_enable_live_trace: true)
|
||||||
stub_gitlab_calls
|
stub_gitlab_calls
|
||||||
stub_application_setting(runners_registration_token: registration_token)
|
stub_application_setting(runners_registration_token: registration_token)
|
||||||
allow_any_instance_of(Ci::Runner).to receive(:cache_attributes)
|
allow_any_instance_of(Ci::Runner).to receive(:cache_attributes)
|
||||||
|
|
Loading…
Reference in New Issue