Skip to content

Adding partitions for ci_stage associations

Max Fan requested to merge 430295-partition-prune-ci-stage into master

What does this MR do and why?

Adding partition pruning when referencing ci_stages

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Ensure associations between models are still correct and use partition_id filter in the where clause
  2. Eg: Ci::Build.first.ci_stage -> WHERE "p_ci_stages"."id" = 1 AND "p_ci_stages"."partition_id" = 100
  3. Ci::Pipeline.first.stages -> WHERE "p_ci_stages"."pipeline_id" = 1 AND "p_ci_stages"."partition_id" = 100
  4. Ci::Stage.first.pipeline -> WHERE "ci_pipelines"."id" = 1 AND "ci_pipelines"."partition_id" = 100

Related to #430295 (closed)

Edited by Max Fan

Merge request reports