提交 a3d5c82f 编写于 作者: D Douwe Maan

Correctly detect multiple issue URLs after 'Closes...' in MR descriptions

上级 598b1a17
---
title: Correctly detect multiple issue URLs after 'Closes...' in MR descriptions
merge_request:
author:
type: fixed
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}))")
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册