Commit 653be1fe authored by Marin Jankovski's avatar Marin Jankovski

Merge branch 'issue-closing-pattern' into 'master'

Extend issue clossing pattern

New: "Resolve", "Resolves", "Resolved", "Resolving" and "Close"

Now matches those supported by [GitHub](https://help.github.com/articles/closing-issues-via-commit-messages/), with the addition of the -ing forms.

See merge request !1475
parents a3681c0f fd21d72b
......@@ -42,6 +42,7 @@ v 7.8.0 (unreleased)
-
- Submit comment on command-enter
- Notify all members of a group when that group is mentioned in a comment, for example: `@gitlab-org` or `@sales`.
- Extend issue clossing pattern to include "Resolve", "Resolves", "Resolved", "Resolving" and "Close"
-
- Fix long broadcast message cut-off on left sidebar (Visay Keo)
- Add Project Avatars (Steven Thonus and Hannes Rosenögger)
......
......@@ -114,7 +114,7 @@ Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].
Settings.gitlab['signin_enabled'] ||= true if Settings.gitlab['signin_enabled'].nil?
Settings.gitlab['restricted_visibility_levels'] = Settings.send(:verify_constant_array, Gitlab::VisibilityLevel, Settings.gitlab['restricted_visibility_levels'], [])
Settings.gitlab['username_changing_enabled'] = true if Settings.gitlab['username_changing_enabled'].nil?
Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]|ing)|[Ff]ix(?:e[sd]|ing)?) +(?:(?:issues? +)?#\d+(?:(?:, *| +and +)?))+)' if Settings.gitlab['issue_closing_pattern'].nil?
Settings.gitlab['issue_closing_pattern'] = '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing)) +(?:(?:issues? +)?#\d+(?:(?:, *| +and +)?))+)' if Settings.gitlab['issue_closing_pattern'].nil?
Settings.gitlab['default_projects_features'] ||= {}
Settings.gitlab['webhook_timeout'] ||= 10
Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil?
......
......@@ -27,13 +27,103 @@ describe Gitlab::ClosingIssueExtractor do
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Closing ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "closing ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Close ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "close ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Awesome commit (Fixes ##{iid1})"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Awesome commit (fixes ##{iid1})"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Awesome commit (fix ##{iid1})"
message = "Fixed ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "fixed ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Fixing ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "fixing ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Fix ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "fix ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Awesome commit (Resolves ##{iid1})"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Awesome commit (resolves ##{iid1})"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Resolved ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "resolved ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Resolving ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "resolving ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "Resolve ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
it do
message = "resolve ##{iid1}"
subject.closed_by_message_in_project(message, project).should == [issue]
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment