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
cf99162d
Commit
cf99162d
authored
Aug 05, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add milestone_id to issue update graphQL mutation
- update documentation and specs
parent
5630b850
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
1 deletion
+38
-1
app/graphql/mutations/issues/update.rb
app/graphql/mutations/issues/update.rb
+5
-0
changelogs/unreleased/36312-issue-update-milestone.yml
changelogs/unreleased/36312-issue-update-milestone.yml
+5
-0
doc/api/graphql/reference/gitlab_schema.graphql
doc/api/graphql/reference/gitlab_schema.graphql
+5
-0
doc/api/graphql/reference/gitlab_schema.json
doc/api/graphql/reference/gitlab_schema.json
+10
-0
spec/graphql/mutations/issues/update_spec.rb
spec/graphql/mutations/issues/update_spec.rb
+13
-1
No files found.
app/graphql/mutations/issues/update.rb
View file @
cf99162d
...
...
@@ -41,6 +41,11 @@ module Mutations
required:
false
,
description:
'The IDs of labels to be removed from the issue.'
argument
:milestone_id
,
GraphQL
::
ID_TYPE
,
required:
false
,
description:
'The ID of the milestone to be assigned, milestone will be removed if set to null.'
def
resolve
(
project_path
:,
iid
:,
**
args
)
issue
=
authorized_find!
(
project_path:
project_path
,
iid:
iid
)
project
=
issue
.
project
...
...
changelogs/unreleased/36312-issue-update-milestone.yml
0 → 100644
View file @
cf99162d
---
title
:
Add milestone_id param to issue update graphQL mutation
merge_request
:
38684
author
:
type
:
added
doc/api/graphql/reference/gitlab_schema.graphql
View file @
cf99162d
...
...
@@ -14736,6 +14736,11 @@ input UpdateIssueInput {
"""
locked
:
Boolean
"""
The
ID
of
the
milestone
to
be
assigned
,
milestone
will
be
removed
if
set
to
null
.
"""
milestoneId
:
ID
"""
The
project
the
issue
to
mutate
is
in
"""
...
...
doc/api/graphql/reference/gitlab_schema.json
View file @
cf99162d
...
...
@@ -43503,6 +43503,16 @@
},
"defaultValue": null
},
{
"name": "milestoneId",
"description": "The ID of the milestone to be assigned, milestone will be removed if set to null.",
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
},
{
"name": "healthStatus",
"description": "The desired health status",
spec/graphql/mutations/issues/update_spec.rb
View file @
cf99162d
...
...
@@ -7,6 +7,7 @@ RSpec.describe Mutations::Issues::Update do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project_label
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
,
labels:
[
project_label
])
}
let_it_be
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:expected_attributes
)
do
{
...
...
@@ -14,7 +15,8 @@ RSpec.describe Mutations::Issues::Update do
description:
'new description'
,
confidential:
true
,
due_date:
Date
.
tomorrow
,
discussion_locked:
true
discussion_locked:
true
,
milestone_id:
milestone
.
id
}
end
let
(
:mutation
)
{
described_class
.
new
(
object:
nil
,
context:
{
current_user:
user
},
field:
nil
)
}
...
...
@@ -57,6 +59,16 @@ RSpec.describe Mutations::Issues::Update do
end
end
context
'when setting milestone to nil'
do
let
(
:expected_attributes
)
{
{
milestone_id:
nil
}
}
it
'changes the milestone corrrectly'
do
issue
.
update_column
(
:milestone_id
,
milestone
.
id
)
expect
{
subject
}.
to
change
{
issue
.
reload
.
milestone
}.
from
(
milestone
).
to
(
nil
)
end
end
context
'when changing labels'
do
let_it_be
(
:label_1
)
{
create
(
:label
,
project:
project
)
}
let_it_be
(
:label_2
)
{
create
(
:label
,
project:
project
)
}
...
...
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