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
93727abe
Commit
93727abe
authored
May 10, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
602e8f11
23e6ca22
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
2 deletions
+15
-2
app/models/project_services/jira_service.rb
app/models/project_services/jira_service.rb
+1
-0
app/services/projects/after_import_service.rb
app/services/projects/after_import_service.rb
+1
-1
changelogs/unreleased/60180-jira-service-fix-nil-on-find-call.yml
...gs/unreleased/60180-jira-service-fix-nil-on-find-call.yml
+5
-0
spec/models/project_services/jira_service_spec.rb
spec/models/project_services/jira_service_spec.rb
+7
-0
spec/services/projects/after_import_service_spec.rb
spec/services/projects/after_import_service_spec.rb
+1
-1
No files found.
app/models/project_services/jira_service.rb
View file @
93727abe
...
...
@@ -265,6 +265,7 @@ class JiraService < IssueTrackerService
def
find_remote_link
(
issue
,
url
)
links
=
jira_request
{
issue
.
remotelink
.
all
}
return
unless
links
links
.
find
{
|
link
|
link
.
object
[
"url"
]
==
url
}
end
...
...
app/services/projects/after_import_service.rb
View file @
93727abe
...
...
@@ -9,7 +9,7 @@ module Projects
end
def
execute
Projects
::
HousekeepingService
.
new
(
@project
,
:gc
).
execute
do
Projects
::
HousekeepingService
.
new
(
@project
).
execute
do
repository
.
delete_all_refs_except
(
RESERVED_REF_PREFIXES
)
end
rescue
Projects
::
HousekeepingService
::
LeaseTaken
=>
e
...
...
changelogs/unreleased/60180-jira-service-fix-nil-on-find-call.yml
0 → 100644
View file @
93727abe
---
title
:
'
Resolved
JIRA
service:
NoMethodError:
undefined
method
'
'
find'
'
for
nil:NilClass'
merge_request
:
28206
author
:
type
:
fixed
spec/models/project_services/jira_service_spec.rb
View file @
93727abe
...
...
@@ -166,6 +166,13 @@ describe JiraService do
).
once
end
it
'does not fail if remote_link.all on issue returns nil'
do
allow
(
JIRA
::
Resource
::
Remotelink
).
to
receive
(
:all
).
and_return
(
nil
)
expect
{
@jira_service
.
close_issue
(
resource
,
ExternalIssue
.
new
(
'JIRA-123'
,
project
))
}
.
not_to
raise_error
(
NoMethodError
)
end
# Check https://developer.atlassian.com/jiradev/jira-platform/guides/other/guide-jira-remote-issue-links/fields-in-remote-issue-links
# for more information
it
'creates Remote Link reference in JIRA for comment'
do
...
...
spec/services/projects/after_import_service_spec.rb
View file @
93727abe
...
...
@@ -15,7 +15,7 @@ describe Projects::AfterImportService do
describe
'#execute'
do
before
do
allow
(
Projects
::
HousekeepingService
)
.
to
receive
(
:new
).
with
(
project
,
:gc
).
and_return
(
housekeeping_service
)
.
to
receive
(
:new
).
with
(
project
).
and_return
(
housekeeping_service
)
allow
(
housekeeping_service
)
.
to
receive
(
:execute
).
and_yield
...
...
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