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
fd25fe9f
Commit
fd25fe9f
authored
Feb 27, 2020
by
Jarka Košanová
Committed by
Michael Kozono
Feb 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Seach issues in graphQl by milestone and assignees
- none and any for assigne_id are supported
parent
9cd83bd9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
5 deletions
+139
-5
app/graphql/resolvers/issues_resolver.rb
app/graphql/resolvers/issues_resolver.rb
+9
-0
changelogs/unreleased/197227-milestone-tab-async.yml
changelogs/unreleased/197227-milestone-tab-async.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+30
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+68
-0
spec/graphql/resolvers/issues_resolver_spec.rb
spec/graphql/resolvers/issues_resolver_spec.rb
+27
-5
No files found.
app/graphql/resolvers/issues_resolver.rb
View file @
fd25fe9f
...
...
@@ -15,6 +15,15 @@ module Resolvers
argument
:label_name
,
GraphQL
::
STRING_TYPE
.
to_list_type
,
required:
false
,
description:
'Labels applied to this issue'
argument
:milestone_title
,
GraphQL
::
STRING_TYPE
.
to_list_type
,
required:
false
,
description:
'Milestones applied to this issue'
argument
:assignee_username
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'Username of a user assigned to the issues'
argument
:assignee_id
,
GraphQL
::
STRING_TYPE
,
required:
false
,
description:
'ID of a user assigned to the issues, "none" and "any" values supported'
argument
:created_before
,
Types
::
TimeType
,
required:
false
,
description:
'Issues created before this date'
...
...
changelogs/unreleased/197227-milestone-tab-async.yml
0 → 100644
View file @
fd25fe9f
---
title
:
Search issues in GraphQL API by milestone title and assignees
merge_request
:
25794
author
:
type
:
added
doc/api/graphql/reference/gitlab_schema.graphql
View file @
fd25fe9f
...
...
@@ -5403,6 +5403,16 @@ type Project {
A
single
issue
of
the
project
"""
issue
(
"""
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
supported
"""
assigneeId
:
String
"""
Username
of
a
user
assigned
to
the
issues
"""
assigneeUsername
:
String
"""
Issues
closed
after
this
date
"""
...
...
@@ -5438,6 +5448,11 @@ type Project {
"""
labelName
:
[
String
]
"""
Milestones
applied
to
this
issue
"""
milestoneTitle
:
[
String
]
"""
Search
query
for
finding
issues
by
title
or
description
"""
...
...
@@ -5473,6 +5488,16 @@ type Project {
"""
after
:
String
"""
ID
of
a
user
assigned
to
the
issues
,
"
none
"
and
"
any
"
values
supported
"""
assigneeId
:
String
"""
Username
of
a
user
assigned
to
the
issues
"""
assigneeUsername
:
String
"""
Returns
the
elements
in
the
list
that
come
before
the
specified
cursor
.
"""
...
...
@@ -5523,6 +5548,11 @@ type Project {
"""
last
:
Int
"""
Milestones
applied
to
this
issue
"""
milestoneTitle
:
[
String
]
"""
Search
query
for
finding
issues
by
title
or
description
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
fd25fe9f
...
...
@@ -749,6 +749,40 @@
},
"defaultValue"
:
null
},
{
"name"
:
"milestoneTitle"
,
"description"
:
"Milestones applied to this issue"
,
"type"
:
{
"kind"
:
"LIST"
,
"name"
:
null
,
"ofType"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"String"
,
"ofType"
:
null
}
},
"defaultValue"
:
null
},
{
"name"
:
"assigneeUsername"
,
"description"
:
"Username of a user assigned to the issues"
,
"type"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"String"
,
"ofType"
:
null
},
"defaultValue"
:
null
},
{
"name"
:
"assigneeId"
,
"description"
:
"ID of a user assigned to the issues,
\"
none
\"
and
\"
any
\"
values supported"
,
"type"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"String"
,
"ofType"
:
null
},
"defaultValue"
:
null
},
{
"name"
:
"createdBefore"
,
"description"
:
"Issues created before this date"
,
...
...
@@ -894,6 +928,40 @@
},
"defaultValue"
:
null
},
{
"name"
:
"milestoneTitle"
,
"description"
:
"Milestones applied to this issue"
,
"type"
:
{
"kind"
:
"LIST"
,
"name"
:
null
,
"ofType"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"String"
,
"ofType"
:
null
}
},
"defaultValue"
:
null
},
{
"name"
:
"assigneeUsername"
,
"description"
:
"Username of a user assigned to the issues"
,
"type"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"String"
,
"ofType"
:
null
},
"defaultValue"
:
null
},
{
"name"
:
"assigneeId"
,
"description"
:
"ID of a user assigned to the issues,
\"
none
\"
and
\"
any
\"
values supported"
,
"type"
:
{
"kind"
:
"SCALAR"
,
"name"
:
"String"
,
"ofType"
:
null
},
"defaultValue"
:
null
},
{
"name"
:
"createdBefore"
,
"description"
:
"Issues created before this date"
,
...
...
spec/graphql/resolvers/issues_resolver_spec.rb
View file @
fd25fe9f
...
...
@@ -8,11 +8,13 @@ describe Resolvers::IssuesResolver do
let
(
:current_user
)
{
create
(
:user
)
}
context
"with a project"
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
,
state: :opened
,
created_at:
3
.
hours
.
ago
,
updated_at:
3
.
hours
.
ago
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
state: :closed
,
title:
'foo'
,
created_at:
1
.
hour
.
ago
,
updated_at:
1
.
hour
.
ago
,
closed_at:
1
.
hour
.
ago
)
}
let_it_be
(
:label1
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:label2
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let_it_be
(
:assignee
)
{
create
(
:user
)
}
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
,
state: :opened
,
created_at:
3
.
hours
.
ago
,
updated_at:
3
.
hours
.
ago
,
milestone:
milestone
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
state: :closed
,
title:
'foo'
,
created_at:
1
.
hour
.
ago
,
updated_at:
1
.
hour
.
ago
,
closed_at:
1
.
hour
.
ago
,
assignees:
[
assignee
])
}
let_it_be
(
:label1
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:label2
)
{
create
(
:label
,
project:
project
)
}
before
do
project
.
add_developer
(
current_user
)
...
...
@@ -31,6 +33,26 @@ describe Resolvers::IssuesResolver do
expect
(
resolve_issues
(
state:
'closed'
)).
to
contain_exactly
(
issue2
)
end
it
'filters by milestone'
do
expect
(
resolve_issues
(
milestone_title:
milestone
.
title
)).
to
contain_exactly
(
issue1
)
end
it
'filters by assignee_username'
do
expect
(
resolve_issues
(
assignee_username:
assignee
.
username
)).
to
contain_exactly
(
issue2
)
end
it
'filters by assignee_id'
do
expect
(
resolve_issues
(
assignee_id:
assignee
.
id
)).
to
contain_exactly
(
issue2
)
end
it
'filters by any assignee'
do
expect
(
resolve_issues
(
assignee_id:
IssuableFinder
::
FILTER_ANY
)).
to
contain_exactly
(
issue2
)
end
it
'filters by no assignee'
do
expect
(
resolve_issues
(
assignee_id:
IssuableFinder
::
FILTER_NONE
)).
to
contain_exactly
(
issue1
)
end
it
'filters by labels'
do
expect
(
resolve_issues
(
label_name:
[
label1
.
title
])).
to
contain_exactly
(
issue1
,
issue2
)
expect
(
resolve_issues
(
label_name:
[
label1
.
title
,
label2
.
title
])).
to
contain_exactly
(
issue2
)
...
...
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