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
a8040a61
Commit
a8040a61
authored
Aug 26, 2019
by
Igor
Committed by
Lin Jen-Shin
Aug 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add usage pings for merge request creating
Code Review Usage Ping for Create SMAU
parent
830ea119
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
2 deletions
+35
-2
app/services/merge_requests/create_service.rb
app/services/merge_requests/create_service.rb
+1
-0
changelogs/unreleased/id-code-review-smau.yml
changelogs/unreleased/id-code-review-smau.yml
+5
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+2
-1
lib/gitlab/usage_data_counters/merge_request_counter.rb
lib/gitlab/usage_data_counters/merge_request_counter.rb
+10
-0
spec/lib/gitlab/usage_data_counters/merge_request_counter_spec.rb
.../gitlab/usage_data_counters/merge_request_counter_spec.rb
+9
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+1
-0
spec/services/merge_requests/create_service_spec.rb
spec/services/merge_requests/create_service_spec.rb
+7
-1
No files found.
app/services/merge_requests/create_service.rb
View file @
a8040a61
...
...
@@ -27,6 +27,7 @@ module MergeRequests
issuable
.
cache_merge_request_closes_issues!
(
current_user
)
create_pipeline_for
(
issuable
,
current_user
)
issuable
.
update_head_pipeline
Gitlab
::
UsageDataCounters
::
MergeRequestCounter
.
count
(
:create
)
super
end
...
...
changelogs/unreleased/id-code-review-smau.yml
0 → 100644
View file @
a8040a61
---
title
:
Add usage pings for merge request creating
merge_request
:
32059
author
:
type
:
added
lib/gitlab/usage_data.rb
View file @
a8040a61
...
...
@@ -142,7 +142,8 @@ module Gitlab
Gitlab
::
UsageDataCounters
::
SnippetCounter
,
Gitlab
::
UsageDataCounters
::
SearchCounter
,
Gitlab
::
UsageDataCounters
::
CycleAnalyticsCounter
,
Gitlab
::
UsageDataCounters
::
SourceCodeCounter
Gitlab
::
UsageDataCounters
::
SourceCodeCounter
,
Gitlab
::
UsageDataCounters
::
MergeRequestCounter
]
end
...
...
lib/gitlab/usage_data_counters/merge_request_counter.rb
0 → 100644
View file @
a8040a61
# frozen_string_literal: true
module
Gitlab
module
UsageDataCounters
class
MergeRequestCounter
<
BaseCounter
KNOWN_EVENTS
=
%w[create]
.
freeze
PREFIX
=
'merge_request'
end
end
end
spec/lib/gitlab/usage_data_counters/merge_request_counter_spec.rb
0 → 100644
View file @
a8040a61
# frozen_string_literal: true
require
'spec_helper'
describe
Gitlab
::
UsageDataCounters
::
MergeRequestCounter
do
it_behaves_like
'a redis usage counter'
,
'Merge Request'
,
:create
it_behaves_like
'a redis usage counter with totals'
,
:merge_request
,
create:
5
end
spec/lib/gitlab/usage_data_spec.rb
View file @
a8040a61
...
...
@@ -69,6 +69,7 @@ describe Gitlab::UsageData do
snippet_update:
a_kind_of
(
Integer
),
snippet_comment:
a_kind_of
(
Integer
),
merge_request_comment:
a_kind_of
(
Integer
),
merge_request_create:
a_kind_of
(
Integer
),
commit_comment:
a_kind_of
(
Integer
),
wiki_pages_create:
a_kind_of
(
Integer
),
wiki_pages_update:
a_kind_of
(
Integer
),
...
...
spec/services/merge_requests/create_service_spec.rb
View file @
a8040a61
...
...
@@ -2,7 +2,7 @@
require
'spec_helper'
describe
MergeRequests
::
CreateService
do
describe
MergeRequests
::
CreateService
,
:clean_gitlab_redis_shared_state
do
include
ProjectForksHelper
let
(
:project
)
{
create
(
:project
,
:repository
)
}
...
...
@@ -285,6 +285,12 @@ describe MergeRequests::CreateService do
end
end
end
it
'increments the usage data counter of create event'
do
counter
=
Gitlab
::
UsageDataCounters
::
MergeRequestCounter
expect
{
service
.
execute
}.
to
change
{
counter
.
read
(
:create
)
}.
by
(
1
)
end
end
it_behaves_like
'new issuable record that supports quick actions'
do
...
...
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