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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
ca701a08
Commit
ca701a08
authored
Feb 18, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-02-18
parents
ce97cfa4
557db7e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
changelogs/unreleased/17500-mr-multiple-issues-oxford-comma.yml
...logs/unreleased/17500-mr-multiple-issues-oxford-comma.yml
+5
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
spec/lib/gitlab/closing_issue_extractor_spec.rb
spec/lib/gitlab/closing_issue_extractor_spec.rb
+14
-0
No files found.
changelogs/unreleased/17500-mr-multiple-issues-oxford-comma.yml
0 → 100644
View file @
ca701a08
---
title
:
Update issue closing pattern to allow variations in punctuation
merge_request
:
17198
author
:
Vicky Chijwani
type
:
changed
config/initializers/1_settings.rb
View file @
ca701a08
...
...
@@ -294,7 +294,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)?|[Rr]esolv(?:e[sd]?|ing)|[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:
, *| +and +
)?)|([A-Z][A-Z0-9_]+-\d+))+)'
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)|[Ii]mplement(?:s|ed|ing)?)(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:
*,? +and +| *, *
)?)|([A-Z][A-Z0-9_]+-\d+))+)'
if
Settings
.
gitlab
[
'issue_closing_pattern'
].
nil?
Settings
.
gitlab
[
'default_projects_features'
]
||=
{}
Settings
.
gitlab
[
'webhook_timeout'
]
||=
10
Settings
.
gitlab
[
'max_attachment_size'
]
||=
10
...
...
spec/lib/gitlab/closing_issue_extractor_spec.rb
View file @
ca701a08
...
...
@@ -365,6 +365,20 @@ describe Gitlab::ClosingIssueExtractor do
.
to
match_array
([
issue
,
other_issue
,
third_issue
])
end
it
'allows oxford commas (comma before and) when referencing multiple issues'
do
message
=
"Closes
#{
reference
}
,
#{
reference2
}
, and
#{
reference3
}
"
expect
(
subject
.
closed_by_message
(
message
))
.
to
match_array
([
issue
,
other_issue
,
third_issue
])
end
it
'allows spaces before commas when referencing multiple issues'
do
message
=
"Closes
#{
reference
}
,
#{
reference2
}
, and
#{
reference3
}
"
expect
(
subject
.
closed_by_message
(
message
))
.
to
match_array
([
issue
,
other_issue
,
third_issue
])
end
it
'fetches issues in multi-line message'
do
message
=
"Awesome commit (closes
#{
reference
}
)
\n
Also fixes
#{
reference2
}
"
...
...
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