Figure out when a reference to a constant changes
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8281 added a Projects::Settings
module to contain the MembersController
.
Meanwhile, in EE, we had the Projects::UpdatePagesService
, which referred to the Settings
constant.
By pure luck, when we merge CE into EE, the Projects::Settings::MembersController
was loaded before the Projects::UpdatePagesService
specs ran, which meant that they failed, as they were looking for Projects::Settings.pages
instead of Settings.pages
.
@jameslopez has suggested adding something to the contribution guidelines to do a search when adding a module with a generic name. That wouldn't have helped here, as the problem was only added in EE, but it would in general. Another option is to somehow segregate namespaces by type (controller, service, lib), but ISTR Rails makes this tricky.
/cc @jameslopez @grzesiek