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
3e8fec12
Commit
3e8fec12
authored
Sep 28, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix suggested squashed messages for MR
parent
1036b045
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
20 deletions
+11
-20
app/serializers/merge_request_poll_cached_widget_entity.rb
app/serializers/merge_request_poll_cached_widget_entity.rb
+3
-3
changelogs/unreleased/id-fix-squash-messages.yml
changelogs/unreleased/id-fix-squash-messages.yml
+5
-0
spec/serializers/merge_request_poll_cached_widget_entity_spec.rb
...rializers/merge_request_poll_cached_widget_entity_spec.rb
+3
-17
No files found.
app/serializers/merge_request_poll_cached_widget_entity.rb
View file @
3e8fec12
...
...
@@ -15,7 +15,7 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity
expose
:target_project_id
expose
:squash
expose
:rebase_in_progress?
,
as: :rebase_in_progress
expose
:default_squash_commit_message
,
if:
->
(
merge_request
,
_
)
{
merge_request
.
mergeable?
}
expose
:default_squash_commit_message
expose
:commits_count
expose
:merge_ongoing?
,
as: :merge_ongoing
expose
:work_in_progress?
,
as: :work_in_progress
...
...
@@ -25,10 +25,10 @@ class MergeRequestPollCachedWidgetEntity < IssuableEntity
expose
:source_branch_exists?
,
as: :source_branch_exists
expose
:branch_missing?
,
as: :branch_missing
expose
:commits_without_merge_commits
,
using:
MergeRequestWidgetCommitEntity
,
if:
->
(
merge_request
,
_
)
{
merge_request
.
mergeable?
}
do
|
merge_request
|
expose
:commits_without_merge_commits
,
using:
MergeRequestWidgetCommitEntity
do
|
merge_request
|
merge_request
.
recent_commits
.
without_merge_commits
end
expose
:diff_head_sha
do
|
merge_request
|
merge_request
.
diff_head_sha
.
presence
end
...
...
changelogs/unreleased/id-fix-squash-messages.yml
0 → 100644
View file @
3e8fec12
---
title
:
Fix suggested squashed messages for MR
merge_request
:
43508
author
:
type
:
fixed
spec/serializers/merge_request_poll_cached_widget_entity_spec.rb
View file @
3e8fec12
...
...
@@ -3,12 +3,11 @@
require
'spec_helper'
RSpec
.
describe
MergeRequestPollCachedWidgetEntity
do
include
ProjectForksHelper
using
RSpec
::
Parameterized
::
TableSyntax
let
(
:project
)
{
create
:project
,
:repository
}
let
(
:resourc
e
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
_it_be
(
:project
,
refind:
true
)
{
create
:project
,
:repository
}
let
_it_be
(
:resource
,
refind:
tru
e
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let
_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:request
)
{
double
(
'request'
,
current_user:
user
,
project:
project
)
}
...
...
@@ -174,8 +173,6 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do
end
context
'when auto merge is not enabled'
do
let
(
:resource
)
{
create
(
:merge_request
)
}
it
'returns auto merge related information'
do
expect
(
subject
[
:auto_merge_enabled
]).
to
be_falsy
end
...
...
@@ -215,16 +212,5 @@ RSpec.describe MergeRequestPollCachedWidgetEntity do
expect
(
subject
[
:commits_without_merge_commits
].
size
).
to
eq
(
12
)
end
end
context
'when merge request is not mergeable'
do
before
do
allow
(
resource
).
to
receive
(
:mergeable?
).
and_return
(
false
)
end
it
'does not have default_squash_commit_message and commits_without_merge_commits'
do
expect
(
subject
[
:default_squash_commit_message
]).
to
eq
(
nil
)
expect
(
subject
[
:commits_without_merge_commits
]).
to
eq
(
nil
)
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