summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-05 22:04:49 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-08 13:56:12 +0100
commitfd21d72b1b7042566b6deff184ddcc86cc4907f4 (patch)
tree6efc7b76f54eff2bbf9b31d56d494bd9e0b869a8
parent0a34f2dcb562098c481140246f7ac22683b38d76 (diff)
downloadgitlab-ce-fd21d72b1b7042566b6deff184ddcc86cc4907f4.tar.gz
Extend issue closing pattern.
-rw-r--r--CHANGELOG1
-rw-r--r--config/initializers/1_settings.rb2
-rw-r--r--spec/lib/gitlab/closing_issue_extractor_spec.rb92
3 files changed, 93 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 74d4031ebaf..d43775faba7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -39,6 +39,7 @@ v 7.8.0
-
- 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)
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 4e015f1646b..d7c1a8428ac 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -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?
diff --git a/spec/lib/gitlab/closing_issue_extractor_spec.rb b/spec/lib/gitlab/closing_issue_extractor_spec.rb
index 867455daf23..0a1f3fa351d 100644
--- a/spec/lib/gitlab/closing_issue_extractor_spec.rb
+++ b/spec/lib/gitlab/closing_issue_extractor_spec.rb
@@ -28,12 +28,102 @@ describe Gitlab::ClosingIssueExtractor do
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