Series Context: Part 2 of 10 in GitLab Core Engineering: Architecture, MCP & CI/CD Deep Dives .
Featured MR: gitlab-org/gitlab!269059 · Work Item: #636678
Models Should Know Identity, Not URL Routing Anchors
ActiveRecord models in Rails should not construct Rails URL helper paths with UI DOM anchors hardcoded into them. Yet inside ee/app/models/ee/group.rb , duo_settings_path had quietly lived for years:
# Before (ee/app/models/ee/group.rb) def duo_settings_path if :: GitlabSubscriptions :: SubscriptionHelper . gitlab_com_subscription? && root? :: Gitlab :: Routing . url_helpers . group_settings_gitlab_duo_configuration_index_path ( self ) else :: Gitlab :: Routing . url_helpers .…