Initial namespacing services in `Integrations`
What does this MR do?
This change moves 3 models in project_services
to the Integrations::
namespace as part of
#201855 (closed).
The change is for AsanaService
, AssemblaService
and BambooService
(the first 3 alphabetical integrations) to become Integrations::Asana
, Integrations::Assembla
and Integrations::Bamboo
.
The STI problem
Models that inherit from Service
(soon to be renamed Integration
in !61210 (merged)) are STI models, and so the value of their type
attribute is essential for the Rails STI functionality. Rails sets the type
value of an STI model to its class name. Currently, the STI value of AsanaService
will be "AsanaService"
. In namespacing these classes we would normally break the STI functionality and start saving these records with type
value of "Integrations::Asana"
.
Gitlab::Integrations::StiType
In order to prevent breaking the STI functionality, this MR allows the namespace STI classes to continue to function as before with the use of a new custom attribute type (adapter) Gitlab::Integrations::StiType
.
This adapter can be used to selectively move models into the new namespace while maintaining the legacy STI type
values (e.g "AsanaService"
) needed in
order for the STI modelling to continue to work.
When all models have been namespaced, we can consider then performing data migrations of the type
values, and eventually remove the StiType
altogether.
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have not included a changelog entry because the change is not customer-facing.
-
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Related to #201855 (closed)