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
b0d8e619
Commit
b0d8e619
authored
Dec 14, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip usage ping generation on GitLab.com
parent
d7ed14ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
app/services/submit_usage_ping_service.rb
app/services/submit_usage_ping_service.rb
+3
-0
spec/services/submit_usage_ping_service_spec.rb
spec/services/submit_usage_ping_service_spec.rb
+8
-0
No files found.
app/services/submit_usage_ping_service.rb
View file @
b0d8e619
...
...
@@ -17,6 +17,9 @@ class SubmitUsagePingService
SubmissionError
=
Class
.
new
(
StandardError
)
def
execute
# Disable usage ping for GitLab.com
# See https://gitlab.com/gitlab-org/gitlab/-/issues/292929 for details
return
if
Gitlab
.
com?
return
unless
Gitlab
::
CurrentSettings
.
usage_ping_enabled?
return
if
User
.
single_user
&
.
requires_usage_stats_consent?
...
...
spec/services/submit_usage_ping_service_spec.rb
View file @
b0d8e619
...
...
@@ -80,6 +80,14 @@ RSpec.describe SubmitUsagePingService do
end
end
context
'when GitLab.com'
do
before
do
allow
(
Gitlab
).
to
receive
(
:com?
).
and_return
(
true
)
end
it_behaves_like
'does not run'
end
context
'when usage ping is disabled'
do
before
do
stub_application_setting
(
usage_ping_enabled:
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