Manually create Vulnerabilities via API
Notes to reviewers and maintainers
This MR is almost exactly the same as !61385 (merged) but here I added two things to address issues found in #10272 (comment 650202279):
-
ee/app/graphql/types/vulnerability_location/generic_type.rb
which will return empty values fordescription
field since we don't even expose that field for user input -
ee/app/graphql/mutations/vulnerabilities/create.rb
now wraps the errors inArray()
, this is so that we don't end up callingto_a
on a singular error message - Create a feature flag, rollout issue: #338694 (closed)
- Remove
requires_new: true
from#transaction
block due to #338730 (closed)
What does this MR do?
This MR adds an GraphQL query and underlying service object to create Vulnerability objects manually via API.
Related to #10272 (closed)
Does this MR meet the acceptance criteria?
Conformity
-
I have included a changelog entry, or it's not needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
Edited by Michał Zając