Skip to content

Use a YAML file to define gitlab_schema for tables

What does this MR do and why?

Refactors a model annotation to be just defined in a YAML for all tables in 1 place.

This gitlab_schema is only used for now in specs to validate there are no cross-joins between different gitlab_schema. The same concept is also used in loose foreign keys definitions but they do not need to use this YAML file as the gitlab_schema is defined alongside the loose foreign key. In future we may consider removing the requirement for gitlab_schema on loose foriegn keys if that makes things simpler.

We were previously using the gitlab_schema annotation on models which was causing too much issues with missed models and generally it was trickier to get right due to autoloading issues among other fancy Ruby metaprogramming trickery.

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #342795 (closed)

Merge request reports

Loading