Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0b94059b
Commit
0b94059b
authored
Jan 19, 2022
by
charlie ablett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use current_user rather than owner to log project creation
parent
68755b38
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
7 deletions
+14
-7
app/services/projects/create_service.rb
app/services/projects/create_service.rb
+1
-1
spec/services/projects/create_service_spec.rb
spec/services/projects/create_service_spec.rb
+13
-6
No files found.
app/services/projects/create_service.rb
View file @
0b94059b
...
...
@@ -89,7 +89,7 @@ module Projects
end
def
after_create_actions
log_info
(
"
#{
@project
.
own
er
.
name
}
created a new project
\"
#{
@project
.
full_name
}
\"
"
)
log_info
(
"
#{
current_us
er
.
name
}
created a new project
\"
#{
@project
.
full_name
}
\"
"
)
if
@project
.
import?
experiment
(
:combined_registration
,
user:
current_user
).
track
(
:import_project
)
...
...
spec/services/projects/create_service_spec.rb
View file @
0b94059b
...
...
@@ -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
...
...
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