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
cf41faae
Commit
cf41faae
authored
Sep 29, 2020
by
Adam Hegyi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wrong scope for approvedBy in MR GraphQL API
parent
3df1baec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
app/graphql/resolvers/concerns/resolves_merge_requests.rb
app/graphql/resolvers/concerns/resolves_merge_requests.rb
+1
-1
app/graphql/types/merge_request_type.rb
app/graphql/types/merge_request_type.rb
+0
-4
changelogs/unreleased/fix-wrong-scope-in-approved-by.yml
changelogs/unreleased/fix-wrong-scope-in-approved-by.yml
+5
-0
ee/app/graphql/ee/types/merge_request_type.rb
ee/app/graphql/ee/types/merge_request_type.rb
+1
-1
ee/spec/requests/api/graphql/project/merge_requests_spec.rb
ee/spec/requests/api/graphql/project/merge_requests_spec.rb
+1
-1
No files found.
app/graphql/resolvers/concerns/resolves_merge_requests.rb
View file @
cf41faae
...
@@ -40,7 +40,7 @@ module ResolvesMergeRequests
...
@@ -40,7 +40,7 @@ module ResolvesMergeRequests
author:
[
:author
],
author:
[
:author
],
merged_at:
[
:metrics
],
merged_at:
[
:metrics
],
commit_count:
[
:metrics
],
commit_count:
[
:metrics
],
approved_by:
[
:approve
r
_users
],
approved_by:
[
:approve
d_by
_users
],
milestone:
[
:milestone
],
milestone:
[
:milestone
],
head_pipeline:
[
:merge_request_diff
,
{
head_pipeline:
[
:merge_request
]
}]
head_pipeline:
[
:merge_request_diff
,
{
head_pipeline:
[
:merge_request
]
}]
}
}
...
...
app/graphql/types/merge_request_type.rb
View file @
cf41faae
...
@@ -174,10 +174,6 @@ module Types
...
@@ -174,10 +174,6 @@ module Types
def
commit_count
def
commit_count
object
&
.
metrics
&
.
commits_count
object
&
.
metrics
&
.
commits_count
end
end
def
approvers
object
.
approver_users
end
end
end
end
end
Types
::
MergeRequestType
.
prepend_if_ee
(
'::EE::Types::MergeRequestType'
)
Types
::
MergeRequestType
.
prepend_if_ee
(
'::EE::Types::MergeRequestType'
)
changelogs/unreleased/fix-wrong-scope-in-approved-by.yml
0 → 100644
View file @
cf41faae
---
title
:
Fix approvedBy filed in MR GraphQL API
merge_request
:
43705
author
:
type
:
fixed
ee/app/graphql/ee/types/merge_request_type.rb
View file @
cf41faae
...
@@ -16,7 +16,7 @@ module EE
...
@@ -16,7 +16,7 @@ module EE
description:
'Users who approved the merge request'
description:
'Users who approved the merge request'
def
approved_by
def
approved_by
object
.
approve
r
_users
object
.
approve
d_by
_users
end
end
end
end
end
end
...
...
ee/spec/requests/api/graphql/project/merge_requests_spec.rb
View file @
cf41faae
...
@@ -39,7 +39,7 @@ RSpec.describe 'getting merge request listings (EE) nested in a project' do
...
@@ -39,7 +39,7 @@ RSpec.describe 'getting merge request listings (EE) nested in a project' do
let
(
:requested_fields
)
{
query_graphql_field
(
:approved_by
,
nil
,
query_graphql_field
(
:nodes
,
nil
,
[
:username
]))
}
let
(
:requested_fields
)
{
query_graphql_field
(
:approved_by
,
nil
,
query_graphql_field
(
:nodes
,
nil
,
[
:username
]))
}
it
'exposes approver username'
do
it
'exposes approver username'
do
merge_request_a
.
approve
r
_users
<<
current_user
merge_request_a
.
approve
d_by
_users
<<
current_user
execute_query
execute_query
...
...
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