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
c04e1ce3
Commit
c04e1ce3
authored
Jan 30, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add license check
parent
89f62d65
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
2 deletions
+8
-2
ee/lib/gitlab/metrics/multi_file_editor.rb
ee/lib/gitlab/metrics/multi_file_editor.rb
+2
-0
lib/api/commits.rb
lib/api/commits.rb
+1
-1
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
+2
-0
spec/requests/api/commits_spec.rb
spec/requests/api/commits_spec.rb
+3
-1
No files found.
ee/lib/gitlab/metrics/multi_file_editor.rb
View file @
c04e1ce3
...
...
@@ -10,6 +10,8 @@ module Gitlab
end
def
record
return
unless
::
License
.
feature_available?
(
:ide
)
::
Gitlab
::
Metrics
.
counter
(
METRIC_NAME
,
'Total number of commits using the multi-file web editor'
,
...
...
lib/api/commits.rb
View file @
c04e1ce3
...
...
@@ -71,7 +71,7 @@ module API
if
result
[
:status
]
==
:success
commit_detail
=
user_project
.
repository
.
commit
(
result
[
:result
])
if
verified_request?
&&
current_request
.
env
[
'warden'
]
&
.
authenticate
if
verified_request?
&&
current_request
.
env
[
'warden'
]
&
.
authenticate
::
Gitlab
::
Metrics
::
MultiFileEditor
.
new
(
user_project
,
current_user
,
commit_detail
).
record
end
...
...
spec/ee/spec/lib/gitlab/metrics/multi_file_editor_spec.rb
View file @
c04e1ce3
...
...
@@ -24,6 +24,8 @@ describe Gitlab::Metrics::MultiFileEditor do
describe
'.record'
do
it
'records the right metrics'
do
stub_licensed_features
(
ide:
true
)
expect
(
::
Gitlab
::
Metrics
).
to
receive
(
:counter
).
with
(
*
params
)
subject
.
record
...
...
spec/requests/api/commits_spec.rb
View file @
c04e1ce3
...
...
@@ -246,7 +246,9 @@ describe API::Commits do
end
it
'does not call the metrics using access token authentication'
do
post
api
(
url
,
user
),
valid_c_params
stub_licensed_features
(
ide:
true
)
post
api
(
url
,
user
),
valid_c_paramss
expect_any_instance_of
(
::
Gitlab
::
Metrics
::
MultiFileEditor
).
not_to
receive
(
:record
)
end
...
...
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