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
31be53fc
Commit
31be53fc
authored
Mar 04, 2021
by
Eugenia Grieff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable cached_sidebar_open_issues_count by default
- Update docs - Update specs
parent
48e6b011
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
18 deletions
+17
-18
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+1
-1
changelogs/unreleased/323493-feature-flag-enable-caching-issues-count-in-group-sidebar.yml
...ure-flag-enable-caching-issues-count-in-group-sidebar.yml
+5
-0
config/feature_flags/development/cached_sidebar_open_issues_count.yml
...re_flags/development/cached_sidebar_open_issues_count.yml
+1
-1
doc/user/project/issues/index.md
doc/user/project/issues/index.md
+6
-6
spec/helpers/groups_helper_spec.rb
spec/helpers/groups_helper_spec.rb
+4
-10
No files found.
app/helpers/groups_helper.rb
View file @
31be53fc
...
...
@@ -63,7 +63,7 @@ module GroupsHelper
end
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
)
else
number_with_delimiter
(
group_issues_count
(
state:
'opened'
))
...
...
changelogs/unreleased/323493-feature-flag-enable-caching-issues-count-in-group-sidebar.yml
0 → 100644
View file @
31be53fc
---
title
:
Cache open issues count in group sidebar
merge_request
:
49739
author
:
type
:
added
config/feature_flags/development/cached_sidebar_open_issues_count.yml
View file @
31be53fc
...
...
@@ -5,4 +5,4 @@ rollout_issue_url:
milestone
:
'
13.8'
type
:
development
group
:
group::product planning
default_enabled
:
fals
e
default_enabled
:
tru
e
doc/user/project/issues/index.md
View file @
31be53fc
...
...
@@ -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)**
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
**
dis
abled by default**
.
deployed behind a feature flag that is
**
en
abled by default**
.
[
GitLab administrators with access to the GitLab Rails console
](
../../../administration/feature_flags.md
)
can
en
able it.
can
dis
able it.
To
en
able it:
To
dis
able it:
```
ruby
Feature
.
en
able
(
:cached_sidebar_open_issues_count
)
Feature
.
dis
able
(
:cached_sidebar_open_issues_count
)
```
To
dis
able it:
To
en
able it:
```
ruby
Feature
.
dis
able
(
:cached_sidebar_open_issues_count
)
Feature
.
en
able
(
:cached_sidebar_open_issues_count
)
```
spec/helpers/groups_helper_spec.rb
View file @
31be53fc
...
...
@@ -454,18 +454,12 @@ RSpec.describe GroupsHelper do
allow
(
helper
).
to
receive
(
:current_user
)
{
current_user
}
end
context
'when cached_sidebar_open_issues_count feature flag is enabled
'
do
before
do
stub_feature_flags
(
cached_sidebar_open_issues_count:
true
)
it
'returns count value from cache
'
do
allow_next_instance_of
(
count_service
)
do
|
service
|
allow
(
service
).
to
receive
(
:count
).
and_return
(
2500
)
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
expect
(
helper
.
group_open_issues_count
(
group
)).
to
eq
(
'2.5k'
)
end
context
'when cached_sidebar_open_issues_count feature flag is disabled'
do
...
...
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