Commit dc1ab13e authored by Alishan Ladhani's avatar Alishan Ladhani

Add an extra property to issue promotion Snowplow event

To test out the new `extra` field in the `gitlab_standard` schema
parent 8ada13ae
......@@ -33,7 +33,7 @@ module Epics
def track_event
::Gitlab::Tracking.event('epics', 'promote', property: 'issue_id', value: original_entity.id,
project: issue.project, user: current_user, namespace: @parent_group)
project: issue.project, user: current_user, namespace: parent_group, weight: issue.weight)
::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_issue_promoted_to_epic(author: current_user)
end
......
......@@ -11,7 +11,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
let(:description) { 'simple description' }
let(:issue) do
create(:issue, project: project, labels: [label1, label2],
milestone: milestone, description: description)
milestone: milestone, description: description, weight: 3)
end
subject { described_class.new(issue.project, user) }
......@@ -103,7 +103,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
it 'emits a snowplow event' do
expect_snowplow_event(category: 'epics', action: 'promote', property: 'issue_id', value: issue.id,
project: project, user: user, namespace: group)
project: project, user: user, namespace: group, weight: 3)
end
context 'when issue description has mentions and has notes with mentions' do
......@@ -210,7 +210,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,
project: project, user: user, namespace: group)
project: project, user: user, namespace: group, weight: 3)
end
it 'copies note attachments' do
......@@ -220,7 +220,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,
project: project, user: user, namespace: group)
project: project, user: user, namespace: group, weight: 3)
end
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