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
3fe53872
Commit
3fe53872
authored
Aug 27, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-08-27
parents
339fa37e
81bc745b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
11 deletions
+28
-11
app/services/merge_requests/build_service.rb
app/services/merge_requests/build_service.rb
+8
-11
app/views/shared/milestones/_milestone.html.haml
app/views/shared/milestones/_milestone.html.haml
+3
-0
changelogs/unreleased/49292-add-group-name-badge-under-milestone.yml
...unreleased/49292-add-group-name-badge-under-milestone.yml
+5
-0
changelogs/unreleased/fix-mr-title-fallback-logic.yml
changelogs/unreleased/fix-mr-title-fallback-logic.yml
+5
-0
spec/features/dashboard/milestones_spec.rb
spec/features/dashboard/milestones_spec.rb
+3
-0
spec/services/merge_requests/build_service_spec.rb
spec/services/merge_requests/build_service_spec.rb
+4
-0
No files found.
app/services/merge_requests/build_service.rb
View file @
3fe53872
...
...
@@ -129,8 +129,7 @@ module MergeRequests
#
def
assign_title_and_description
assign_title_and_description_from_single_commit
assign_title_from_issue
if
target_project
.
issues_enabled?
||
target_project
.
external_issue_tracker
merge_request
.
title
||=
title_from_issue
if
target_project
.
issues_enabled?
||
target_project
.
external_issue_tracker
merge_request
.
title
||=
source_branch
.
titleize
.
humanize
merge_request
.
title
=
wip_title
if
compare_commits
.
empty?
...
...
@@ -160,20 +159,18 @@ module MergeRequests
merge_request
.
description
||=
commit
.
description
.
try
(
:strip
)
end
def
assign_
title_from_issue
def
title_from_issue
return
unless
issue
merge_request
.
title
=
"Resolve
\"
#{
issue
.
title
}
\"
"
if
issue
.
is_a?
(
Issue
)
return
"Resolve
\"
#{
issue
.
title
}
\"
"
if
issue
.
is_a?
(
Issue
)
return
if
merge_request
.
title
.
present
?
return
if
issue_iid
.
blank
?
if
issue_iid
.
present?
title_parts
=
[
"Resolve
#{
issue
.
to_reference
}
"
]
branch_title
=
source_branch
.
downcase
.
remove
(
issue_iid
.
downcase
).
titleize
.
humanize
title_parts
=
[
"Resolve
#{
issue
.
to_reference
}
"
]
branch_title
=
source_branch
.
downcase
.
remove
(
issue_iid
.
downcase
).
titleize
.
humanize
title_parts
<<
"
\"
#{
branch_title
}
\"
"
if
branch_title
.
present?
merge_request
.
title
=
title_parts
.
join
(
' '
)
end
title_parts
<<
"
\"
#{
branch_title
}
\"
"
if
branch_title
.
present?
title_parts
.
join
(
' '
)
end
def
issue_iid
...
...
app/views/shared/milestones/_milestone.html.haml
View file @
3fe53872
...
...
@@ -16,6 +16,9 @@
=
milestone_date_range
(
milestone
)
%div
=
render
(
'shared/milestone_expired'
,
milestone:
milestone
)
-
if
milestone
.
group_milestone?
.label-badge.label-badge-blue.d-inline-block
=
milestone
.
group
.
full_name
-
if
milestone
.
legacy_group_milestone?
.projects
-
milestone
.
milestones
.
each
do
|
milestone
|
...
...
changelogs/unreleased/49292-add-group-name-badge-under-milestone.yml
0 → 100644
View file @
3fe53872
---
title
:
Add group name badge under group milestone
merge_request
:
21384
author
:
type
:
added
changelogs/unreleased/fix-mr-title-fallback-logic.yml
0 → 100644
View file @
3fe53872
---
title
:
Fix fallback logic for automatic MR title assignment
merge_request
:
20930
author
:
Franz Liedke
type
:
fixed
spec/features/dashboard/milestones_spec.rb
View file @
3fe53872
...
...
@@ -13,8 +13,10 @@ describe 'Dashboard > Milestones' do
describe
'as logged-in user'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let!
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let!
(
:milestone2
)
{
create
(
:milestone
,
group:
group
)
}
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
...
...
@@ -24,6 +26,7 @@ describe 'Dashboard > Milestones' do
it
'sees milestones'
do
expect
(
current_path
).
to
eq
dashboard_milestones_path
expect
(
page
).
to
have_content
(
milestone
.
title
)
expect
(
page
).
to
have_content
(
group
.
name
)
end
end
end
spec/services/merge_requests/build_service_spec.rb
View file @
3fe53872
...
...
@@ -169,6 +169,10 @@ describe MergeRequests::BuildService do
end
end
it
'uses the title of the commit as the title of the merge request'
do
expect
(
merge_request
.
title
).
to
eq
(
'Initial commit'
)
end
it
'appends the closing description'
do
expected_description
=
[
commit_description
,
closing_message
].
compact
.
join
(
"
\n\n
"
)
...
...
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