Commit 422cf9ad authored by Luke Duncalfe's avatar Luke Duncalfe

Merge branch '299557-vulnerability-hash-fix' into 'master'

Update hash for vulnerability

See merge request gitlab-org/gitlab!67132
parents 9c5071e9 3f5ee355
...@@ -19,7 +19,7 @@ module Gitlab ...@@ -19,7 +19,7 @@ module Gitlab
end end
def hash def hash
name.hash ^ severity.hash name.hash ^ severity.hash ^ id.hash ^ url.hash
end end
def to_hash def to_hash
......
...@@ -135,7 +135,8 @@ RSpec.describe Gitlab::Ci::Reports::DependencyList::Report do ...@@ -135,7 +135,8 @@ RSpec.describe Gitlab::Ci::Reports::DependencyList::Report do
it 'does not duplicate same vulnerability for dependency' do it 'does not duplicate same vulnerability for dependency' do
vulnerabilities = [{ name: 'problem', severity: 'high', id: 2, url: 'some_url_2' }, 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] dependency[:vulnerabilities] = [vulnerabilities.first]
with_extra_vuln_from_another_report = dependency.dup.merge(vulnerabilities: vulnerabilities) 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