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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
96c4a15e
Commit
96c4a15e
authored
Jul 28, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'sh-augment-lograge-output'
# Conflicts: # config/initializers/lograge.rb
parents
9bc176b2
b5aac468
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
19 deletions
+43
-19
app/assets/javascripts/integrations/integration_settings_form.js
...ets/javascripts/integrations/integration_settings_form.js
+1
-1
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+6
-2
changelogs/unreleased/32483-jira-error.yml
changelogs/unreleased/32483-jira-error.yml
+4
-0
config/prometheus/additional_metrics.yml
config/prometheus/additional_metrics.yml
+4
-4
doc/ci/environments.md
doc/ci/environments.md
+1
-2
spec/features/projects/services/jira_service_spec.rb
spec/features/projects/services/jira_service_spec.rb
+1
-1
spec/javascripts/integrations/integration_settings_form_spec.js
...avascripts/integrations/integration_settings_form_spec.js
+2
-2
spec/models/project_services/jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+24
-7
No files found.
app/assets/javascripts/integrations/integration_settings_form.js
View file @
96c4a15e
...
...
@@ -102,7 +102,7 @@ export default class IntegrationSettingsForm {
})
.
done
((
res
)
=>
{
if
(
res
.
error
)
{
new
Flash
(
res
.
message
,
null
,
null
,
{
new
Flash
(
`
${
res
.
message
}
${
res
.
service_response
}
`
,
null
,
null
,
{
title
:
'
Save anyway
'
,
clickHandler
:
(
e
)
=>
{
e
.
preventDefault
();
...
...
app/models/project_services/jira_service.rb
View file @
96c4a15e
...
...
@@ -160,7 +160,10 @@ class JiraService < IssueTrackerService
def
test
(
_
)
result
=
test_settings
{
success:
result
.
present?
,
result:
result
}
success
=
result
.
present?
result
=
@error
if
@error
&&
!
success
{
success:
success
,
result:
result
}
end
# JIRA does not need test data.
...
...
@@ -288,7 +291,8 @@ class JiraService < IssueTrackerService
yield
rescue
Timeout
::
Error
,
Errno
::
EINVAL
,
Errno
::
ECONNRESET
,
Errno
::
ECONNREFUSED
,
URI
::
InvalidURIError
,
JIRA
::
HTTPError
,
OpenSSL
::
SSL
::
SSLError
=>
e
Rails
.
logger
.
info
"
#{
self
.
class
.
name
}
Send message ERROR:
#{
client_url
}
-
#{
e
.
message
}
"
@error
=
e
.
message
Rails
.
logger
.
info
"
#{
self
.
class
.
name
}
Send message ERROR:
#{
client_url
}
-
#{
@error
}
"
nil
end
...
...
changelogs/unreleased/32483-jira-error.yml
0 → 100644
View file @
96c4a15e
---
title
:
Display specific error message when JIRA test fails
merge_request
:
author
:
config/prometheus/additional_metrics.yml
View file @
96c4a15e
-
group
:
HA Proxy
-
group
:
Response metrics (HA Proxy)
priority
:
10
metrics
:
-
title
:
"
Throughput"
...
...
@@ -19,7 +19,7 @@
-
query_range
:
'
sum(rate(haproxy_frontend_http_responses_total{code="5xx",%{environment_filter}}[2m]))
/
sum(rate(haproxy_frontend_http_responses_total{%{environment_filter}}[2m]))'
label
:
HTTP Errors
unit
:
"
%"
-
group
:
AWS Elastic Load Balancer
-
group
:
Response metrics (AWS ELB)
priority
:
10
metrics
:
-
title
:
"
Throughput"
...
...
@@ -50,7 +50,7 @@
-
query_range
:
'
sum(aws_elb_httpcode_backend_5_xx_sum{%{environment_filter}})
/
sum(aws_elb_request_count_sum{%{environment_filter}})'
label
:
HTTP Errors
unit
:
"
%"
-
group
:
NGINX
-
group
:
Response metrics (NGINX)
priority
:
10
metrics
:
-
title
:
"
Throughput"
...
...
@@ -80,7 +80,7 @@
-
query_range
:
'
sum(rate(nginx_responses_total{status_code="5xx",
%{environment_filter}}[2m]))
/
sum(rate(nginx_requests_total{server_zone!="*",
server_zone!="_",
%{environment_filter}}[2m]))'
label
:
HTTP Errors
unit
:
"
%"
-
group
:
Kubernetes
-
group
:
System metrics (Kubernetes)
priority
:
5
metrics
:
-
title
:
"
Memory
Usage"
...
...
doc/ci/environments.md
View file @
96c4a15e
...
...
@@ -607,8 +607,7 @@ exist, you should see something like:
-
With GitLab 9.2, all deployments to an environment are shown directly on the
monitoring dashboard
If your application is deployed on Kubernetes and you have enabled Prometheus
collecting metrics, you can monitor the performance behavior of your app
If you have enabled Prometheus for collecting metrics, you can monitor the performance behavior of your app
through the environments.
Once configured, GitLab will attempt to retrieve performance metrics for any
...
...
spec/features/projects/services/jira_service_spec.rb
View file @
96c4a15e
...
...
@@ -62,7 +62,7 @@ feature 'Setup Jira service', :js do
click_button
(
'Test settings and save changes'
)
wait_for_requests
expect
(
find
(
'.flash-container-page'
)).
to
have_content
'Test failed.'
expect
(
find
(
'.flash-container-page'
)).
to
have_content
'Test failed.
message
'
expect
(
find
(
'.flash-container-page'
)).
to
have_content
'Save anyway'
find
(
'.flash-alert .flash-action'
).
trigger
(
'click'
)
...
...
spec/javascripts/integrations/integration_settings_form_spec.js
View file @
96c4a15e
...
...
@@ -135,10 +135,10 @@ describe('IntegrationSettingsForm', () => {
integrationSettingsForm
.
testSettings
(
formData
);
deferred
.
resolve
({
error
:
true
,
message
:
errorMessage
});
deferred
.
resolve
({
error
:
true
,
message
:
errorMessage
,
service_response
:
'
some error
'
});
const
$flashContainer
=
$
(
'
.flash-container
'
);
expect
(
$flashContainer
.
find
(
'
.flash-text
'
).
text
()).
toEqual
(
errorMessage
);
expect
(
$flashContainer
.
find
(
'
.flash-text
'
).
text
()).
toEqual
(
'
Test failed. some error
'
);
expect
(
$flashContainer
.
find
(
'
.flash-action
'
)).
toBeDefined
();
expect
(
$flashContainer
.
find
(
'
.flash-action
'
).
text
()).
toEqual
(
'
Save anyway
'
);
});
...
...
spec/models/project_services/jira_service_spec.rb
View file @
96c4a15e
...
...
@@ -197,21 +197,38 @@ describe JiraService do
)
end
def
test_settings
(
api_url
)
def
test_settings
(
api_url
=
nil
)
api_url
||=
'jira.example.com'
test_url
=
"http://
#{
api_url
}
/rest/api/2/serverInfo"
WebMock
.
stub_request
(
:get
,
test_url
).
with
(
basic_auth:
%w(jira_username jira_password)
).
to_return
(
body:
{
url:
'http://url'
}.
to_json
)
jira_service
.
test
_settings
jira_service
.
test
(
nil
)
end
it
'tries to get JIRA project with URL when API URL not set'
do
test_settings
(
'jira.example.com'
)
context
'when the test succeeds'
do
it
'tries to get JIRA project with URL when API URL not set'
do
test_settings
(
'jira.example.com'
)
end
it
'returns correct result'
do
expect
(
test_settings
).
to
eq
(
{
success:
true
,
result:
{
'url'
=>
'http://url'
}
})
end
it
'tries to get JIRA project with API URL if set'
do
jira_service
.
update
(
api_url:
'http://jira.api.com'
)
test_settings
(
'jira.api.com'
)
end
end
it
'tries to get JIRA project with API URL if set'
do
jira_service
.
update
(
api_url:
'http://jira.api.com'
)
test_settings
(
'jira.api.com'
)
context
'when the test fails'
do
it
'returns result with the error'
do
test_url
=
'http://jira.example.com/rest/api/2/serverInfo'
WebMock
.
stub_request
(
:get
,
test_url
).
with
(
basic_auth:
%w(jira_username jira_password)
)
.
to_raise
(
JIRA
::
HTTPError
.
new
(
double
(
message:
'Some specific failure.'
)))
expect
(
jira_service
.
test
(
nil
)).
to
eq
(
{
success:
false
,
result:
'Some specific failure.'
})
end
end
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