Commit 9aa0cc42 authored by Nikola Milojevic's avatar Nikola Milojevic

Merge branch '334916-feature-flag-rollout-of-one_megabyte_file_size_limit' into 'master'

Remove `one_megabyte_file_size_limit` feature flag.

See merge request gitlab-org/gitlab!66850
parents 36b3ca5c 3bf77e47
---
name: one_megabyte_file_size_limit
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65167
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334916
milestone: '14.1'
type: development
group: group::code review
default_enabled: false
...@@ -50,11 +50,7 @@ module Gitlab ...@@ -50,11 +50,7 @@ module Gitlab
attr_reader :context attr_reader :context
def self.file_size_limit def self.file_size_limit
if Feature.enabled?(:one_megabyte_file_size_limit) Gitlab.config.extra['maximum_text_highlight_size_kilobytes']
1024.kilobytes
else
Gitlab.config.extra['maximum_text_highlight_size_kilobytes']
end
end end
private_class_method :file_size_limit private_class_method :file_size_limit
......
...@@ -50,16 +50,9 @@ RSpec.describe Gitlab::Highlight do ...@@ -50,16 +50,9 @@ RSpec.describe Gitlab::Highlight do
let(:result) { described_class.highlight(file_name, content) } # content is 44 bytes let(:result) { described_class.highlight(file_name, content) } # content is 44 bytes
before do before do
stub_feature_flags(one_megabyte_file_size_limit: false)
stub_config(extra: { 'maximum_text_highlight_size_kilobytes' => 0.0001 } ) # 1.024 bytes stub_config(extra: { 'maximum_text_highlight_size_kilobytes' => 0.0001 } ) # 1.024 bytes
end end
it 'confirm file size is 1MB when `one_megabyte_file_size_limit` is enabled' do
stub_feature_flags(one_megabyte_file_size_limit: true)
expect(described_class.too_large?(1024.kilobytes)).to eq(false)
expect(described_class.too_large?(1025.kilobytes)).to eq(true)
end
it 'increments the metric for oversized files' do it 'increments the metric for oversized files' do
expect { result }.to change { over_highlight_size_limit('file size: 0.0001') }.by(1) expect { result }.to change { over_highlight_size_limit('file size: 0.0001') }.by(1)
end end
......
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