Merge branch 'bvl-fix-system-hook-project-visibility' into 'master'
Use the correct project visibility in system hooks Closes #39496 See merge request gitlab-org/gitlab-ce!15065
This commit is contained in:
commit
192049a610
3 changed files with 12 additions and 1 deletions
|
@ -83,7 +83,7 @@ class SystemHooksService
|
|||
project_id: model.id,
|
||||
owner_name: owner.name,
|
||||
owner_email: owner.respond_to?(:email) ? owner.email : "",
|
||||
project_visibility: Project.visibility_levels.key(model.visibility_level_value).downcase
|
||||
project_visibility: model.visibility.downcase
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Use the correct visibility attribute for projects in system hooks
|
||||
merge_request: 15065
|
||||
author:
|
||||
type: fixed
|
|
@ -63,6 +63,12 @@ describe SystemHooksService do
|
|||
:group_id, :user_id, :user_username, :user_name, :user_email, :group_access
|
||||
)
|
||||
end
|
||||
|
||||
it 'includes the correct project visibility level' do
|
||||
data = event_data(project, :create)
|
||||
|
||||
expect(data[:project_visibility]).to eq('private')
|
||||
end
|
||||
end
|
||||
|
||||
context 'event names' do
|
||||
|
|
Loading…
Reference in a new issue