Service validations
Description of the proposal
We want to make sure that we always have the correct state in the database.
This issue keeps track of the different validations that we have to add to the Service
model to provide a robust platform.
There are other issues related to this one #205419 (closed) and #207385 (closed) but here you will find everything.
This is a follow-up from a recent incident gitlab-com/gl-infra/production#1651 (closed) and https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/9176 (internal).
Validations
-
Validates presence of project_id if not template (In place) -
Validates presence of project_id if not instance (!25714 (merged)) -
Validates absence of project_id if template (!26563 (merged)) -
Validates absence of project_id if instance (!25714 (merged)) -
Validates only one service template per type (!26380 (merged)) -
Validates only one instance-level service per type (!25714 (merged)) -
Validates only one service type per project (!25674 (closed), !26308 (merged)) -
Validates service is instance or template, not both (!25714 (merged))
Edited by Andy Schoenen