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
354f43dc
Commit
354f43dc
authored
Jan 25, 2021
by
Alishan Ladhani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add user to StandardContext
parent
abce3cae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
ee/app/services/epics/issue_promote_service.rb
ee/app/services/epics/issue_promote_service.rb
+3
-1
ee/spec/services/epics/issue_promote_service_spec.rb
ee/spec/services/epics/issue_promote_service_spec.rb
+3
-3
lib/gitlab/tracking/standard_context.rb
lib/gitlab/tracking/standard_context.rb
+1
-3
No files found.
ee/app/services/epics/issue_promote_service.rb
View file @
354f43dc
...
...
@@ -32,8 +32,10 @@ module Epics
end
def
track_event
context
=
::
Gitlab
::
Tracking
::
StandardContext
.
new
(
namespace:
@parent_group
,
project:
issue
.
project
,
user:
current_user
)
::
Gitlab
::
Tracking
.
event
(
'epics'
,
'promote'
,
property:
'issue_id'
,
value:
original_entity
.
id
,
standard_context:
::
Gitlab
::
Tracking
::
StandardContext
.
new
(
namespace:
@parent_group
,
project:
issue
.
project
)
)
standard_context:
context
)
end
def
create_new_entity
...
...
ee/spec/services/epics/issue_promote_service_spec.rb
View file @
354f43dc
...
...
@@ -65,7 +65,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
subject
.
execute
(
issue
)
expect_snowplow_event
(
category:
'epics'
,
action:
'promote'
,
property:
'issue_id'
,
value:
issue
.
id
,
standard_context:
{
namespace:
group
,
project:
project
})
standard_context:
{
namespace:
group
,
project:
project
,
user:
user
})
end
it
'creates a new epic with correct attributes'
do
...
...
@@ -201,7 +201,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
expect
(
epic
.
notes
.
where
(
discussion_id:
discussion
.
discussion_id
).
count
).
to
eq
(
0
)
expect
(
issue
.
notes
.
where
(
discussion_id:
discussion
.
discussion_id
).
count
).
to
eq
(
1
)
expect_snowplow_event
(
category:
'epics'
,
action:
'promote'
,
property:
'issue_id'
,
value:
issue
.
id
,
standard_context:
{
namespace:
group
,
project:
project
})
standard_context:
{
namespace:
group
,
project:
project
,
user:
user
})
end
it
'copies note attachments'
do
...
...
@@ -211,7 +211,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
expect
(
epic
.
notes
.
user
.
first
.
attachment
).
to
be_kind_of
(
AttachmentUploader
)
expect_snowplow_event
(
category:
'epics'
,
action:
'promote'
,
property:
'issue_id'
,
value:
issue
.
id
,
standard_context:
{
namespace:
group
,
project:
project
})
standard_context:
{
namespace:
group
,
project:
project
,
user:
user
})
end
end
...
...
lib/gitlab/tracking/standard_context.rb
View file @
354f43dc
...
...
@@ -5,9 +5,7 @@ module Gitlab
class
StandardContext
GITLAB_STANDARD_SCHEMA_URL
=
'iglu:com.gitlab/gitlab_standard/jsonschema/1-0-2'
.
freeze
def
initialize
(
namespace:
nil
,
project:
nil
,
**
data
)
@namespace
=
namespace
@project
=
project
def
initialize
(
namespace:
nil
,
project:
nil
,
user:
nil
,
**
data
)
@data
=
data
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