Commit b8910e6e authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch 'eb-track-group-coverage-csv-download' into 'master'

Track event for downloading group coverage CSV

See merge request gitlab-org/gitlab!40754
parents e8dcdf17 79857030
---
title: Track downloads of group code coverage CSV in snowplow
merge_request: 40754
author:
type: added
......@@ -10,7 +10,10 @@ class Groups::Analytics::CoverageReportsController < Groups::Analytics::Applicat
def index
respond_to do |format|
format.csv { send_data(render_csv(report_results), type: 'text/csv; charset=utf-8') }
format.csv do
track_event(:download_code_coverage_csv, download_tracker_params)
send_data(render_csv(report_results), type: 'text/csv; charset=utf-8')
end
end
end
......@@ -41,4 +44,11 @@ class Groups::Analytics::CoverageReportsController < Groups::Analytics::Applicat
end_date: Date.parse(params.require(:end_date))
}
end
def download_tracker_params
{
label: 'group_id',
value: @group.id
}
end
end
......@@ -76,6 +76,13 @@ RSpec.describe Groups::Analytics::CoverageReportsController do
end
it 'responds 200 with CSV coverage data' do
expect(Gitlab::Tracking).to receive(:event).with(
described_class.name,
'download_code_coverage_csv',
label: 'group_id',
value: group.id
)
get :index, params: valid_request_params
expect(response).to have_gitlab_http_status(:ok)
......
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