Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d2ba225c
Commit
d2ba225c
authored
Feb 15, 2021
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove paginate_commit_view feature flag
Enables pagination for the commit view by default.
parent
1c432d0f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
35 deletions
+8
-35
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+1
-1
app/views/projects/diffs/_diffs.html.haml
app/views/projects/diffs/_diffs.html.haml
+1
-1
changelogs/unreleased/remove-commit-paginate-ff.yml
changelogs/unreleased/remove-commit-paginate-ff.yml
+5
-0
config/feature_flags/development/paginate_commit_view.yml
config/feature_flags/development/paginate_commit_view.yml
+0
-8
spec/features/commit_spec.rb
spec/features/commit_spec.rb
+1
-15
spec/helpers/commits_helper_spec.rb
spec/helpers/commits_helper_spec.rb
+0
-10
No files found.
app/helpers/commits_helper.rb
View file @
d2ba225c
...
...
@@ -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
...
...
app/views/projects/diffs/_diffs.html.haml
View file @
d2ba225c
...
...
@@ -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
...
...
changelogs/unreleased/remove-commit-paginate-ff.yml
0 → 100644
View file @
d2ba225c
---
title
:
Remove paginate_commit_view feature flag
merge_request
:
54236
author
:
type
:
changed
config/feature_flags/development/paginate_commit_view.yml
deleted
100644 → 0
View file @
1c432d0f
---
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
spec/features/commit_spec.rb
View file @
d2ba225c
...
...
@@ -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
spec/helpers/commits_helper_spec.rb
View file @
d2ba225c
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment