Skip share with validation if database is cross-cell
What does this MR do and why?
Skip share with validation if database is cross-cell
- This MR introduces the ability to configure a database in
config/database.yml
ascross_cell: true
. - Only certain databases are allowed to be
cross_cell: true
. This is defined indb/database_connections/
. At the moment onlymain_clusterwide
is allowed to becross_cell
. - If a database is
cross_cell: true
, then we skip the validation related todatabase_tasks: false
and sharing withmain
.
Why? This allows a second GDK to be configured without having to set
GITLAB_VALIDATE_DATABASE_CONFIG=0
.
We will follow up in a https://gitlab.com/gitlab-org/gitlab-development-kit
MR to set cross_cell: true
in ../suppport/cells-add-secondary
main:
database: gitlabhq_development
host: this-gdk-host
main_clusterwide:
database_tasks: false
database: gitlabhq_development
host: some-other-gdk-host
Related issue: #412280
Screenshots or screen recordings
How to set up and validate locally
- Create a new GDK using https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/cells.md#install-another-gdk-to-act-as-a-cell
- In the new GDK,
cd
intogitlab
. Then runGITLAB_VALIDATE_DATABASE_CONFIG=1 bundle exec rake gitlab:db:validate_config
. It should fail as described in #412280 - Checkout this branch from the new GDK.
- Update
config/database.yml
, and addcross_cell: true
to themain_clusterwide
section. -
GITLAB_VALIDATE_DATABASE_CONFIG=1 bundle exec rake gitlab:db:validate_config
. It should now pass.
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 Thong Kuah