Backfilling missing ci_cd_settings for projects
What does this MR do and why?
Backfilling missing ci_cd_settings for projects
Add a batched background migration for creating ci cd settings for projects that do not have them
Contributes to: #393502 (closed)
Example query plans
SELECT "projects"."id"
FROM "projects"
WHERE "projects"."id" BETWEEN 1 AND 1500
ORDER BY "projects"."id" ASC
LIMIT 1
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/20011/commands/65297
SELECT "projects"."id"
FROM "projects"
WHERE "projects"."id" BETWEEN 1 AND 1500
AND "projects"."id" >= 1
ORDER BY "projects"."id" ASC
LIMIT 1 OFFSET 1000
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/20011/commands/65298
SELECT "projects"."id"
FROM "projects"
WHERE "projects"."id" BETWEEN 1 AND 1500
AND "projects"."id" >= 1 AND (
NOT EXISTS (
SELECT 1
FROM project_ci_cd_settings
WHERE project_ci_cd_settings.project_id = projects.id
)
)
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/20011/commands/65299
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.
Related to #393502 (closed)
Edited by Jerry Seto