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
afc0c8e5
Commit
afc0c8e5
authored
Sep 23, 2020
by
Miranda Fluharty
Committed by
Michael Kozono
Sep 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use expect_snowplow_event in spec
instead of expect(Gitlab::Tracking).to receive(:event)
parent
8a28ae9b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
ee/app/controllers/groups/analytics/repository_analytics_controller.rb
...llers/groups/analytics/repository_analytics_controller.rb
+10
-0
ee/changelogs/unreleased/215209-track-group-repo-analytics-pageviews.yml
...nreleased/215209-track-group-repo-analytics-pageviews.yml
+5
-0
ee/spec/controllers/groups/analytics/repository_analytics_controller_spec.rb
.../groups/analytics/repository_analytics_controller_spec.rb
+12
-1
No files found.
ee/app/controllers/groups/analytics/repository_analytics_controller.rb
View file @
afc0c8e5
...
@@ -10,5 +10,15 @@ class Groups::Analytics::RepositoryAnalyticsController < Groups::Analytics::Appl
...
@@ -10,5 +10,15 @@ class Groups::Analytics::RepositoryAnalyticsController < Groups::Analytics::Appl
before_action
->
{
authorize_view_by_action!
(
:read_group_repository_analytics
)
}
before_action
->
{
authorize_view_by_action!
(
:read_group_repository_analytics
)
}
def
show
def
show
track_event
(
pageview_tracker_params
)
end
private
def
pageview_tracker_params
{
label:
'group_id'
,
value:
@group
.
id
}
end
end
end
end
ee/changelogs/unreleased/215209-track-group-repo-analytics-pageviews.yml
0 → 100644
View file @
afc0c8e5
---
title
:
Track views of group repo analytics page in snowplow
merge_request
:
42376
author
:
type
:
added
ee/spec/controllers/groups/analytics/repository_analytics_controller_spec.rb
View file @
afc0c8e5
...
@@ -15,7 +15,7 @@ RSpec.describe Groups::Analytics::RepositoryAnalyticsController do
...
@@ -15,7 +15,7 @@ RSpec.describe Groups::Analytics::RepositoryAnalyticsController do
stub_licensed_features
(
feature_name
=>
true
)
stub_licensed_features
(
feature_name
=>
true
)
end
end
describe
'GET show'
do
describe
'GET show'
,
:snowplow
do
subject
{
get
:show
,
params:
{
group_id:
group
}
}
subject
{
get
:show
,
params:
{
group_id:
group
}
}
before
do
before
do
...
@@ -24,6 +24,17 @@ RSpec.describe Groups::Analytics::RepositoryAnalyticsController do
...
@@ -24,6 +24,17 @@ RSpec.describe Groups::Analytics::RepositoryAnalyticsController do
specify
{
is_expected
.
to
have_gitlab_http_status
(
:success
)
}
specify
{
is_expected
.
to
have_gitlab_http_status
(
:success
)
}
it
'tracks a pageview event in snowplow'
do
subject
expect_snowplow_event
(
category:
'Groups::Analytics::RepositoryAnalyticsController'
,
action:
'show'
,
label:
'group_id'
,
value:
group
.
id
)
end
context
'when license is missing'
do
context
'when license is missing'
do
before
do
before
do
stub_licensed_features
(
feature_name
=>
false
)
stub_licensed_features
(
feature_name
=>
false
)
...
...
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