Skip to content

Use class methods instead of constants to define model info in Geo registry classes

What does this MR do and why?

This code change refactors how GitLab's Geo replication system defines model relationships in registry classes. Previously, each registry class used constants (MODEL_CLASS and MODEL_FOREIGN_KEY) to specify which data model it tracks and the database field that links them together. The change converts these constants into class methods that return the same values.

This is a structural improvement that makes the code more flexible and maintainable. Instead of having fixed constants, the system now uses methods that can be overridden or customized if needed. The functionality remains exactly the same.

References

Geo: Use methods instead of constants for model... (#568336)

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading