Skip to content

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

Availability and Testing

Related to #201855 (closed)

Edited by Luke Duncalfe

Merge request reports