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
40cc3d3e
Commit
40cc3d3e
authored
Dec 21, 2020
by
Lee Tickett
Committed by
Kerri Miller
Dec 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose notes.resolved_at via api
parent
40952ad9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
1 deletion
+12
-1
changelogs/unreleased/expose-resolved_at-via-api.yml
changelogs/unreleased/expose-resolved_at-via-api.yml
+5
-0
doc/api/discussions.md
doc/api/discussions.md
+2
-1
lib/api/entities/note.rb
lib/api/entities/note.rb
+1
-0
spec/fixtures/api/schemas/entities/discussion.json
spec/fixtures/api/schemas/entities/discussion.json
+1
-0
spec/fixtures/api/schemas/public_api/v4/notes.json
spec/fixtures/api/schemas/public_api/v4/notes.json
+1
-0
spec/support/shared_examples/requests/api/resolvable_discussions_shared_examples.rb
...es/requests/api/resolvable_discussions_shared_examples.rb
+2
-0
No files found.
changelogs/unreleased/expose-resolved_at-via-api.yml
0 → 100644
View file @
40cc3d3e
---
title
:
Expose notes resolved_at via API
merge_request
:
49821
author
:
Lee Tickett
type
:
added
doc/api/discussions.md
View file @
40cc3d3e
...
@@ -687,7 +687,8 @@ GET /projects/:id/merge_requests/:merge_request_iid/discussions
...
@@ -687,7 +687,8 @@ GET /projects/:id/merge_requests/:merge_request_iid/discussions
"noteable_iid"
:
null
,
"noteable_iid"
:
null
,
"resolved"
:
false
,
"resolved"
:
false
,
"resolvable"
:
true
,
"resolvable"
:
true
,
"resolved_by"
:
null
"resolved_by"
:
null
,
"resolved_at"
:
null
},
},
{
{
"id"
:
1129
,
"id"
:
1129
,
...
...
lib/api/entities/note.rb
View file @
40cc3d3e
...
@@ -23,6 +23,7 @@ module API
...
@@ -23,6 +23,7 @@ module API
expose
:resolvable?
,
as: :resolvable
expose
:resolvable?
,
as: :resolvable
expose
:resolved?
,
as: :resolved
,
if:
->
(
note
,
options
)
{
note
.
resolvable?
}
expose
:resolved?
,
as: :resolved
,
if:
->
(
note
,
options
)
{
note
.
resolvable?
}
expose
:resolved_by
,
using:
Entities
::
UserBasic
,
if:
->
(
note
,
options
)
{
note
.
resolvable?
}
expose
:resolved_by
,
using:
Entities
::
UserBasic
,
if:
->
(
note
,
options
)
{
note
.
resolvable?
}
expose
:resolved_at
,
if:
->
(
note
,
options
)
{
note
.
resolvable?
}
expose
:confidential?
,
as: :confidential
expose
:confidential?
,
as: :confidential
...
...
spec/fixtures/api/schemas/entities/discussion.json
View file @
40cc3d3e
...
@@ -48,6 +48,7 @@
...
@@ -48,6 +48,7 @@
"resolved"
:
{
"type"
:
"boolean"
},
"resolved"
:
{
"type"
:
"boolean"
},
"resolvable"
:
{
"type"
:
"boolean"
},
"resolvable"
:
{
"type"
:
"boolean"
},
"resolved_by"
:
{
"type"
:
[
"string"
,
"null"
]
},
"resolved_by"
:
{
"type"
:
[
"string"
,
"null"
]
},
"resolved_at"
:
{
"type"
:
[
"date"
,
"null"
]
},
"note"
:
{
"type"
:
"string"
},
"note"
:
{
"type"
:
"string"
},
"note_html"
:
{
"type"
:
"string"
},
"note_html"
:
{
"type"
:
"string"
},
"current_user"
:
{
"type"
:
"object"
},
"current_user"
:
{
"type"
:
"object"
},
...
...
spec/fixtures/api/schemas/public_api/v4/notes.json
View file @
40cc3d3e
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
"resolved"
:
{
"type"
:
"boolean"
},
"resolved"
:
{
"type"
:
"boolean"
},
"resolvable"
:
{
"type"
:
"boolean"
},
"resolvable"
:
{
"type"
:
"boolean"
},
"resolved_by"
:
{
"type"
:
[
"string"
,
"null"
]
},
"resolved_by"
:
{
"type"
:
[
"string"
,
"null"
]
},
"resolved_at"
:
{
"type"
:
[
"date"
,
"null"
]
},
"confidential"
:
{
"type"
:
[
"boolean"
,
"null"
]
}
"confidential"
:
{
"type"
:
[
"boolean"
,
"null"
]
}
},
},
"required"
:
[
"required"
:
[
...
...
spec/support/shared_examples/requests/api/resolvable_discussions_shared_examples.rb
View file @
40cc3d3e
...
@@ -9,6 +9,7 @@ RSpec.shared_examples 'resolvable discussions API' do |parent_type, noteable_typ
...
@@ -9,6 +9,7 @@ RSpec.shared_examples 'resolvable discussions API' do |parent_type, noteable_typ
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'notes'
].
size
).
to
eq
(
1
)
expect
(
json_response
[
'notes'
].
size
).
to
eq
(
1
)
expect
(
json_response
[
'notes'
][
0
][
'resolved'
]).
to
eq
(
true
)
expect
(
json_response
[
'notes'
][
0
][
'resolved'
]).
to
eq
(
true
)
expect
(
Time
.
parse
(
json_response
[
'notes'
][
0
][
'resolved_at'
])).
to
be_like_time
(
note
.
reload
.
resolved_at
)
end
end
it
"unresolves discussion if resolved is false"
do
it
"unresolves discussion if resolved is false"
do
...
@@ -18,6 +19,7 @@ RSpec.shared_examples 'resolvable discussions API' do |parent_type, noteable_typ
...
@@ -18,6 +19,7 @@ RSpec.shared_examples 'resolvable discussions API' do |parent_type, noteable_typ
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
[
'notes'
].
size
).
to
eq
(
1
)
expect
(
json_response
[
'notes'
].
size
).
to
eq
(
1
)
expect
(
json_response
[
'notes'
][
0
][
'resolved'
]).
to
eq
(
false
)
expect
(
json_response
[
'notes'
][
0
][
'resolved'
]).
to
eq
(
false
)
expect
(
json_response
[
'notes'
][
0
][
'resolved_at'
]).
to
be_nil
end
end
it
"returns a 400 bad request error if resolved parameter is not passed"
do
it
"returns a 400 bad request error if resolved parameter is not passed"
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