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
10131a4e
Commit
10131a4e
authored
Mar 02, 2021
by
Amy Qualls
Committed by
Heinrich Lee Yu
Mar 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix awkward phrasing in retarget messaging
Rephrasing for better notes after a user deletes a target branch.
parent
6043cbe5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/services/system_note_service.rb
app/services/system_note_service.rb
+1
-1
app/services/system_notes/merge_requests_service.rb
app/services/system_notes/merge_requests_service.rb
+2
-2
spec/services/system_notes/merge_requests_service_spec.rb
spec/services/system_notes/merge_requests_service_spec.rb
+1
-1
No files found.
app/services/system_note_service.rb
View file @
10131a4e
...
@@ -175,7 +175,7 @@ module SystemNoteService
...
@@ -175,7 +175,7 @@ module SystemNoteService
# Example Note text is based on event_type:
# Example Note text is based on event_type:
#
#
# update: "changed target branch from `Old` to `New`"
# update: "changed target branch from `Old` to `New`"
# delete: "
changed automatically target branch to `New` because `Old` was deleted
"
# delete: "
deleted the `Old` branch. This merge request now targets the `New` branch
"
#
#
# Returns the created Note object
# Returns the created Note object
def
change_branch
(
noteable
,
project
,
author
,
branch_type
,
event_type
,
old_branch
,
new_branch
)
def
change_branch
(
noteable
,
project
,
author
,
branch_type
,
event_type
,
old_branch
,
new_branch
)
...
...
app/services/system_notes/merge_requests_service.rb
View file @
10131a4e
...
@@ -90,14 +90,14 @@ module SystemNotes
...
@@ -90,14 +90,14 @@ module SystemNotes
# Example Note text is based on event_type:
# Example Note text is based on event_type:
#
#
# update: "changed target branch from `Old` to `New`"
# update: "changed target branch from `Old` to `New`"
# delete: "
changed automatically target branch to `New` because `Old` was deleted
"
# delete: "
deleted the `Old` branch. This merge request now targets the `New` branch
"
#
#
# Returns the created Note object
# Returns the created Note object
def
change_branch
(
branch_type
,
event_type
,
old_branch
,
new_branch
)
def
change_branch
(
branch_type
,
event_type
,
old_branch
,
new_branch
)
body
=
body
=
case
event_type
.
to_s
case
event_type
.
to_s
when
'delete'
when
'delete'
"
changed automatically
#{
branch_type
}
branch to `
#{
new_branch
}
` because `
#{
old_branch
}
` was deleted
"
"
deleted the `
#{
old_branch
}
` branch. This merge request now targets the `
#{
new_branch
}
` branch
"
when
'update'
when
'update'
"changed
#{
branch_type
}
branch from `
#{
old_branch
}
` to `
#{
new_branch
}
`"
"changed
#{
branch_type
}
branch from `
#{
old_branch
}
` to `
#{
new_branch
}
`"
else
else
...
...
spec/services/system_notes/merge_requests_service_spec.rb
View file @
10131a4e
...
@@ -189,7 +189,7 @@ RSpec.describe ::SystemNotes::MergeRequestsService do
...
@@ -189,7 +189,7 @@ RSpec.describe ::SystemNotes::MergeRequestsService do
subject
{
service
.
change_branch
(
'target'
,
'delete'
,
old_branch
,
new_branch
)
}
subject
{
service
.
change_branch
(
'target'
,
'delete'
,
old_branch
,
new_branch
)
}
it
'sets the note text'
do
it
'sets the note text'
do
expect
(
subject
.
note
).
to
eq
"
changed automatically target branch to `
#{
new_branch
}
` because `
#{
old_branch
}
` was deleted
"
expect
(
subject
.
note
).
to
eq
"
deleted the `
#{
old_branch
}
` branch. This merge request now targets the `
#{
new_branch
}
` branch
"
end
end
end
end
...
...
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