Project push rules: Migrate project push rules to dedicated table

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Implementation plan

We want to use the push_rules table as a dedicated table for projects. Therefore, we should remove push_rules records belonging to a group or organization.

  • Create a migration to destroy push_rules records where organization_id is populated.
  • Create a migration to destroy push_rules records associated with a group (where push_rule_id is not null).

Expectations

Next Steps

  • Create a new table migration project_push_rules (w1)
  • Add triggers to copy data from push_rules to project_push_rules similar to what we have for organization_push_rules and group_push_rules (w2)
  • Write a BBM to copy historical data from push_rules to project_push_rules (w2)

Implementation Plan

Step Milestone Weight Done?
Create project_push_rules table 18.6 Done
Sync project_push_rules on push_rules write operations 18.6 Done
BBM to copy push_rules data to project_push_rules 18.7 2 Done
Migrate duplicate push_rules to project_push_rules 18.7 Done
BackfillMissingProjectPushRules migration 18.9 2 Done
Reset project_push_rules id sequence to prevent UniqueViolation errors 18.10 2 MR Done
Write switch code (FF off) 18.10 3 Implementation plan
Enable FF on GitLab.com 18.10 1
Finalize BBM 18.11 (a required stop) 1
Enable FF for self-managed 19.0 1
Cleanup the read_project_push_rules, and write_project_push_rules feature flags 19.1 1
Remove unused project_settings.push_rule_id column 19.1 2
Remove project push rules sync triggers after table migration 19.1 1
Move push rule models under PushRules:: namespace 19.1 2
Drop the push_rules table 19.2 1
Edited by Emma Park