Commit 4dd097fc authored by Jaspreet Singh's avatar Jaspreet Singh Committed by Andy Soiron

Cleanup api_kaminari_count_with_limit feature flag

Changelog: removed
parent 4224b844
---
name: api_kaminari_count_with_limit
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/23931
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/353077
milestone: '11.8'
type: ops
group: group::integrations
default_enabled: true
...@@ -89,22 +89,24 @@ Example response: ...@@ -89,22 +89,24 @@ Example response:
```json ```json
[ [
{ {
"name": "api_kaminari_count_with_limit", "name": "geo_pages_deployment_replication",
"introduced_by_url": "https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/23931", "introduced_by_url": "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68662",
"rollout_issue_url": null, "rollout_issue_url": "https://gitlab.com/gitlab-org/gitlab/-/issues/337676",
"milestone": "11.8", "milestone": "14.3",
"type": "ops", "log_state_changes": null,
"group": "group::ecosystem", "type": "development",
"group": "group::geo",
"default_enabled": true "default_enabled": true
}, },
{ {
"name": "marginalia", "name": "analytics_devops_adoption_codeowners",
"introduced_by_url": null, "introduced_by_url": "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/59874",
"rollout_issue_url": null, "rollout_issue_url": "https://gitlab.com/gitlab-org/gitlab/-/issues/328542",
"milestone": null, "milestone": "13.12",
"type": "ops", "log_state_changes": null,
"group": null, "type": "development",
"default_enabled": false "group": "group::optimize",
"default_enabled": true
} }
] ]
``` ```
......
...@@ -27,7 +27,6 @@ module Gitlab ...@@ -27,7 +27,6 @@ module Gitlab
end end
return pagination_data unless pagination_data.is_a?(ActiveRecord::Relation) return pagination_data unless pagination_data.is_a?(ActiveRecord::Relation)
return pagination_data unless Feature.enabled?(:api_kaminari_count_with_limit, type: :ops, default_enabled: :yaml)
limited_total_count = pagination_data.total_count_with_limit limited_total_count = pagination_data.total_count_with_limit
if limited_total_count > Kaminari::ActiveRecordRelationMethods::MAX_COUNT_LIMIT if limited_total_count > Kaminari::ActiveRecordRelationMethods::MAX_COUNT_LIMIT
......
...@@ -66,25 +66,6 @@ RSpec.describe Gitlab::Pagination::OffsetPagination do ...@@ -66,25 +66,6 @@ RSpec.describe Gitlab::Pagination::OffsetPagination do
let(:query) { base_query.merge(page: 1, per_page: 2) } let(:query) { base_query.merge(page: 1, per_page: 2) }
context 'when the api_kaminari_count_with_limit feature flag is unset' do
it_behaves_like 'paginated response'
it_behaves_like 'response with pagination headers'
end
context 'when the api_kaminari_count_with_limit feature flag is disabled' do
before do
stub_feature_flags(api_kaminari_count_with_limit: false)
end
it_behaves_like 'paginated response'
it_behaves_like 'response with pagination headers'
end
context 'when the api_kaminari_count_with_limit feature flag is enabled' do
before do
stub_feature_flags(api_kaminari_count_with_limit: true)
end
context 'when resources count is less than MAX_COUNT_LIMIT' do context 'when resources count is less than MAX_COUNT_LIMIT' do
before do before do
stub_const("::Kaminari::ActiveRecordRelationMethods::MAX_COUNT_LIMIT", 4) stub_const("::Kaminari::ActiveRecordRelationMethods::MAX_COUNT_LIMIT", 4)
...@@ -128,7 +109,6 @@ RSpec.describe Gitlab::Pagination::OffsetPagination do ...@@ -128,7 +109,6 @@ RSpec.describe Gitlab::Pagination::OffsetPagination do
paginator.paginate(resource, exclude_total_headers: true) paginator.paginate(resource, exclude_total_headers: true)
end end
end
context 'when resource already paginated' do context 'when resource already paginated' do
let(:resource) { Project.all.page(1).per(1) } let(:resource) { Project.all.page(1).per(1) }
......
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