Commit 891a7f99 authored by Stan Hu's avatar Stan Hu

Merge branch '323493-remove-ff-cached-sidebar-open-issues-count' into 'master'

Remove cached_sidebar_open_issues_count feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!59004
parents 64dccfe2 0abe3164
......@@ -65,14 +65,6 @@ module GroupsHelper
can?(current_user, :set_emails_disabled, group) && !group.parent&.emails_disabled?
end
def group_open_issues_count(group)
if Feature.enabled?(:cached_sidebar_open_issues_count, group, default_enabled: :yaml)
cached_issuables_count(group, type: :issues)
else
number_with_delimiter(group_issues_count(state: 'opened'))
end
end
def group_issues_count(state:)
IssuesFinder
.new(current_user, group_id: @group.id, state: state, non_archived: true, include_subgroups: true)
......
- issues_count = group_open_issues_count(@group)
- issues_count = cached_issuables_count(@group, type: :issues)
- merge_requests_count = group_open_merge_requests_count(@group)
- aside_title = @group.subgroup? ? _('Subgroup navigation') : _('Group navigation')
- overview_title = @group.subgroup? ? _('Subgroup overview') : _('Group overview')
......
---
title: Cache issues count in sidebar at group level
merge_request: 59004
author:
type: performance
---
name: cached_sidebar_open_issues_count
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49739
rollout_issue_url:
milestone: '13.8'
type: development
group: group::product planning
default_enabled: true
......@@ -325,15 +325,8 @@ To enable it, you need to enable [ActionCable in-app mode](https://docs.gitlab.c
## Cached issue count **(FREE SELF)**
> - [Introduced]([link-to-issue](https://gitlab.com/gitlab-org/gitlab/-/issues/243753)) in GitLab 13.9.
> - It was [deployed behind a feature flag](../../feature_flags.md), disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/323493) in GitLab 13.10.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-cached-issue-count) **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/243753) in GitLab 13.9.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/323493) in GitLab 13.11.
In a group, the sidebar displays the total count of open issues and this value is cached if higher
than 1000. The cached value is rounded to thousands (or millions) and updated every 24 hours.
......@@ -371,22 +364,3 @@ until the issue is reopened.
You can then see issue statuses in the issues list and the
[epic tree](../../group/epics/index.md#issue-health-status-in-epic-tree).
## Enable or disable cached issue count **(FREE SELF)**
Cached issue count in the left sidebar is under development but ready for production use. It is
deployed behind a feature flag that is **enabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../../administration/feature_flags.md)
can disable it.
To disable it:
```ruby
Feature.disable(:cached_sidebar_open_issues_count)
```
To enable it:
```ruby
Feature.enable(:cached_sidebar_open_issues_count)
```
......@@ -481,36 +481,6 @@ RSpec.describe GroupsHelper do
end
end
describe '#group_open_issues_count' do
let_it_be(:current_user) { create(:user) }
let_it_be(:group) { create(:group, :public) }
let_it_be(:count_service) { Groups::OpenIssuesCountService }
before do
allow(helper).to receive(:current_user) { current_user }
end
it 'returns count value from cache' do
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
context 'when cached_sidebar_open_issues_count feature flag is disabled' do
before do
stub_feature_flags(cached_sidebar_open_issues_count: false)
end
it 'returns not cached issues count' do
allow(helper).to receive(:group_issues_count).and_return(2500)
expect(helper.group_open_issues_count(group)).to eq('2,500')
end
end
end
describe '#cached_issuables_count' do
let_it_be(:current_user) { create(:user) }
let_it_be(:group) { create(:group, name: 'group') }
......
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