Merge branch 'bvl-fix-push-event-service-for-forks' into 'master'
Only cache the push event for the fork-source when it exists Closes #39352 See merge request gitlab-org/gitlab-ce!14989
This commit is contained in:
commit
08a8a3f963
3 changed files with 7 additions and 3 deletions
|
@ -16,8 +16,8 @@ module Users
|
|||
user_cache_key
|
||||
]
|
||||
|
||||
if event.project.forked?
|
||||
keys << project_cache_key(event.project.forked_from_project)
|
||||
if forked_from = event.project.forked_from_project
|
||||
keys << project_cache_key(forked_from)
|
||||
end
|
||||
|
||||
keys.each { |key| set_key(key, event.id) }
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Only cache last push event for existing projects when pushing to a fork
|
||||
merge_request: 14989
|
||||
author:
|
||||
type: fixed
|
|
@ -22,7 +22,6 @@ describe Users::LastPushEventService do
|
|||
it 'caches the event for the origin project when pushing to a fork' do
|
||||
source = build(:project, id: 5)
|
||||
|
||||
allow(project).to receive(:forked?).and_return(true)
|
||||
allow(project).to receive(:forked_from_project).and_return(source)
|
||||
|
||||
expect(service).to receive(:set_key)
|
||||
|
|
Loading…
Reference in a new issue