BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
715a0e41
Commit
715a0e41
authored
Sep 11, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'sidebar-cache-updates' into 'master'"
This reverts commit
dd406182
, reversing changes made to
d5d24976
.
parent
320da597
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
56 deletions
+0
-56
issue.rb
app/models/issue.rb
+0
-6
merge_request.rb
app/models/merge_request.rb
+0
-6
sidebar-cache-updates.yml
changelogs/unreleased/sidebar-cache-updates.yml
+0
-5
issue_spec.rb
spec/models/issue_spec.rb
+0
-18
merge_request_spec.rb
spec/models/merge_request_spec.rb
+0
-21
No files found.
app/models/issue.rb
View file @
715a0e41
...
...
@@ -269,13 +269,7 @@ class Issue < ActiveRecord::Base
end
end
def
update_project_counter_caches?
state_changed?
||
confidential_changed?
end
def
update_project_counter_caches
return
unless
update_project_counter_caches?
Projects
::
OpenIssuesCountService
.
new
(
project
).
refresh_cache
end
...
...
app/models/merge_request.rb
View file @
715a0e41
...
...
@@ -942,13 +942,7 @@ class MergeRequest < ActiveRecord::Base
true
end
def
update_project_counter_caches?
state_changed?
end
def
update_project_counter_caches
return
unless
update_project_counter_caches?
Projects
::
OpenMergeRequestsCountService
.
new
(
target_project
).
refresh_cache
end
...
...
changelogs/unreleased/sidebar-cache-updates.yml
deleted
100644 → 0
View file @
320da597
---
title
:
Only update the sidebar count caches when needed
merge_request
:
author
:
type
:
other
spec/models/issue_spec.rb
View file @
715a0e41
...
...
@@ -773,22 +773,4 @@ describe Issue do
expect
(
described_class
.
public_only
).
to
eq
([
public_issue
])
end
end
describe
'#update_project_counter_caches?'
do
it
'returns true when the state changes'
do
subject
.
state
=
'closed'
expect
(
subject
.
update_project_counter_caches?
).
to
eq
(
true
)
end
it
'returns true when the confidential flag changes'
do
subject
.
confidential
=
true
expect
(
subject
.
update_project_counter_caches?
).
to
eq
(
true
)
end
it
'returns false when the state or confidential flag did not change'
do
expect
(
subject
.
update_project_counter_caches?
).
to
eq
(
false
)
end
end
end
spec/models/merge_request_spec.rb
View file @
715a0e41
...
...
@@ -1694,25 +1694,4 @@ describe MergeRequest do
expect
(
subject
.
ref_fetched?
).
to
be_falsey
end
end
describe
'removing a merge request'
do
it
'refreshes the number of open merge requests of the target project'
do
project
=
subject
.
target_project
expect
{
subject
.
destroy
}
.
to
change
{
project
.
open_merge_requests_count
}.
from
(
1
).
to
(
0
)
end
end
describe
'#update_project_counter_caches?'
do
it
'returns true when the state changes'
do
subject
.
state
=
'closed'
expect
(
subject
.
update_project_counter_caches?
).
to
eq
(
true
)
end
it
'returns false when the state did not change'
do
expect
(
subject
.
update_project_counter_caches?
).
to
eq
(
false
)
end
end
end
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