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
9e5e11c8
Commit
9e5e11c8
authored
Feb 11, 2021
by
jejacks0n
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add checkbox to value of tracking call
- Track when a project is created with the readme checkbox checked.
parent
6223d35e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+5
-1
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+7
-4
No files found.
app/controllers/projects_controller.rb
View file @
9e5e11c8
...
@@ -75,7 +75,11 @@ class ProjectsController < Projects::ApplicationController
...
@@ -75,7 +75,11 @@ class ProjectsController < Projects::ApplicationController
@project
=
::
Projects
::
CreateService
.
new
(
current_user
,
project_params
(
attributes:
project_params_create_attributes
)).
execute
@project
=
::
Projects
::
CreateService
.
new
(
current_user
,
project_params
(
attributes:
project_params_create_attributes
)).
execute
if
@project
.
saved?
if
@project
.
saved?
experiment
(
:new_project_readme
,
actor:
current_user
).
track
(
:created
,
property:
active_new_project_tab
)
experiment
(
:new_project_readme
,
actor:
current_user
).
track
(
:created
,
property:
active_new_project_tab
,
value:
project_params
[
:initialize_with_readme
].
to_i
)
redirect_to
(
redirect_to
(
project_path
(
@project
,
custom_import_params
),
project_path
(
@project
,
custom_import_params
),
notice:
_
(
"Project '%{project_name}' was successfully created."
)
%
{
project_name:
@project
.
name
}
notice:
_
(
"Project '%{project_name}' was successfully created."
)
%
{
project_name:
@project
.
name
}
...
...
spec/controllers/projects_controller_spec.rb
View file @
9e5e11c8
...
@@ -416,7 +416,8 @@ RSpec.describe ProjectsController do
...
@@ -416,7 +416,8 @@ RSpec.describe ProjectsController do
path:
'foo'
,
path:
'foo'
,
description:
'bar'
,
description:
'bar'
,
namespace_id:
user
.
namespace
.
id
,
namespace_id:
user
.
namespace
.
id
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
,
initialize_with_readme:
1
}
}
end
end
...
@@ -425,9 +426,11 @@ RSpec.describe ProjectsController do
...
@@ -425,9 +426,11 @@ RSpec.describe ProjectsController do
end
end
it
'tracks a created event for the new_project_readme experiment'
,
:experiment
do
it
'tracks a created event for the new_project_readme experiment'
,
:experiment
do
expect
(
experiment
(
:new_project_readme
)).
to
track
(
:created
,
property:
'blank'
).
on_any_instance
.
with_context
(
expect
(
experiment
(
:new_project_readme
)).
to
track
(
actor:
user
:created
,
)
property:
'blank'
,
value:
1
).
on_any_instance
.
with_context
(
actor:
user
)
post
:create
,
params:
{
project:
project_params
}
post
:create
,
params:
{
project:
project_params
}
end
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