Drop unused push_rules.organization_id and is_sample columns

Summary

The push_rules table is now dedicated to project-level push rules; organization-level rules moved to organization_push_rules and group-level rules to group_push_rules (parent tracker: #499156). Two legacy columns remain: organization_id (bigint, nullable), which no runtime code reads and whose loose foreign key entry was removed in !252073 (merged), and is_sample (boolean, default false), which backed the legacy instance-level "sample" push rule now replaced by organization_push_rules. Both columns, their indexes, and the associated dead code (PushRule#global?/is_sample? and fallback logic in ee/app/models/push_rule.rb) should be removed once self-managed cleanup completes.

Scope

  • Ignore both columns in the PushRule model (ignore_columns) in release M, drop columns in release M+1 per the standard column-removal process (https://docs.gitlab.com/development/database/avoiding_downtime_in_migrations/#dropping-columns)
  • Drop index_push_rules_on_organization_id and index_push_rules_on_is_sample (post-deploy migrations)
  • Remove belongs_to :organization and the def organization override, global?/is_sample? logic, and the OrganizationPushRuleFinder fallback reads in ee/app/models/push_rule.rb
  • Remove :is_sample from lib/gitlab/import_export/project/import_export.yml
  • Remove the push_rules: %w[organization_id] entry from ignored_fk_columns_map in spec/db/schema_spec.rb
  • Update db/docs/push_rules.yml if needed

Blocked by

  • #607954 — DeleteNullProjectIdPushRules BBM must be finalized for self-managed (scheduled for 19.6, after required stop 19.5)
  • #607955 — NOT NULL constraint on push_rules.project_id must be validated for self-managed (scheduled for 19.6, after required stop 19.5)

Until both complete, legacy rows with organization_id set may still exist on self-managed instances.

  • Dropping organization_id unblocks considering a unique index on push_rules.project_id: #493391
  • The regexp_uses_re2 column deprecation is tracked separately and is out of scope here: #553148 (closed)