Remove deprecated gitlab_main_clusterwide schema references from codebase
Description:
All tables have been migrated away from the gitlab_main_clusterwide schema. This issue tracks the removal of all remaining code references to this deprecated schema.
Background
The gitlab_main_clusterwide schema has been deprecated as part of the GitLab Cells initiative. All tables previously using this schema have been migrated to appropriate alternatives (gitlab_main_cell, gitlab_main_cell_local, gitlab_main_user, gitlab_main_cell_setting, or gitlab_main_org).
Now we need to clean up all code references to prevent confusion and ensure the schema is no longer available for use.
Steps to Complete
-
Step 1: Remove schema from specs and tests
- Find all spec files that reference
gitlab_main_clusterwide(e.g.,spec/lib/gitlab/database/gitlab_schema_spec.rb) - Remove test cases that validate or allow this schema
- Update any test fixtures or mocks that use this schema
- Ensure CI/CD pipeline prevents creation of new tables with this schema
- A spec is kept to ensure no new table is added to
gitlab_main_clusterwideschema and to be removed in the last step..
- Find all spec files that reference
-
Step 2: Remove from code that relies on the schema
- Search for any application code that checks for or handles
gitlab_main_clusterwide - Remove conditional logic that treats this schema differently
- Update any schema validation or classification logic
- Remove from any allow-lists or exemption lists
- Search for any application code that checks for or handles
-
Step 3: Remove from documentation and comments
- Remove from
db/docs/schema documentation - Remove from code comments that reference this schema
- Update any migration guides or developer documentation
- Remove from schema selection guidelines
- Remove from
-
Step 4: Remove schema constant and definition
- Remove
gitlab_main_clusterwideconstant from schema definitions (likely inlib/gitlab/database/gitlab_schema.rbor similar) - Remove from any schema enum or list definitions
- Remove from any schema validation constants
- Remove the gatekeeping spec that allows no new tables to use
gitlab_main_clusterwideschema
- Remove
-
Step 5: Verify removal is complete
- Run grep/search to ensure no remaining references exist
- Verify CI/CD pipeline passes
- Confirm no broken references in documentation
Acceptance Criteria
- No references to
gitlab_main_clusterwideremain in the codebase - All tests pass
- CI/CD pipeline prevents creation of new tables with this schema
- No broken links or references in documentation
Related Issues
-
#504188 (closed) - Detect mis-categorization of
gitlab_schema - #548458 (closed) - Create draft MRs for tables that were previously gitlab_main_clusterwide
Edited by Chen Zhang