[go: up one dir, main page]

Skip to content

Shift validations in Integrations::Base::Integration to models

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

The following discussion from !170439 (merged) should be addressed:

  • @.luke started a discussion:

    Thought

    Once we've moved instance integrations out of the integrations table, it would be worth moving some of these validations out of the shared module and into the classes so Integration has different validations from Integrations::Instance::Integration.

    For example, Integrations::Instance::Integration could validate that instance is always true, and project_id and group_id are always nil. Integration could validate that instance is always false and that project_id or group_id are present, and so on.

There would be other things we can do too, like:

  • Remove Integrations::Base::Integration#instance_level? and add a method Integration#instance_level? which returns false in Integration.
  • Move Integrations::Base::Integration#parent to Integration and add a method Integrations::Instance::Integration#parent which returns nil.
Edited by 🤖 GitLab Bot 🤖