Commit 0bc27b59 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'sh-remove-ci-job-trace-force-encode-ff' into 'master'

Remove ci_job_trace_force_encode feature flag

See merge request gitlab-org/gitlab!69229
parents 17d1b707 a8aec1f6
...@@ -80,12 +80,10 @@ module Ci ...@@ -80,12 +80,10 @@ module Ci
private private
def append_strings(old_data, new_data) def append_strings(old_data, new_data)
if Feature.enabled?(:ci_job_trace_force_encode, default_enabled: :yaml)
# When object storage is in use, old_data may be retrieved in UTF-8. # When object storage is in use, old_data may be retrieved in UTF-8.
old_data = old_data.force_encoding(Encoding::ASCII_8BIT) old_data = old_data.force_encoding(Encoding::ASCII_8BIT)
# new_data should already be in ASCII-8BIT, but just in case it isn't, do this. # new_data should already be in ASCII-8BIT, but just in case it isn't, do this.
new_data = new_data.force_encoding(Encoding::ASCII_8BIT) new_data = new_data.force_encoding(Encoding::ASCII_8BIT)
end
old_data + new_data old_data + new_data
end end
......
---
name: ci_job_trace_force_encode
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64631
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/333452
milestone: '14.1'
type: development
group: group::verify
default_enabled: true
...@@ -107,7 +107,6 @@ RSpec.describe Ci::BuildTraceChunks::Fog do ...@@ -107,7 +107,6 @@ RSpec.describe Ci::BuildTraceChunks::Fog do
let(:model) { create(:ci_build_trace_chunk, :fog_with_data, initial_data: initial_data) } let(:model) { create(:ci_build_trace_chunk, :fog_with_data, initial_data: initial_data) }
let(:data) { data_store.data(model) } let(:data) { data_store.data(model) }
context 'when ci_job_trace_force_encode is enabled' do
it 'appends ASCII data' do it 'appends ASCII data' do
data_store.append_data(model, +'hello world', 4) data_store.append_data(model, +'hello world', 4)
...@@ -134,25 +133,6 @@ RSpec.describe Ci::BuildTraceChunks::Fog do ...@@ -134,25 +133,6 @@ RSpec.describe Ci::BuildTraceChunks::Fog do
end end
end end
context 'when ci_job_trace_force_encode is disabled' do
before do
stub_feature_flags(ci_job_trace_force_encode: false)
end
it 'appends ASCII data' do
data_store.append_data(model, +'hello world', 4)
expect(data.encoding).to eq(Encoding::ASCII_8BIT)
expect(data.force_encoding(Encoding::UTF_8)).to eq('😺hello world')
end
it 'throws an exception when appending UTF-8 data' do
expect(Gitlab::ErrorTracking).to receive(:track_and_raise_exception).and_call_original
expect { data_store.append_data(model, +'Résumé', 4) }.to raise_exception(Encoding::CompatibilityError)
end
end
end
describe '#delete_data' do describe '#delete_data' do
subject { data_store.delete_data(model) } subject { data_store.delete_data(model) }
......
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