Commit 192049a6 authored by Sean McGivern's avatar Sean McGivern

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
parents f03700f5 7dbf114f
...@@ -83,7 +83,7 @@ class SystemHooksService ...@@ -83,7 +83,7 @@ class SystemHooksService
project_id: model.id, project_id: model.id,
owner_name: owner.name, owner_name: owner.name,
owner_email: owner.respond_to?(:email) ? owner.email : "", 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 end
......
---
title: Use the correct visibility attribute for projects in system hooks
merge_request: 15065
author:
type: fixed
...@@ -63,6 +63,12 @@ describe SystemHooksService do ...@@ -63,6 +63,12 @@ describe SystemHooksService do
:group_id, :user_id, :user_username, :user_name, :user_email, :group_access :group_id, :user_id, :user_username, :user_name, :user_email, :group_access
) )
end end
it 'includes the correct project visibility level' do
data = event_data(project, :create)
expect(data[:project_visibility]).to eq('private')
end
end end
context 'event names' do context 'event names' do
......
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