Commit 71078842 authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Merge branch 'remove-commit-paginate-ff' into 'master'

Remove paginate_commit_view feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!54236
parents 6dffd339 73bda975
......@@ -127,7 +127,7 @@ module CommitsHelper
end
def conditionally_paginate_diff_files(diffs, paginate:, per: Projects::CommitController::COMMIT_DIFFS_PER_PAGE)
if paginate && Feature.enabled?(:paginate_commit_view, @project, type: :development)
if paginate
Kaminari.paginate_array(diffs.diff_files.to_a).page(params[:page]).per(per)
else
diffs.diff_files
......
......@@ -3,7 +3,7 @@
- can_create_note = !@diff_notes_disabled && can?(current_user, :create_note, diffs.project)
- diff_page_context = local_assigns.fetch(:diff_page_context, nil)
- load_diff_files_async = Feature.enabled?(:async_commit_diff_files, @project) && diff_page_context == "is-commit"
- paginate_diffs = local_assigns.fetch(:paginate_diffs, false) && !load_diff_files_async && Feature.enabled?(:paginate_commit_view, @project, type: :development)
- paginate_diffs = local_assigns.fetch(:paginate_diffs, false) && !load_diff_files_async
- diff_files = conditionally_paginate_diff_files(diffs, paginate: paginate_diffs)
.content-block.oneline-block.files-changed.diff-files-changed.js-diff-files-changed
......
---
title: Add pagination of file diffs when viewing a large commit
merge_request: 54236
author:
type: added
---
name: paginate_commit_view
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52819
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/300540
milestone: '13.9'
type: development
group: group::source code
default_enabled: false
......@@ -35,9 +35,8 @@ RSpec.describe 'Commit' do
end
end
context "pagination enabled" do
describe "pagination" do
before do
stub_feature_flags(paginate_commit_view: true)
stub_const("Projects::CommitController::COMMIT_DIFFS_PER_PAGE", 1)
visit project_commit_path(project, commit)
......@@ -61,18 +60,5 @@ RSpec.describe 'Commit' do
expect(page).to have_selector(".files ##{files[1].file_hash}")
end
end
context "pagination disabled" do
before do
stub_feature_flags(paginate_commit_view: false)
visit project_commit_path(project, commit)
end
it "shows both diffs on the page" do
expect(page).to have_selector(".files ##{files[0].file_hash}")
expect(page).to have_selector(".files ##{files[1].file_hash}")
end
end
end
end
......@@ -238,15 +238,5 @@ RSpec.describe CommitsHelper do
expect(subject).to be_a(Gitlab::Git::DiffCollection)
end
end
context "feature flag is disabled" do
let(:paginate) { true }
it "returns a standard DiffCollection" do
stub_feature_flags(paginate_commit_view: false)
expect(subject).to be_a(Gitlab::Git::DiffCollection)
end
end
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