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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
4e4a29ad
Commit
4e4a29ad
authored
Oct 01, 2017
by
Guilherme Vieira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "implements" to the default issue closing message regex
parent
6c33fb84
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
2 deletions
+47
-2
changelogs/unreleased/close-issue-by-implements.yml
changelogs/unreleased/close-issue-by-implements.yml
+5
-0
config/gitlab.yml.example
config/gitlab.yml.example
+1
-1
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
+40
-0
No files found.
changelogs/unreleased/close-issue-by-implements.yml
0 → 100644
View file @
4e4a29ad
---
title
:
"
Add
\"
implements
\"
to
the
default
issue
closing
message
regex"
merge_request
:
14612
author
:
Guilherme Vieira
type
:
added
config/gitlab.yml.example
View file @
4e4a29ad
...
...
@@ -89,7 +89,7 @@ production: &base
# This happens when the commit is pushed or merged into the default branch of a project.
# When not specified the default issue_closing_pattern as specified below will be used.
# Tip: you can test your closing pattern at http://rubular.com.
# issue_closing_pattern: '((?:[Cc]los(?:e[sd]?|ing)|[Ff]ix(?:e[sd]|ing)?|[Rr]esolv(?:e[sd]?|ing))(:?) +(?:(?:issues? +)?%{issue_ref}(?:(?:, *| +and +)?)|([A-Z][A-Z0-9_]+-\d+))+)'
# 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+))+)'
## Default project features settings
default_projects_features:
...
...
config/initializers/1_settings.rb
View file @
4e4a29ad
...
...
@@ -257,7 +257,7 @@ Settings.gitlab['signup_enabled'] ||= true if Settings.gitlab['signup_enabled'].
Settings
.
gitlab
[
'password_authentication_enabled'
]
||=
true
if
Settings
.
gitlab
[
'password_authentication_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))(:?) +(?:(?: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 @
4e4a29ad
...
...
@@ -254,6 +254,46 @@ describe Gitlab::ClosingIssueExtractor do
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"Implement:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"Implements:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"Implemented:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"Implementing:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"implement:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"implements:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"implemented:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
it
do
message
=
"implementing:
#{
reference
}
"
expect
(
subject
.
closed_by_message
(
message
)).
to
eq
([
issue
])
end
context
'with an external issue tracker reference'
do
it
'extracts the referenced issue'
do
jira_project
=
create
(
:jira_project
,
name:
'JIRA_EXT1'
)
...
...
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