Remove support for uses_legacy_database_config
What does this MR do and why?
This was planned to to be removed in %15.0. This setting in
config/database.yml
(or inferred from the structure of
config/database.yml
) allowed GitLab installations (from source) to
stick to the old "flat" structure like:
production:
database: gitlabhq_production
host: 127.0.0.1
as opposed to the new "nested" structure:
production:
main:
database: gitlabhq_production
host: 127.0.0.1
which is a necessary step for optionally supporting our 2nd ci
database like:
production:
main:
database: gitlabhq_production
host: 127.0.0.1
c:
database: gitlabhq_production_ci
host: 127.0.0.1
This change does not make ci
required but it does make the nested structure (ie. main
key) required.
Since we've already updated Omnibus
installations and GDK to no longer generate the flat structure there
would only be installations from source that are affected by this change
and they should have already been receiving deprecation warnings for
some months. This change will ensure they see an error if they don't
have a top level main
key in their config/database.yml
and all they
need to do is nest the config under main
to fix the problem.
Screenshots or screen recordings
How to set up and validate locally
- Backup your
config/database.yml
:cp config/database.yml config/database.yml.bkp
- Configure your
config/database.yml
with flat structure as described above (by removing themain
key and moving the keys under it back 1 level of indentation, also removing theci
section entirely if you have it) - Start GDK
gdk start
- Tail the logs
gdk tail rails-web
- See the error
ERROR: This installation of GitLab uses unsupported 'config/database.yml'. The main: database needs to be defined as a first configuration item instead of primary. (RuntimeError)
- Restore your
config/database.yml
:cp config/database.yml.bkp config/database.yml
- Restart GDK
gdk stop && gdk start
- Tail the logs
gdk tail rails-web
- See there is no longer an error
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.
Closes #338182 (closed)