Commit d7c3f9ba authored by Mark Chao's avatar Mark Chao

Merge branch '350603-cablett-log-project-after-creation' into 'master'

Use current_user rather than owner to log project creation

See merge request gitlab-org/gitlab!78511
parents 7a629dda 0b94059b
......@@ -89,7 +89,7 @@ module Projects
end
def after_create_actions
log_info("#{@project.owner.name} created a new project \"#{@project.full_name}\"")
log_info("#{current_user.name} created a new project \"#{@project.full_name}\"")
if @project.import?
experiment(:combined_registration, user: current_user).track(:import_project)
......
......@@ -7,9 +7,10 @@ RSpec.describe Projects::CreateService, '#execute' do
include GitHelpers
let(:user) { create :user }
let(:project_name) { 'GitLab' }
let(:opts) do
{
name: 'GitLab',
name: project_name,
namespace_id: user.namespace.id
}
end
......@@ -144,6 +145,12 @@ RSpec.describe Projects::CreateService, '#execute' do
subject { create_project(user, opts) }
end
it 'logs creation' do
expect(Gitlab::AppLogger).to receive(:info).with(/#{user.name} created a new project/)
create_project(user, opts)
end
end
context "admin creates project with other user's namespace_id" do
......@@ -202,7 +209,7 @@ RSpec.describe Projects::CreateService, '#execute' do
let(:opts) do
{
name: 'GitLab',
name: project_name,
namespace_id: shared_group.id
}
end
......@@ -237,7 +244,7 @@ RSpec.describe Projects::CreateService, '#execute' do
let(:share_max_access_level) { Gitlab::Access::MAINTAINER }
let(:opts) do
{
name: 'GitLab',
name: project_name,
namespace_id: subgroup_for_projects.id
}
end
......@@ -676,7 +683,7 @@ RSpec.describe Projects::CreateService, '#execute' do
let(:opts) do
{
name: 'GitLab',
name: project_name,
namespace_id: group.id
}
end
......@@ -697,7 +704,7 @@ RSpec.describe Projects::CreateService, '#execute' do
let(:opts) do
{
name: 'GitLab',
name: project_name,
namespace_id: subgroup.id
}
end
......@@ -808,7 +815,7 @@ RSpec.describe Projects::CreateService, '#execute' do
let(:opts) do
{
name: 'GitLab',
name: project_name,
namespace_id: group.id
}
end
......
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