Skip to content

Add test to ensure MR widget vulnerabilities are sorted

Can Eldem requested to merge sort-vulnerabilities-for-mr-widget into master

What does this MR do?

#34115 (closed)

This MR makes sure that vulnerabilities that are listed in MR widget are sorted by severity and confidence. As side effect of this !18675 (merged) we already established that. We just added some tests to make sure we have correct behaviour. Following class is populating MR widget vulnerabilities;


        class VulnerabilityReportsComparer
          def added
            head_report - base_report
          end

          def fixed
            base_report - head_report
          end

          def existing
            head_report & base_report
          end
        end

We will feed this object with sorted head and sorted base reports. According to https://apidock.com/ruby/Array/difference , order will be preserved.

Screenshots

image

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec tea
Edited by Can Eldem

Merge request reports

Loading