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
fd089dd5
Commit
fd089dd5
authored
Feb 14, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
c5b892f8
bbd0a2ce
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
10 deletions
+33
-10
bin/secpick
bin/secpick
+1
-3
changelogs/unreleased/44740-api-to-verify-a-given-user-has-right-to-merge-a-given-mergerequest.yml
...-a-given-user-has-right-to-merge-a-given-mergerequest.yml
+5
-0
doc/api/merge_requests.md
doc/api/merge_requests.md
+3
-0
lib/api/entities.rb
lib/api/entities.rb
+6
-0
lib/gitlab/danger/helper.rb
lib/gitlab/danger/helper.rb
+1
-1
spec/lib/gitlab/danger/helper_spec.rb
spec/lib/gitlab/danger/helper_spec.rb
+7
-6
spec/requests/api/merge_requests_spec.rb
spec/requests/api/merge_requests_spec.rb
+10
-0
No files found.
bin/secpick
View file @
fd089dd5
...
@@ -45,9 +45,7 @@ module Secpick
...
@@ -45,9 +45,7 @@ module Secpick
def
git_commands
def
git_commands
[
"git fetch
#{
@options
[
:remote
]
}
#{
stable_branch
}
"
,
[
"git fetch
#{
@options
[
:remote
]
}
#{
stable_branch
}
"
,
"git checkout
#{
stable_branch
}
"
,
"git checkout -B
#{
source_branch
}
#{
@options
[
:remote
]
}
/
#{
stable_branch
}
"
,
"git pull
#{
@options
[
:remote
]
}
#{
stable_branch
}
"
,
"git checkout -B
#{
source_branch
}
"
,
"git cherry-pick
#{
@options
[
:sha
]
}
"
,
"git cherry-pick
#{
@options
[
:sha
]
}
"
,
"git push
#{
@options
[
:remote
]
}
#{
source_branch
}
"
,
"git push
#{
@options
[
:remote
]
}
#{
source_branch
}
"
,
"git checkout
#{
original_branch
}
"
]
"git checkout
#{
original_branch
}
"
]
...
...
changelogs/unreleased/44740-api-to-verify-a-given-user-has-right-to-merge-a-given-mergerequest.yml
0 → 100644
View file @
fd089dd5
---
title
:
'
API:
Expose
if
the
current
user
can
merge
a
MR'
merge_request
:
25207
author
:
Robert Schilling
type
:
added
doc/api/merge_requests.md
View file @
fd089dd5
...
@@ -438,6 +438,9 @@ Parameters:
...
@@ -438,6 +438,9 @@ Parameters:
"avatar_url"
:
null
,
"avatar_url"
:
null
,
"web_url"
:
"https://gitlab.example.com/admin"
"web_url"
:
"https://gitlab.example.com/admin"
},
},
"user"
:
{
"can_merge"
:
false
}
"assignee"
:
{
"assignee"
:
{
"id"
:
1
,
"id"
:
1
,
"name"
:
"Administrator"
,
"name"
:
"Administrator"
,
...
...
lib/api/entities.rb
View file @
fd089dd5
...
@@ -734,6 +734,12 @@ module API
...
@@ -734,6 +734,12 @@ module API
def
build_available?
(
options
)
def
build_available?
(
options
)
options
[
:project
]
&
.
feature_available?
(
:builds
,
options
[
:current_user
])
options
[
:project
]
&
.
feature_available?
(
:builds
,
options
[
:current_user
])
end
end
expose
:user
do
expose
:can_merge
do
|
merge_request
,
options
|
merge_request
.
can_be_merged_by?
(
options
[
:current_user
])
end
end
end
end
class
MergeRequestChanges
<
MergeRequest
class
MergeRequestChanges
<
MergeRequest
...
...
lib/gitlab/danger/helper.rb
View file @
fd089dd5
...
@@ -114,7 +114,7 @@ module Gitlab
...
@@ -114,7 +114,7 @@ module Gitlab
%r{
\A
(ee/)?spec/(?!javascripts)[^/]+}
=>
:backend
,
%r{
\A
(ee/)?spec/(?!javascripts)[^/]+}
=>
:backend
,
%r{
\A
(ee/)?vendor/(?!assets)[^/]+}
=>
:backend
,
%r{
\A
(ee/)?vendor/(?!assets)[^/]+}
=>
:backend
,
%r{
\A
(ee/)?vendor/(languages
\.
yml|licenses
\.
csv)
\z
}
=>
:backend
,
%r{
\A
(ee/)?vendor/(languages
\.
yml|licenses
\.
csv)
\z
}
=>
:backend
,
%r{
\A
(Dangerfile|Gemfile|Gemfile.lock|Procfile|Rakefile)
\z
}
=>
:backend
,
%r{
\A
(Dangerfile|Gemfile|Gemfile.lock|Procfile|Rakefile
|
\.
gitlab-ci
\.
yml
)
\z
}
=>
:backend
,
%r{
\A
[A-Z_]+_VERSION
\z
}
=>
:backend
,
%r{
\A
[A-Z_]+_VERSION
\z
}
=>
:backend
,
%r{
\A
(ee/)?db/}
=>
:database
,
%r{
\A
(ee/)?db/}
=>
:database
,
...
...
spec/lib/gitlab/danger/helper_spec.rb
View file @
fd089dd5
...
@@ -244,12 +244,13 @@ describe Gitlab::Danger::Helper do
...
@@ -244,12 +244,13 @@ describe Gitlab::Danger::Helper do
'vendor/languages.yml'
|
:backend
'vendor/languages.yml'
|
:backend
'vendor/licenses.csv'
|
:backend
'vendor/licenses.csv'
|
:backend
'Dangerfile'
|
:backend
'Dangerfile'
|
:backend
'Gemfile'
|
:backend
'Gemfile'
|
:backend
'Gemfile.lock'
|
:backend
'Gemfile.lock'
|
:backend
'Procfile'
|
:backend
'Procfile'
|
:backend
'Rakefile'
|
:backend
'Rakefile'
|
:backend
'FOO_VERSION'
|
:backend
'.gitlab-ci.yml'
|
:backend
'FOO_VERSION'
|
:backend
'ee/FOO_VERSION'
|
:unknown
'ee/FOO_VERSION'
|
:unknown
...
...
spec/requests/api/merge_requests_spec.rb
View file @
fd089dd5
...
@@ -372,6 +372,7 @@ describe API::MergeRequests do
...
@@ -372,6 +372,7 @@ describe API::MergeRequests do
expect
(
json_response
[
'force_close_merge_request'
]).
to
be_falsy
expect
(
json_response
[
'force_close_merge_request'
]).
to
be_falsy
expect
(
json_response
[
'changes_count'
]).
to
eq
(
merge_request
.
merge_request_diff
.
real_size
)
expect
(
json_response
[
'changes_count'
]).
to
eq
(
merge_request
.
merge_request_diff
.
real_size
)
expect
(
json_response
[
'merge_error'
]).
to
eq
(
merge_request
.
merge_error
)
expect
(
json_response
[
'merge_error'
]).
to
eq
(
merge_request
.
merge_error
)
expect
(
json_response
[
'user'
][
'can_merge'
]).
to
be_truthy
expect
(
json_response
).
not_to
include
(
'rebase_in_progress'
)
expect
(
json_response
).
not_to
include
(
'rebase_in_progress'
)
end
end
...
@@ -499,6 +500,15 @@ describe API::MergeRequests do
...
@@ -499,6 +500,15 @@ describe API::MergeRequests do
expect
(
json_response
[
'allow_maintainer_to_push'
]).
to
be_truthy
expect
(
json_response
[
'allow_maintainer_to_push'
]).
to
be_truthy
end
end
end
end
it
'indicates if a user cannot merge the MR'
do
user2
=
create
(
:user
)
project
.
add_reporter
(
user2
)
get
api
(
"/projects/
#{
project
.
id
}
/merge_requests/
#{
merge_request
.
iid
}
"
,
user2
)
expect
(
json_response
[
'user'
][
'can_merge'
]).
to
be_falsy
end
end
end
describe
'GET /projects/:id/merge_requests/:merge_request_iid/participants'
do
describe
'GET /projects/:id/merge_requests/:merge_request_iid/participants'
do
...
...
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