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
5eb2f8f8
Commit
5eb2f8f8
authored
Feb 19, 2021
by
Alishan Ladhani
Committed by
Mayra Cabrera
Feb 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with non-canary prod events
They were being labelled as development
parent
44b5c7a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
lib/gitlab/tracking/standard_context.rb
lib/gitlab/tracking/standard_context.rb
+6
-2
spec/lib/gitlab/tracking/standard_context_spec.rb
spec/lib/gitlab/tracking/standard_context_spec.rb
+18
-2
No files found.
lib/gitlab/tracking/standard_context.rb
View file @
5eb2f8f8
...
@@ -15,10 +15,14 @@ module Gitlab
...
@@ -15,10 +15,14 @@ module Gitlab
end
end
def
environment
def
environment
return
'production'
if
Gitlab
.
com_and_canary?
return
'staging'
if
Gitlab
.
staging?
return
'staging'
if
Gitlab
.
staging?
return
'production'
if
Gitlab
.
com?
return
'org'
if
Gitlab
.
org?
return
'self-managed'
if
Rails
.
env
.
production?
'development'
'development'
end
end
...
...
spec/lib/gitlab/tracking/standard_context_spec.rb
View file @
5eb2f8f8
...
@@ -22,7 +22,7 @@ RSpec.describe Gitlab::Tracking::StandardContext do
...
@@ -22,7 +22,7 @@ RSpec.describe Gitlab::Tracking::StandardContext do
context
'staging'
do
context
'staging'
do
before
do
before
do
allow
(
Gitlab
).
to
receive
(
:staging?
).
and_return
(
true
)
stub_config_setting
(
url:
'https://staging.gitlab.com'
)
end
end
include_examples
'contains environment'
,
'staging'
include_examples
'contains environment'
,
'staging'
...
@@ -30,11 +30,27 @@ RSpec.describe Gitlab::Tracking::StandardContext do
...
@@ -30,11 +30,27 @@ RSpec.describe Gitlab::Tracking::StandardContext do
context
'production'
do
context
'production'
do
before
do
before
do
allow
(
Gitlab
).
to
receive
(
:com_and_canary?
).
and_return
(
true
)
stub_config_setting
(
url:
'https://gitlab.com'
)
end
end
include_examples
'contains environment'
,
'production'
include_examples
'contains environment'
,
'production'
end
end
context
'org'
do
before
do
stub_config_setting
(
url:
'https://dev.gitlab.org'
)
end
include_examples
'contains environment'
,
'org'
end
context
'other self-managed instance'
do
before
do
stub_rails_env
(
'production'
)
end
include_examples
'contains environment'
,
'self-managed'
end
end
end
it
'contains source'
do
it
'contains source'
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