Commit 3c61465e authored by Markus Koller's avatar Markus Koller

Merge branch...

Merge branch '292800-return-the-uuid-attribute-of-the-finding-records-in-the-response-of-vulnerability_findings' into 'master'

Include finding_uuid in response of vulnerability_feedback endpoint

See merge request gitlab-org/gitlab!49745
parents 2381efa2 55c4e6a1
......@@ -12,6 +12,7 @@ class Vulnerabilities::FeedbackEntity < Grape::Entity
expose :comment_timestamp
expose :comment_author, using: UserEntity
end
expose :finding_uuid
expose :pipeline, if: -> (feedback, _) { feedback.pipeline.present? } do
expose :id do |feedback|
......
---
title: Return the finding_uuid attribute in the response of vulnerability_feedback
endpoint
merge_request: 49745
author:
type: changed
......@@ -36,7 +36,8 @@
},
"project_fingerprint": { "type": "string" },
"branch": { "type": ["string", "null"] },
"destroy_vulnerability_feedback_dismissal_path": { "type": "string" }
"destroy_vulnerability_feedback_dismissal_path": { "type": "string" },
"finding_uuid": { "type": ["string", "null"] }
},
"additionalProperties": false
}
......@@ -167,4 +167,21 @@ RSpec.describe Vulnerabilities::FeedbackEntity do
expect(subject[:comment_details]).to include(:comment_author)
end
end
context 'when finding_uuid is not present' do
let(:feedback) { build(:vulnerability_feedback, :issue, project: project) }
it 'has a nil finding_uuid' do
expect(subject[:finding_uuid]).to be_nil
end
end
context 'when finding_uuid is present' do
let_it_be(:finding) { create(:vulnerabilities_finding) }
let(:feedback) { create(:vulnerability_feedback, finding_uuid: finding.uuid, project: project) }
it 'exposes finding_uuid' do
expect(subject[:finding_uuid]).to eq(finding.uuid)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment