Skip to content

Disable pipeline schedules when a user is blocked

Marius Bobin requested to merge ci-disable-scheduled-pipelines-323341 into master

What does this MR do?

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/323341

Screenshots (strongly suggested)

Queries:

Migrations

Up

VERSION=20210312140029 bin/rails db:migrate:up
== 20210312140029 AddOwnerAndIdIndexOnActiveCiPipelineSchedules: migrating ====
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:ci_pipeline_schedules, [:owner_id, :id], {:where=>"active = TRUE", :name=>"index_ci_pipeline_schedules_on_owner_id_and_id_and_active", :algorithm=>:concurrently})
   -> 0.0026s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- add_index(:ci_pipeline_schedules, [:owner_id, :id], {:where=>"active = TRUE", :name=>"index_ci_pipeline_schedules_on_owner_id_and_id_and_active", :algorithm=>:concurrently})
   -> 0.0063s
-- execute("RESET ALL")
   -> 0.0005s
== 20210312140029 AddOwnerAndIdIndexOnActiveCiPipelineSchedules: migrated (0.0109s)

Timing: The query has been executed. Duration: 0.206 s - https://gitlab.slack.com/archives/CLJMDRD8C/p1615557981427200

Down

VERSION=20210312140029 bin/rails db:migrate:down
== 20210312140029 AddOwnerAndIdIndexOnActiveCiPipelineSchedules: reverting ====
-- transaction_open?()
   -> 0.0000s
-- indexes(:ci_pipeline_schedules)
   -> 0.0029s
-- execute("SET statement_timeout TO 0")
   -> 0.0005s
-- remove_index(:ci_pipeline_schedules, {:algorithm=>:concurrently, :name=>"index_ci_pipeline_schedules_on_owner_id_and_id_and_active"})
   -> 0.0034s
-- execute("RESET ALL")
   -> 0.0005s
== 20210312140029 AddOwnerAndIdIndexOnActiveCiPipelineSchedules: reverted (0.0082s)

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 Marius Bobin

Merge request reports