Commit fd21d72b authored by Douwe Maan's avatar Douwe Maan

Extend issue closing pattern.

parent 0a34f2dc
...@@ -39,6 +39,7 @@ v 7.8.0 ...@@ -39,6 +39,7 @@ v 7.8.0
- -
- Submit comment on command-enter - 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`. - 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) - Fix long broadcast message cut-off on left sidebar (Visay Keo)
- Add Project Avatars (Steven Thonus and Hannes Rosenögger) - Add Project Avatars (Steven Thonus and Hannes Rosenögger)
......
...@@ -114,7 +114,7 @@ Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled']. ...@@ -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['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['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['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['default_projects_features'] ||= {}
Settings.gitlab['webhook_timeout'] ||= 10 Settings.gitlab['webhook_timeout'] ||= 10
Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil? Settings.gitlab.default_projects_features['issues'] = true if Settings.gitlab.default_projects_features['issues'].nil?
......
...@@ -27,13 +27,103 @@ describe Gitlab::ClosingIssueExtractor do ...@@ -27,13 +27,103 @@ describe Gitlab::ClosingIssueExtractor do
subject.closed_by_message_in_project(message, project).should == [issue] subject.closed_by_message_in_project(message, project).should == [issue]
end 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 it do
message = "Awesome commit (fixes ##{iid1})" message = "Awesome commit (fixes ##{iid1})"
subject.closed_by_message_in_project(message, project).should == [issue] subject.closed_by_message_in_project(message, project).should == [issue]
end end
it do 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] subject.closed_by_message_in_project(message, project).should == [issue]
end end
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