Commit 3f5ee355 authored by Tetiana Chupryna's avatar Tetiana Chupryna

Update hash for vulnerability

We updated vulnerability so it includes id and url
We need to add it to its `hash`
parent 3a8dd9a1
......@@ -19,7 +19,7 @@ module Gitlab
end
def hash
name.hash ^ severity.hash
name.hash ^ severity.hash ^ id.hash ^ url.hash
end
def to_hash
......
......@@ -135,7 +135,8 @@ RSpec.describe Gitlab::Ci::Reports::DependencyList::Report do
it 'does not duplicate same vulnerability for dependency' do
vulnerabilities = [{ name: 'problem', severity: 'high', id: 2, url: 'some_url_2' },
{ name: 'problem2', severity: 'medium', id: 4, url: 'some_url_4' }]
{ name: 'problem2', severity: 'medium', id: 4, url: 'some_url_4' },
{ name: 'problem3', severity: 'medium', id: nil, url: nil }]
dependency[:vulnerabilities] = [vulnerabilities.first]
with_extra_vuln_from_another_report = dependency.dup.merge(vulnerabilities: vulnerabilities)
......
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