Swap FK ci_pipeline_schedules.project_id to projects for LFK
What does this MR do and why?
Per &7249 (closed)
As part of our CI "decomposition" efforts we need to remove all foreign keys that are cross-database (ie. between the planned main
and ci
databases). We are going to replace them all with "loose foreign keys".
Related: grouppipeline execution devopsverify
Validations
-
Best team to review (check off when reviewed): grouppipeline execution devopsverify
-
No way for user to access once parent is deleted. Please explain: For user interactions we load the schedules starting from the project:
- https://gitlab.com/gitlab-org/gitlab/-/blob/b2c8345b4ae1f74bce6fe4be648cfbac2b1bd0b6/app/controllers/projects/pipeline_schedules_controller.rb#L93-95
- https://gitlab.com/gitlab-org/gitlab/-/blob/b2c8345b4ae1f74bce6fe4be648cfbac2b1bd0b6/app/finders/ci/pipeline_schedules_finder.rb#L9
- https://gitlab.com/gitlab-org/gitlab/-/blob/b2c8345b4ae1f74bce6fe4be648cfbac2b1bd0b6/lib/api/ci/pipeline_schedules.rb#L193-203
-
Possible to access once parent deleted but low user impact. Please explain: -
Possible Sidekiq workers that may load directly and possibly lead to exceptions. Please explain: There is a Sidekiq worker that loads the schedules directly and creates pipelines: https://gitlab.com/gitlab-org/gitlab/-/blob/b2c8345b4ae1f74bce6fe4be648cfbac2b1bd0b6/app/workers/pipeline_schedule_worker.rb#L13-21
-
Possible user impact to be evaluated or mitigated. Please explain: -
Is this FK safe to be removed to avoid LOCKing problems? (Explanation: &7249 (comment 819662046)). Please explain:
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.