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
318caa9a
Commit
318caa9a
authored
Jul 03, 2020
by
Alan (Maciej) Paruszewski
Committed by
Shinya Maeda
Jul 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return ID for newly created vulnerability issue links
parent
72002e21
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
0 deletions
+10
-0
ee/changelogs/unreleased/9424-return-id-for-newly-created-vulnerability-issue-link.yml
...-return-id-for-newly-created-vulnerability-issue-link.yml
+5
-0
ee/lib/ee/api/entities/vulnerability_issue_link.rb
ee/lib/ee/api/entities/vulnerability_issue_link.rb
+1
-0
ee/spec/fixtures/api/schemas/public_api/v4/vulnerability_issue_link.json
...s/api/schemas/public_api/v4/vulnerability_issue_link.json
+2
-0
ee/spec/requests/api/vulnerability_issue_links_spec.rb
ee/spec/requests/api/vulnerability_issue_links_spec.rb
+2
-0
No files found.
ee/changelogs/unreleased/9424-return-id-for-newly-created-vulnerability-issue-link.yml
0 → 100644
View file @
318caa9a
---
title
:
Return ID of newly created vulnerability issue link in API
merge_request
:
35947
author
:
type
:
added
ee/lib/ee/api/entities/vulnerability_issue_link.rb
View file @
318caa9a
...
@@ -4,6 +4,7 @@ module EE
...
@@ -4,6 +4,7 @@ module EE
module
API
module
API
module
Entities
module
Entities
class
VulnerabilityIssueLink
<
Grape
::
Entity
class
VulnerabilityIssueLink
<
Grape
::
Entity
expose
:id
expose
:vulnerability
,
using:
::
EE
::
API
::
Entities
::
Vulnerability
expose
:vulnerability
,
using:
::
EE
::
API
::
Entities
::
Vulnerability
expose
:issue
,
using:
::
API
::
Entities
::
IssueBasic
expose
:issue
,
using:
::
API
::
Entities
::
IssueBasic
expose
:link_type
expose
:link_type
...
...
ee/spec/fixtures/api/schemas/public_api/v4/vulnerability_issue_link.json
View file @
318caa9a
...
@@ -2,11 +2,13 @@
...
@@ -2,11 +2,13 @@
"type"
:
"object"
,
"type"
:
"object"
,
"additionalProperties"
:
false
,
"additionalProperties"
:
false
,
"required"
:
[
"required"
:
[
"id"
,
"issue"
,
"issue"
,
"vulnerability"
,
"vulnerability"
,
"link_type"
"link_type"
],
],
"properties"
:
{
"properties"
:
{
"id"
:
{
"type"
:
"integer"
},
"issue"
:
{
"issue"
:
{
"oneOf"
:
[
"oneOf"
:
[
{
"$ref"
:
"../../../../../../../spec/fixtures/api/schemas/public_api/v4/issue.json"
}
{
"$ref"
:
"../../../../../../../spec/fixtures/api/schemas/public_api/v4/issue.json"
}
...
...
ee/spec/requests/api/vulnerability_issue_links_spec.rb
View file @
318caa9a
...
@@ -75,6 +75,7 @@ RSpec.describe API::VulnerabilityIssueLinks do
...
@@ -75,6 +75,7 @@ RSpec.describe API::VulnerabilityIssueLinks do
expect
(
response
).
to
have_gitlab_http_status
(
:created
)
expect
(
response
).
to
have_gitlab_http_status
(
:created
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/vulnerability_issue_link'
,
dir:
'ee'
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/vulnerability_issue_link'
,
dir:
'ee'
)
expect
(
json_response
[
'id'
]).
to
eq
Vulnerabilities
::
IssueLink
.
last
.
id
expect
(
json_response
[
'issue'
][
'id'
]).
to
eq
issue
.
id
expect
(
json_response
[
'issue'
][
'id'
]).
to
eq
issue
.
id
expect
(
json_response
[
'vulnerability'
][
'id'
]).
to
eq
vulnerability
.
id
expect
(
json_response
[
'vulnerability'
][
'id'
]).
to
eq
vulnerability
.
id
end
end
...
@@ -166,6 +167,7 @@ RSpec.describe API::VulnerabilityIssueLinks do
...
@@ -166,6 +167,7 @@ RSpec.describe API::VulnerabilityIssueLinks do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/vulnerability_issue_link'
,
dir:
'ee'
)
expect
(
response
).
to
match_response_schema
(
'public_api/v4/vulnerability_issue_link'
,
dir:
'ee'
)
expect
(
json_response
[
'id'
]).
to
eq
issue_link_id
expect
(
json_response
[
'issue'
][
'id'
]).
to
eq
vulnerability_issue_link
.
issue
.
id
expect
(
json_response
[
'issue'
][
'id'
]).
to
eq
vulnerability_issue_link
.
issue
.
id
expect
(
json_response
[
'vulnerability'
][
'id'
]).
to
eq
vulnerability_id
expect
(
json_response
[
'vulnerability'
][
'id'
]).
to
eq
vulnerability_id
end
end
...
...
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