Add `gitlab:db:validate_config` to ensure the proper `database_tasks:` is set
What does this MR do and why?
Resolves part of: #356009 (closed).
This implements gitlab:db:validate_config
to ensure correctness of used database_tasks:
:
- A database configuration using
database_tasks: true
should not share this database with other jobs, - A database configuration using
database_tasks: false
should share the database withmain:
This is done by doing a simple dependency rake task chained to db:migrate/db:schema:load/dump
that:
- Connects to each database configuration
- Gets unique system identifier and current connected database
- Performs a set of validation checks according to above criteria
The purpose of this check is to prevent running db:migrate/db:schema:load
(and potentially loosing data)
if the configuration is invalid. This rake task will raise an exception in such case.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Kamil Trzciński