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
484ae922
Commit
484ae922
authored
Jul 14, 2021
by
Jacques Erasmus
Committed by
Denys Mishunov
Jul 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature flag for increasing page size
parent
4fc184f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
2 deletions
+19
-2
app/assets/javascripts/repository/components/tree_content.vue
...assets/javascripts/repository/components/tree_content.vue
+5
-2
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+1
-0
config/feature_flags/development/increase_page_size_exponentially.yml
...re_flags/development/increase_page_size_exponentially.yml
+8
-0
spec/frontend/repository/components/tree_content_spec.js
spec/frontend/repository/components/tree_content_spec.js
+5
-0
No files found.
app/assets/javascripts/repository/components/tree_content.vue
View file @
484ae922
<
script
>
import
filesQuery
from
'
shared_queries/repository/files.query.graphql
'
;
import
createFlash
from
'
~/flash
'
;
import
glFeatureFlagMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
{
__
}
from
'
../../locale
'
;
import
{
TREE_PAGE_SIZE
,
TREE_INITIAL_FETCH_COUNT
,
TREE_PAGE_LIMIT
}
from
'
../constants
'
;
import
getRefMixin
from
'
../mixins/get_ref
'
;
...
...
@@ -14,7 +15,7 @@ export default {
FileTable
,
FilePreview
,
},
mixins
:
[
getRefMixin
],
mixins
:
[
getRefMixin
,
glFeatureFlagMixin
()
],
apollo
:
{
projectPath
:
{
query
:
projectPathQuery
,
...
...
@@ -52,7 +53,9 @@ export default {
pageSize
()
{
// we want to exponentially increase the page size to reduce the load on the frontend
const
exponentialSize
=
(
TREE_PAGE_SIZE
/
TREE_INITIAL_FETCH_COUNT
)
*
(
this
.
fetchCounter
+
1
);
return
exponentialSize
<
TREE_PAGE_SIZE
?
exponentialSize
:
TREE_PAGE_SIZE
;
return
exponentialSize
<
TREE_PAGE_SIZE
&&
this
.
glFeatures
.
increasePageSizeExponentially
?
exponentialSize
:
TREE_PAGE_SIZE
;
},
totalEntries
()
{
return
Object
.
values
(
this
.
entries
).
flat
().
length
;
...
...
app/controllers/projects_controller.rb
View file @
484ae922
...
...
@@ -37,6 +37,7 @@ class ProjectsController < Projects::ApplicationController
before_action
do
push_frontend_feature_flag
(
:refactor_blob_viewer
,
@project
,
default_enabled: :yaml
)
push_frontend_feature_flag
(
:increase_page_size_exponentially
,
@project
,
default_enabled: :yaml
)
end
layout
:determine_layout
...
...
config/feature_flags/development/increase_page_size_exponentially.yml
0 → 100644
View file @
484ae922
---
name
:
increase_page_size_exponentially
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/66174
rollout_issue_url
:
milestone
:
'
14.1'
type
:
development
group
:
group::source code
default_enabled
:
false
spec/frontend/repository/components/tree_content_spec.js
View file @
484ae922
...
...
@@ -19,6 +19,11 @@ function factory(path, data = () => ({})) {
mocks
:
{
$apollo
,
},
provide
:
{
glFeatures
:
{
increasePageSizeExponentially
:
true
,
},
},
});
}
...
...
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