Skip to content

Add `resolved_on_default_branch` column into `vulnerabilities` table

What does this MR do?

This MR introduces a new column called resolved_on_default_branch for vulnerabilities table which is going to be used to indicate if the vulnerability has been resolved by the latest pipeline.

We already have a method in vulnerability model called resolved_on_default_branch which is going to override the ActiveRecord's attribute reader method which will be removed after we run data migration.

Related to #227114 (closed)

Database Review

Up
rake db:migrate
== 20200804222543 AddResolvedOnDefaultBranchIntoVulnerabilitiesTable: migrating
-- change_table(:vulnerabilities)
   -> 0.0031s
== 20200804222543 AddResolvedOnDefaultBranchIntoVulnerabilitiesTable: migrated (0.0031s)
Down(rollback)
rake db:rollback
== 20200804222543 AddResolvedOnDefaultBranchIntoVulnerabilitiesTable: reverting
-- remove_column(:vulnerabilities, :resolved_on_default_branch, :boolean, {:default=>false})
   -> 0.0016s
== 20200804222543 AddResolvedOnDefaultBranchIntoVulnerabilitiesTable: reverted (0.0048s)

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 team
Edited by Mehmet Emin INAC

Merge request reports