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
9d854558
Commit
9d854558
authored
Oct 19, 2021
by
Luke Duncalfe
Committed by
Alex Kalderimis
Oct 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use default timeouts for Jira calls
https://gitlab.com/gitlab-org/gitlab/-/issues/343174
Changelog: changed
parent
4ce6e16a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
app/models/integrations/jira.rb
app/models/integrations/jira.rb
+0
-1
lib/gitlab/jira/http_client.rb
lib/gitlab/jira/http_client.rb
+0
-1
spec/models/integrations/jira_spec.rb
spec/models/integrations/jira_spec.rb
+13
-1
No files found.
app/models/integrations/jira.rb
View file @
9d854558
...
...
@@ -89,7 +89,6 @@ module Integrations
site:
URI
.
join
(
url
,
'/'
).
to_s
.
delete_suffix
(
'/'
),
# Intended to find the root
context_path:
(
url
.
path
.
presence
||
'/'
).
delete_suffix
(
'/'
),
auth_type: :basic
,
read_timeout:
120
,
use_cookies:
true
,
additional_cookies:
[
'OBBasicAuth=fromDialog'
],
use_ssl:
url
.
scheme
==
'https'
...
...
lib/gitlab/jira/http_client.rb
View file @
9d854558
...
...
@@ -32,7 +32,6 @@ module Gitlab
request_params
=
{
headers:
headers
}
request_params
[
:body
]
=
body
if
body
.
present?
request_params
[
:headers
][
:Cookie
]
=
get_cookies
if
options
[
:use_cookies
]
request_params
[
:timeout
]
=
options
[
:read_timeout
]
if
options
[
:read_timeout
]
request_params
[
:base_uri
]
=
uri
.
to_s
request_params
.
merge!
(
auth_params
)
...
...
spec/models/integrations/jira_spec.rb
View file @
9d854558
...
...
@@ -495,6 +495,18 @@ RSpec.describe Integrations::Jira do
end
end
describe
'#client'
do
it
'uses the default GitLab::HTTP timeouts'
do
timeouts
=
Gitlab
::
HTTP
::
DEFAULT_TIMEOUT_OPTIONS
stub_request
(
:get
,
'http://jira.example.com/foo'
)
expect
(
Gitlab
::
HTTP
).
to
receive
(
:httparty_perform_request
)
.
with
(
Net
::
HTTP
::
Get
,
'/foo'
,
hash_including
(
timeouts
)).
and_call_original
jira_integration
.
client
.
get
(
'/foo'
)
end
end
describe
'#find_issue'
do
let
(
:issue_key
)
{
'JIRA-123'
}
let
(
:issue_url
)
{
"
#{
url
}
/rest/api/2/issue/
#{
issue_key
}
"
}
...
...
@@ -503,7 +515,7 @@ RSpec.describe Integrations::Jira do
stub_request
(
:get
,
issue_url
).
with
(
basic_auth:
[
username
,
password
])
end
it
'call the Jira API to get the issue'
do
it
'call
s
the Jira API to get the issue'
do
jira_integration
.
find_issue
(
issue_key
)
expect
(
WebMock
).
to
have_requested
(
:get
,
issue_url
)
...
...
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