Skip to content

Remove cluster_image_scanning from approval_project_rules table

What does this MR do?

Remove cluster_image_scanning from the scanners column in the approval_project_rules table, backend and frontend.

Related issue: #337244 (closed)

$ SKIP_POST_DEPLOYMENT_MIGRATIONS=true bundle exec rake db:migrate

== 20210804202057 AddTmpIndexApprovalProjectRulesScanners: migrating ==========
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:approval_project_rules, :scanners, {:name=>"tmp_index_approval_project_rules_scanners", :using=>:gin, :where=>"scanners @> '{cluster_image_scanning}'", :algorithm=>:concurrently})
   -> 0.0058s
-- execute("SET statement_timeout TO 0")
   -> 0.0006s
-- add_index(:approval_project_rules, :scanners, {:name=>"tmp_index_approval_project_rules_scanners", :using=>:gin, :where=>"scanners @> '{cluster_image_scanning}'", :algorithm=>:concurrently})
   -> 0.0077s
-- execute("RESET ALL")
   -> 0.0005s
== 20210804202057 AddTmpIndexApprovalProjectRulesScanners: migrated (0.0157s) =

$ SKIP_POST_DEPLOYMENT_MIGRATIONS=true bundle exec rake db:rollback

== 20210804202057 AddTmpIndexApprovalProjectRulesScanners: reverting ==========
-- transaction_open?()
   -> 0.0000s
-- indexes(:approval_project_rules)
   -> 0.0039s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- remove_index(:approval_project_rules, {:algorithm=>:concurrently, :name=>"tmp_index_approval_project_rules_scanners"})
   -> 0.0031s
-- execute("RESET ALL")
   -> 0.0007s
== 20210804202057 AddTmpIndexApprovalProjectRulesScanners: reverted (0.0093s)

$ bundle exec rake db:migrate:up VERSION=20210804150624

== 20210804150624 RemoveClusterImageScanningFromApprovalProjectRules: migrating
-- execute("update approval_project_rules set scanners = array_remove(scanners, 'cluster_image_scanning') where scanners @> '{cluster_image_scanning}'")
   -> 0.0035s
== 20210804150624 RemoveClusterImageScanningFromApprovalProjectRules: migrated (0.0035s)

$ bundle exec rake db:migrate:down VERSION=20210804150624

== 20210804150624 RemoveClusterImageScanningFromApprovalProjectRules: reverting
== 20210804150624 RemoveClusterImageScanningFromApprovalProjectRules: reverted (0.0000s)

Screenshots or Screencasts (strongly suggested)

Screen_Shot_2021-07-30_at_3.56.34_PM

How to setup and validate locally (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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 Zamir Martins

Merge request reports