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
Boxiang Sun
gitlab-ce
Commits
a3d5c82f
Commit
a3d5c82f
authored
Sep 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly detect multiple issue URLs after 'Closes...' in MR descriptions
parent
598b1a17
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
changelogs/unreleased/dm-closing-issue-urls.yml
changelogs/unreleased/dm-closing-issue-urls.yml
+5
-0
lib/gitlab/closing_issue_extractor.rb
lib/gitlab/closing_issue_extractor.rb
+1
-1
spec/lib/gitlab/closing_issue_extractor_spec.rb
spec/lib/gitlab/closing_issue_extractor_spec.rb
+2
-2
No files found.
changelogs/unreleased/dm-closing-issue-urls.yml
0 → 100644
View file @
a3d5c82f
---
title
:
Correctly detect multiple issue URLs after 'Closes...' in MR descriptions
merge_request
:
author
:
type
:
fixed
lib/gitlab/closing_issue_extractor.rb
View file @
a3d5c82f
module
Gitlab
class
ClosingIssueExtractor
ISSUE_CLOSING_REGEX
=
begin
link_pattern
=
URI
.
regexp
(
%w(http https)
)
link_pattern
=
Banzai
::
Filter
::
AutolinkFilter
::
LINK_PATTERN
pattern
=
Gitlab
.
config
.
gitlab
.
issue_closing_pattern
pattern
=
pattern
.
sub
(
'%{issue_ref}'
,
"(?:(?:
#{
link_pattern
}
)|(?:
#{
Issue
.
reference_pattern
}
))"
)
...
...
spec/lib/gitlab/closing_issue_extractor_spec.rb
View file @
a3d5c82f
...
...
@@ -347,10 +347,10 @@ describe Gitlab::ClosingIssueExtractor do
end
it
"fetches cross-project URL references"
do
message
=
"Closes
#{
urls
.
project_issue_url
(
issue2
.
project
,
issue2
)
}
and
#{
reference
}
"
message
=
"Closes
#{
urls
.
project_issue_url
(
issue2
.
project
,
issue2
)
}
,
#{
reference
}
and
#{
urls
.
project_issue_url
(
other_issue
.
project
,
other_issue
)
}
"
expect
(
subject
.
closed_by_message
(
message
))
.
to
match_array
([
issue
,
issue2
])
.
to
match_array
([
issue
,
issue2
,
other_issue
])
end
it
"ignores invalid cross-project URL references"
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