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
a5a94d13
Commit
a5a94d13
authored
Jan 16, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix extracting Sentry external URL when URL is nil
parent
01ec170d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
app/models/error_tracking/project_error_tracking_setting.rb
app/models/error_tracking/project_error_tracking_setting.rb
+1
-1
changelogs/unreleased/pl-nil-guard-extract-sentry-external-url.yml
...s/unreleased/pl-nil-guard-extract-sentry-external-url.yml
+5
-0
spec/models/error_tracking/project_error_tracking_setting_spec.rb
...els/error_tracking/project_error_tracking_setting_spec.rb
+16
-0
No files found.
app/models/error_tracking/project_error_tracking_setting.rb
View file @
a5a94d13
...
...
@@ -128,7 +128,7 @@ module ErrorTracking
# ->
# http://HOST/ORG/PROJECT
def
self
.
extract_sentry_external_url
(
url
)
url
.
sub
(
'api/0/projects/'
,
''
)
url
&
.
sub
(
'api/0/projects/'
,
''
)
end
def
api_host
...
...
changelogs/unreleased/pl-nil-guard-extract-sentry-external-url.yml
0 → 100644
View file @
a5a94d13
---
title
:
Fix extracting Sentry external URL when URL is nil
merge_request
:
23162
author
:
type
:
fixed
spec/models/error_tracking/project_error_tracking_setting_spec.rb
View file @
a5a94d13
...
...
@@ -64,6 +64,22 @@ describe ErrorTracking::ProjectErrorTrackingSetting do
end
end
describe
'.extract_sentry_external_url'
do
subject
{
described_class
.
extract_sentry_external_url
(
sentry_url
)
}
describe
'when passing a URL'
do
let
(
:sentry_url
)
{
'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project'
}
it
{
is_expected
.
to
eq
(
'https://sentrytest.gitlab.com/sentry-org/sentry-project'
)
}
end
describe
'when passing nil'
do
let
(
:sentry_url
)
{
nil
}
it
{
is_expected
.
to
be_nil
}
end
end
describe
'#sentry_external_url'
do
let
(
:sentry_url
)
{
'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project'
}
...
...
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