From 6614a56c21419194f54d3f01230f2fccbcb04b6b Mon Sep 17 00:00:00 2001 From: Stanislav Lashmanov Date: Fri, 5 May 2023 15:09:33 +0400 Subject: [PATCH] Remove Blame page streaming feature flag Changelog: changed --- app/helpers/blame_helper.rb | 8 ++----- app/views/projects/blame/show.html.haml | 2 +- .../development/blame_page_streaming.yml | 8 ------- lib/gitlab/git/blame_mode.rb | 6 ----- spec/features/projects/blobs/blame_spec.rb | 8 ------- spec/helpers/blame_helper_spec.rb | 15 ++----------- spec/lib/gitlab/git/blame_mode_spec.rb | 22 ------------------- 7 files changed, 5 insertions(+), 64 deletions(-) delete mode 100644 config/feature_flags/development/blame_page_streaming.yml diff --git a/app/helpers/blame_helper.rb b/app/helpers/blame_helper.rb index f25917407a7649..56d651a8b6568a 100644 --- a/app/helpers/blame_helper.rb +++ b/app/helpers/blame_helper.rb @@ -44,11 +44,7 @@ def blame_pages_streaming_url(id, project) namespace_project_blame_page_url(namespace_id: project.namespace, project_id: project, id: id, streaming: true) end - def entire_blame_path(id, project, blame_mode) - if blame_mode.streaming_supported? - namespace_project_blame_streaming_path(namespace_id: project.namespace, project_id: project, id: id) - else - namespace_project_blame_path(namespace_id: project.namespace, project_id: project, id: id, no_pagination: true) - end + def entire_blame_path(id, project) + namespace_project_blame_streaming_path(namespace_id: project.namespace, project_id: project, id: id) end end diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index a56d398d3a094f..e2cad2fb3d7df1 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -42,7 +42,7 @@ - if @blame_mode.pagination? && @blame_pagination.total_pages > 1 .gl-display-flex.gl-justify-content-center.gl-flex-direction-column.gl-align-items-center.gl-p-3.gl-bg-gray-50.gl-border-t-solid.gl-border-t-1.gl-border-gray-100 - = render Pajamas::ButtonComponent.new(href: entire_blame_path(@id, @project, @blame_mode), size: :small, button_options: { class: 'gl-mt-3' }) do |c| + = render Pajamas::ButtonComponent.new(href: entire_blame_path(@id, @project), size: :small, button_options: { class: 'gl-mt-3' }) do |c| = _('Show full blame') - if @blame_mode.streaming? diff --git a/config/feature_flags/development/blame_page_streaming.yml b/config/feature_flags/development/blame_page_streaming.yml deleted file mode 100644 index 44d64800dabe62..00000000000000 --- a/config/feature_flags/development/blame_page_streaming.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: blame_page_streaming -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/110208 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/392890 -milestone: '15.10' -type: development -group: group::source code -default_enabled: false diff --git a/lib/gitlab/git/blame_mode.rb b/lib/gitlab/git/blame_mode.rb index d8fc8fece068fe..15200e3888c539 100644 --- a/lib/gitlab/git/blame_mode.rb +++ b/lib/gitlab/git/blame_mode.rb @@ -8,13 +8,7 @@ def initialize(project, params) @params = params end - def streaming_supported? - Feature.enabled?(:blame_page_streaming, project) - end - def streaming? - return false unless streaming_supported? - Gitlab::Utils.to_boolean(params[:streaming], default: false) end diff --git a/spec/features/projects/blobs/blame_spec.rb b/spec/features/projects/blobs/blame_spec.rb index 6f5bf8ac26e08b..c5379cf56c02e9 100644 --- a/spec/features/projects/blobs/blame_spec.rb +++ b/spec/features/projects/blobs/blame_spec.rb @@ -102,14 +102,6 @@ def visit_blob_blame(path) end end - context 'when streaming is disabled' do - before do - stub_feature_flags(blame_page_streaming: false) - end - - it_behaves_like 'a full blame page' - end - context 'when streaming is enabled' do before do stub_const('Gitlab::Git::BlamePagination::STREAMING_PER_PAGE', 50) diff --git a/spec/helpers/blame_helper_spec.rb b/spec/helpers/blame_helper_spec.rb index 54d714b2038866..30670064d935ee 100644 --- a/spec/helpers/blame_helper_spec.rb +++ b/spec/helpers/blame_helper_spec.rb @@ -69,23 +69,12 @@ end describe '#entire_blame_path' do - subject { helper.entire_blame_path(id, project, blame_mode) } + subject { helper.entire_blame_path(id, project) } let_it_be(:project) { build_stubbed(:project) } let(:id) { 'main/README.md' } - let(:blame_mode) { instance_double('Gitlab::Git::BlameMode', 'streaming_supported?' => streaming_enabled) } - context 'when streaming is supported' do - let(:streaming_enabled) { true } - - it { is_expected.to eq "/#{project.full_path}/-/blame/#{id}/streaming" } - end - - context 'when streaming is not supported' do - let(:streaming_enabled) { false } - - it { is_expected.to eq "/#{project.full_path}/-/blame/#{id}?no_pagination=true" } - end + it { is_expected.to eq "/#{project.full_path}/-/blame/#{id}/streaming" } end end diff --git a/spec/lib/gitlab/git/blame_mode_spec.rb b/spec/lib/gitlab/git/blame_mode_spec.rb index 1fc6f12c55251d..3496b763f924df 100644 --- a/spec/lib/gitlab/git/blame_mode_spec.rb +++ b/spec/lib/gitlab/git/blame_mode_spec.rb @@ -8,20 +8,6 @@ let_it_be(:project) { build(:project) } let(:params) { {} } - describe '#streaming_supported?' do - subject { blame_mode.streaming_supported? } - - it { is_expected.to be_truthy } - - context 'when `blame_page_streaming` is disabled' do - before do - stub_feature_flags(blame_page_streaming: false) - end - - it { is_expected.to be_falsey } - end - end - describe '#streaming?' do subject { blame_mode.streaming? } @@ -31,14 +17,6 @@ let(:params) { { streaming: true } } it { is_expected.to be_truthy } - - context 'when `blame_page_streaming` is disabled' do - before do - stub_feature_flags(blame_page_streaming: false) - end - - it { is_expected.to be_falsey } - end end end -- GitLab