Commit 3c0071e2 authored by Denys Mishunov's avatar Denys Mishunov

Merge branch 'ff-for-increasing-page-size-exponentially' into 'master'

Add feature flag for increasing page size

See merge request gitlab-org/gitlab!66174
parents 37d972b2 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;
......
......@@ -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
......
---
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
......@@ -19,6 +19,11 @@ function factory(path, data = () => ({})) {
mocks: {
$apollo,
},
provide: {
glFeatures: {
increasePageSizeExponentially: true,
},
},
});
}
......
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