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 ...@@ -33,7 +33,7 @@ module Epics
def track_event def track_event
::Gitlab::Tracking.event('epics', 'promote', property: 'issue_id', value: original_entity.id, ::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) ::Gitlab::UsageDataCounters::EpicActivityUniqueCounter.track_issue_promoted_to_epic(author: current_user)
end end
......
...@@ -11,7 +11,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do ...@@ -11,7 +11,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
let(:description) { 'simple description' } let(:description) { 'simple description' }
let(:issue) do let(:issue) do
create(:issue, project: project, labels: [label1, label2], create(:issue, project: project, labels: [label1, label2],
milestone: milestone, description: description) milestone: milestone, description: description, weight: 3)
end end
subject { described_class.new(issue.project, user) } subject { described_class.new(issue.project, user) }
...@@ -103,7 +103,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do ...@@ -103,7 +103,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
it 'emits a snowplow event' do it 'emits a snowplow event' do
expect_snowplow_event(category: 'epics', action: 'promote', property: 'issue_id', value: issue.id, 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
context 'when issue description has mentions and has notes with mentions' do context 'when issue description has mentions and has notes with mentions' do
...@@ -210,7 +210,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures 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(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(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, 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
it 'copies note attachments' do it 'copies note attachments' do
...@@ -220,7 +220,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do ...@@ -220,7 +220,7 @@ RSpec.describe Epics::IssuePromoteService, :aggregate_failures do
expect(epic.notes.user.first.attachment).to be_kind_of(AttachmentUploader) expect(epic.notes.user.first.attachment).to be_kind_of(AttachmentUploader)
expect_snowplow_event(category: 'epics', action: 'promote', property: 'issue_id', value: issue.id, 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
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