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
79857030
Commit
79857030
authored
Sep 02, 2020
by
Erick Bajao
Committed by
Dmytro Zaporozhets (DZ)
Sep 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track event for downloading group coverage CSV
parent
1e0ff62a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
changelogs/unreleased/eb-track-group-coverage-csv-download.yml
...elogs/unreleased/eb-track-group-coverage-csv-download.yml
+5
-0
ee/app/controllers/groups/analytics/coverage_reports_controller.rb
...ntrollers/groups/analytics/coverage_reports_controller.rb
+11
-1
ee/spec/controllers/groups/analytics/coverage_reports_controller_spec.rb
...lers/groups/analytics/coverage_reports_controller_spec.rb
+7
-0
No files found.
changelogs/unreleased/eb-track-group-coverage-csv-download.yml
0 → 100644
View file @
79857030
---
title
:
Track downloads of group code coverage CSV in snowplow
merge_request
:
40754
author
:
type
:
added
ee/app/controllers/groups/analytics/coverage_reports_controller.rb
View file @
79857030
...
...
@@ -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
ee/spec/controllers/groups/analytics/coverage_reports_controller_spec.rb
View file @
79857030
...
...
@@ -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
)
...
...
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