Commit 31be53fc authored by Eugenia Grieff's avatar Eugenia Grieff

Enable cached_sidebar_open_issues_count by default

- Update docs
- Update specs
parent 48e6b011
...@@ -63,7 +63,7 @@ module GroupsHelper ...@@ -63,7 +63,7 @@ module GroupsHelper
end end
def group_open_issues_count(group) def group_open_issues_count(group)
if Feature.enabled?(:cached_sidebar_open_issues_count, group) if Feature.enabled?(:cached_sidebar_open_issues_count, group, default_enabled: :yaml)
cached_open_group_issues_count(group) cached_open_group_issues_count(group)
else else
number_with_delimiter(group_issues_count(state: 'opened')) number_with_delimiter(group_issues_count(state: 'opened'))
......
---
title: Cache open issues count in group sidebar
merge_request: 49739
author:
type: added
...@@ -5,4 +5,4 @@ rollout_issue_url: ...@@ -5,4 +5,4 @@ rollout_issue_url:
milestone: '13.8' milestone: '13.8'
type: development type: development
group: group::product planning group: group::product planning
default_enabled: false default_enabled: true
...@@ -197,18 +197,18 @@ You can then see issue statuses in the [issue list](#issues-list) and the ...@@ -197,18 +197,18 @@ You can then see issue statuses in the [issue list](#issues-list) and the
## Enable or disable cached issue count **(FREE SELF)** ## Enable or disable cached issue count **(FREE SELF)**
Cached issue count in the left sidebar is under development and not ready for production use. It is Cached issue count in the left sidebar is under development and not ready for production use. It is
deployed behind a feature flag that is **disabled by default**. deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md) [GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can enable it. can disable it.
To enable it: To disable it:
```ruby ```ruby
Feature.enable(:cached_sidebar_open_issues_count) Feature.disable(:cached_sidebar_open_issues_count)
``` ```
To disable it: To enable it:
```ruby ```ruby
Feature.disable(:cached_sidebar_open_issues_count) Feature.enable(:cached_sidebar_open_issues_count)
``` ```
...@@ -454,18 +454,12 @@ RSpec.describe GroupsHelper do ...@@ -454,18 +454,12 @@ RSpec.describe GroupsHelper do
allow(helper).to receive(:current_user) { current_user } allow(helper).to receive(:current_user) { current_user }
end end
context 'when cached_sidebar_open_issues_count feature flag is enabled' do it 'returns count value from cache' do
before do allow_next_instance_of(count_service) do |service|
stub_feature_flags(cached_sidebar_open_issues_count: true) allow(service).to receive(:count).and_return(2500)
end end
it 'returns count value from cache' do expect(helper.group_open_issues_count(group)).to eq('2.5k')
allow_next_instance_of(count_service) do |service|
allow(service).to receive(:count).and_return(2500)
end
expect(helper.group_open_issues_count(group)).to eq('2.5k')
end
end end
context 'when cached_sidebar_open_issues_count feature flag is disabled' do context 'when cached_sidebar_open_issues_count feature flag is disabled' do
......
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